author | hgs |
Mon, 24 May 2010 20:51:35 +0300 | |
changeset 32 | 5c4486441ae6 |
parent 20 | 9c97ad6591ae |
child 41 | bbb64eb3bdee |
permissions | -rw-r--r-- |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* Control Panel packet data AP plugin unit testing. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#include <HbApplication> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#include <HbMainWindow> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <HbView> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
#include <HbDialog> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <HbRadioButtonList> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#include <HbAction> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#include <HbDataForm> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include <HbDataFormModel> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include <HbDataFormModelItem> |
32 | 27 |
#include <HbDataFormViewItem> |
28 |
#include <HbModelIterator> |
|
29 |
#include <HbComboBox> |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include <QtTest/QtTest> |
32 | 31 |
#include <etelpckt.h> |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include <cpbearerapplugininterface.h> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
#include <cmmanager_shim.h> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
#include <cmconnectionmethod_shim.h> |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include "cppacketdataapview.h" |
32 | 37 |
#include "cppacketdataapadvancedview.h" |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
#include "hbautotest.h" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
#include "testcppacketdataapplugin.h" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
// STATIC TEST DATA |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// Connection method (AP) ID used for testing |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
static const uint testApId = 1; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
static const QString pluginDir = |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
"\\resource\\qt\\plugins\\controlpanel\\bearerap"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
static const QString pluginName = "cppacketdataapplugin.dll"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
// Time to wait before continuing after an UI step |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
static const int waitTime = 10; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
// UI coordinates |
32 | 58 |
static const QPoint scrollMiddle(350, 280); |
59 |
static const QPoint scrollTop(350, 30); |
|
60 |
static const QPoint scrollBottom(350, 540); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
|
32 | 62 |
// Use positive offset if dropdown opens under the combobox |
63 |
static const QPoint comboBoxFirstItemOffset(80, 75); |
|
64 |
static const QPoint comboBoxItemOffset(0, 51); |
|
65 |
// Use negative offset if dropdown opens above the combobox |
|
66 |
static const QPoint comboBoxFirstItemNegativeOffset(80, -29); |
|
67 |
static const QPoint comboBoxItemNegativeOffset(0, -51); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
|
32 | 69 |
static const QPoint exitEditorOffset(-10, -20); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
32 | 71 |
static const QPoint messageBoxOkButtonOffset(160, 140); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
32 | 73 |
// Advanced settings groups |
74 |
static const QPoint ipGroup(160, 10); |
|
75 |
static const QPoint proxyGroup(160, 60); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
|
32 | 77 |
// Test strings |
78 |
static const QString tooLongUserName = |
|
79 |
"too long name 123456789012345678901234567890123456THISISEXTRA"; |
|
80 |
static const QString truncatedUserName = |
|
81 |
"too long name 123456789012345678901234567890123456"; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
// FRAMEWORK FUNCTIONS |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
* Test main function. Runs all test cases. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
#ifndef TESTCMAPPLSETTINGSUI_NO_OUTPUT_REDIRECT |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
int main(int argc, char *argv[]) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
HbApplication app(argc, argv); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
app.setApplicationName("TestCpPacketDataApPlugin"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
char *pass[3]; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
pass[0] = argv[0]; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
pass[1] = "-o"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
pass[2] = "c:\\data\\TestCpPacketDataApPlugin.txt"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
TestCpPacketDataApPlugin tc; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
int res = QTest::qExec(&tc, 3, pass); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
return res; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
#else |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
QTEST_MAIN(TestCpPacketDataApPlugin) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
#endif |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
* This function is be called before the first test case is executed. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
void TestCpPacketDataApPlugin::initTestCase() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
mMainWindow = new HbAutoTestMainWindow; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
//mMainWindow = new HbMainWindow; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
mMainWindow->show(); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
// Load plugin |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
QDir dir(pluginDir); |
32 | 121 |
mPluginLoader = new QPluginLoader(dir.absoluteFilePath(pluginName)); |
122 |
mPlugin = qobject_cast<CpBearerApPluginInterface *>(mPluginLoader->instance()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
QVERIFY(mPlugin != NULL); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
// Verify plugin bearer type |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
QVERIFY(mPlugin->bearerType() == CMManagerShim::BearerTypePacketData); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
|
32 | 128 |
// Write initial settings to CommsDat |
129 |
subInitializeCommsDat(); |
|
130 |
||
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
// Create packet data settings view (connection method ID given) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
subCreateSettingsView(testApId); |
32 | 133 |
|
134 |
subGetUiWidgets(); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
* This function is be called after the last test case was executed. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
void TestCpPacketDataApPlugin::cleanupTestCase() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
delete mMainWindow; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
mMainWindow = 0; |
32 | 144 |
|
145 |
// Force unloading of plugin |
|
146 |
mPluginLoader->unload(); |
|
147 |
delete mPluginLoader; |
|
148 |
mPluginLoader = 0; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
* This function is be called before each test case is executed. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
void TestCpPacketDataApPlugin::init() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
QTest::qWait(1000); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
* This function is be called after each test case is executed. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
void TestCpPacketDataApPlugin::cleanup() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
// TEST CASES |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
* Tests changing of connection name. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
void TestCpPacketDataApPlugin::tcChangeConnectionName() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
QFETCH(QString, string); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
QFETCH(QString, result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
|
32 | 178 |
HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
// Erase old string |
32 | 181 |
QString text = mTestView->mConnectionNameItem->contentWidgetData("text").toString(); |
182 |
subClearLineEdit(text.size()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
// Enter new string |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
|
32 | 187 |
HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
CMManagerShim::CmName, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
mTestView->mConnectionNameItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
* Test data for connection name change test case. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
void TestCpPacketDataApPlugin::tcChangeConnectionName_data() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
QTest::addColumn<QString>("string"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
QTest::addColumn<QString>("result"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
QTest::newRow("maximum length") |
32 | 205 |
<< "really long name 123456789012345678901234567890123" |
206 |
<< "really long name 123456789012345678901234567890123"; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
QTest::newRow("too long") |
32 | 208 |
<< "too long name 12345678901234567890123456789012345678901234" |
209 |
<< "too long name 123456789012345678901234567890123456"; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
QTest::newRow("basic") // last one must always fit on one line in UI |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
<< "test packet AP" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
<< "test packet AP"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
* Tests that empty connection name is not accepted. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
void TestCpPacketDataApPlugin::tcConnectionNameEmpty() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
QString previous = |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
mTestView->mConnectionNameItem->contentWidgetData("text").toString(); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
|
32 | 223 |
HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
// Erase old string |
32 | 226 |
QString text = mTestView->mConnectionNameItem->contentWidgetData("text").toString(); |
227 |
subClearLineEdit(text.size()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
|
32 | 229 |
HbAutoTest::mouseClick(mMainWindow, mConnectionNameWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
QTest::qWait(100); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
// Dismiss messagebox |
32 | 233 |
HbAutoTest::mouseClick( |
234 |
mMainWindow, |
|
235 |
mTestView->mMessageBox.data(), |
|
236 |
messageBoxOkButtonOffset); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
CMManagerShim::CmName, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
mTestView->mConnectionNameItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
previous); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
* Tests changing of access point name. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
void TestCpPacketDataApPlugin::tcChangeAccessPointName() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
QFETCH(QString, string); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
QFETCH(QString, result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
|
32 | 253 |
HbAutoTest::mouseClick(mMainWindow, mAccessPointNameWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
// Erase old string |
32 | 256 |
QString text = mTestView->mAccessPointNameItem->contentWidgetData("text").toString(); |
257 |
subClearLineEdit(text.size()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
// Enter new string |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
|
32 | 262 |
HbAutoTest::mouseClick(mMainWindow, mAccessPointNameWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
265 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
266 |
CMManagerShim::PacketDataAPName, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
mTestView->mAccessPointNameItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
* Test data for access point name change test case. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
void TestCpPacketDataApPlugin::tcChangeAccessPointName_data() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
QTest::addColumn<QString>("string"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
QTest::addColumn<QString>("result"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
QTest::newRow("maximum length") |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
<< "really long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
<< "really long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
QTest::newRow("too long") |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
<< "too long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
<< "too long name 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
QTest::newRow("basic") // last one must always fit on one line in UI |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
<< "test AP name" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
<< "test AP name"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
* Tests that empty access point name is not accepted. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
void TestCpPacketDataApPlugin::tcAccessPointNameEmpty() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
295 |
QString previous = |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
296 |
mTestView->mAccessPointNameItem->contentWidgetData("text").toString(); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
297 |
|
32 | 298 |
HbAutoTest::mouseClick(mMainWindow, mAccessPointNameWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
299 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
300 |
// Erase old string |
32 | 301 |
QString text = mTestView->mAccessPointNameItem->contentWidgetData("text").toString(); |
302 |
subClearLineEdit(text.size()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
|
32 | 304 |
HbAutoTest::mouseClick(mMainWindow, mAccessPointNameWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
QTest::qWait(100); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
// Dismiss messagebox |
32 | 308 |
HbAutoTest::mouseClick( |
309 |
mMainWindow, |
|
310 |
mTestView->mMessageBox.data(), |
|
311 |
messageBoxOkButtonOffset); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
315 |
CMManagerShim::PacketDataAPName, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
316 |
mTestView->mAccessPointNameItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
317 |
previous); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
|
32 | 320 |
|
321 |
/** |
|
322 |
* Tests handling of too long string from CommsDat (longer than UI accepts). |
|
323 |
*/ |
|
324 |
void TestCpPacketDataApPlugin::tcTooLongUserNameInCommsDat() |
|
325 |
{ |
|
326 |
// Verify UI text, the widget contains the too long string, even though |
|
327 |
// it is not shown completely on UI |
|
328 |
QString text = mTestView->mUserNameItem->contentWidgetData("text").toString(); |
|
329 |
QCOMPARE(tooLongUserName, text); |
|
330 |
||
331 |
QTest::qWait(1000); |
|
332 |
||
333 |
// Visit editing state, truncated string should be saved to CommsDat |
|
334 |
HbAutoTest::mouseClick(mMainWindow, mUserNameWidget); |
|
335 |
||
336 |
QTest::qWait(1000); |
|
337 |
||
338 |
HbAutoTest::mouseClick(mMainWindow, mUserNameWidget, exitEditorOffset); |
|
339 |
||
340 |
// Verify both commsdat and UI widget |
|
341 |
subVerifyString( |
|
342 |
CMManagerShim::PacketDataIFAuthName, |
|
343 |
mTestView->mUserNameItem, |
|
344 |
truncatedUserName); |
|
345 |
} |
|
346 |
||
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
347 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
348 |
* Tests changing of user name. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
349 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
350 |
void TestCpPacketDataApPlugin::tcChangeUserName() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
351 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
352 |
QFETCH(QString, string); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
353 |
QFETCH(QString, result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
354 |
|
32 | 355 |
HbAutoTest::mouseClick(mMainWindow, mUserNameWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
356 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
357 |
// Erase old string |
32 | 358 |
QString text = mTestView->mUserNameItem->contentWidgetData("text").toString(); |
359 |
subClearLineEdit(text.size()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
361 |
// Enter new string |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
362 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
363 |
|
32 | 364 |
HbAutoTest::mouseClick(mMainWindow, mUserNameWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
365 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
366 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
367 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
368 |
CMManagerShim::PacketDataIFAuthName, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
369 |
mTestView->mUserNameItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
370 |
result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
371 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
372 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
373 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
374 |
* Test data for user name change test case. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
375 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
376 |
void TestCpPacketDataApPlugin::tcChangeUserName_data() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
377 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
378 |
QTest::addColumn<QString>("string"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
379 |
QTest::addColumn<QString>("result"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
380 |
|
32 | 381 |
QTest::newRow("maximum length") |
382 |
<< "really long name 123456789012345678901234567890123" |
|
383 |
<< "really long name 123456789012345678901234567890123"; |
|
384 |
QTest::newRow("too long") |
|
385 |
<< "too long name 1234567890123456789012345678901234567890123" |
|
386 |
<< "too long name 123456789012345678901234567890123456"; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
QTest::newRow("basic") |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
<< "username" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
<< "username"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
QTest::newRow("empty") // last one must always fit on one line in UI |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
<< "" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
<< ""; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
* Scrolls the tested view to the bottom. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
void TestCpPacketDataApPlugin::tcScrollToBottom() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
{ |
32 | 400 |
subScrollToBottom(); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
* Tests "prompt" password checkbox. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
void TestCpPacketDataApPlugin::tcChangePromptPassword() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
// Ensure prompt for password is unchecked |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
bool prompt = subGetBool(CMManagerShim::PacketDataIFPromptForAuth); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
if (prompt) { |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
// Disable prompt for password |
32 | 412 |
HbAutoTest::mouseClick(mMainWindow, mPasswordPromptWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
415 |
// Enable prompt for password and verify |
32 | 416 |
HbAutoTest::mouseClick(mMainWindow, mPasswordPromptWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
subVerifyBool( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
CMManagerShim::PacketDataIFPromptForAuth, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
true); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
// Verify that password lineedit is disabled, following steps will |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
// fail if editing is allowed |
32 | 423 |
HbAutoTest::mouseClick(mMainWindow, mPasswordWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
QTest::qWait(waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
// Disable prompt for password and verify |
32 | 427 |
HbAutoTest::mouseClick(mMainWindow, mPasswordPromptWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
subVerifyBool( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
CMManagerShim::PacketDataIFPromptForAuth, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
false); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
* Tests changing of password. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
void TestCpPacketDataApPlugin::tcChangePassword() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
QFETCH(QString, string); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
439 |
QFETCH(QString, result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
|
32 | 441 |
HbAutoTest::mouseClick(mMainWindow, mPasswordWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
442 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
// Erase old string |
32 | 444 |
QString text = mTestView->mPasswordItem->contentWidgetData("text").toString(); |
445 |
subClearLineEdit(text.size()); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
// Enter new string |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
449 |
|
32 | 450 |
HbAutoTest::mouseClick(mMainWindow, mPasswordWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
451 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
CMManagerShim::PacketDataIFAuthPass, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
mTestView->mPasswordItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
459 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
* Test data for password change test case. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
void TestCpPacketDataApPlugin::tcChangePassword_data() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
QTest::addColumn<QString>("string"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
QTest::addColumn<QString>("result"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
|
32 | 467 |
QTest::newRow("maximum length") |
468 |
<< "really long name 123456789012345678901234567890123" |
|
469 |
<< "really long name 123456789012345678901234567890123"; |
|
470 |
QTest::newRow("too long") |
|
471 |
<< "too long name 1234567890123456789012345678901234567890123" |
|
472 |
<< "too long name 123456789012345678901234567890123456"; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
QTest::newRow("basic") |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
474 |
<< "password" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
475 |
<< "password"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
476 |
QTest::newRow("empty") // last one must always fit on one line in UI |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
<< "" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
<< ""; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
* Tests changing of authentication mode. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
void TestCpPacketDataApPlugin::tcChangeAuthenticationMode() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
485 |
{ |
32 | 486 |
QPointF normalPointOffset = comboBoxFirstItemOffset; |
487 |
QPointF securePointOffset = comboBoxFirstItemOffset + comboBoxItemOffset; |
|
488 |
||
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
// Set authentication mode to secure |
32 | 490 |
HbAutoTest::mouseClick(mMainWindow, mAuthenticationWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
QTest::qWait(100); |
32 | 492 |
HbAutoTest::mouseClick(mMainWindow, mAuthenticationWidget, securePointOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
subVerifyBool( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
495 |
CMManagerShim::PacketDataDisablePlainTextAuth, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
true); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
497 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
498 |
// Set authentication mode to normal |
32 | 499 |
HbAutoTest::mouseClick(mMainWindow, mAuthenticationWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
QTest::qWait(100); |
32 | 501 |
HbAutoTest::mouseClick(mMainWindow, mAuthenticationWidget, normalPointOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
503 |
subVerifyBool( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
CMManagerShim::PacketDataDisablePlainTextAuth, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
505 |
false); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
506 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
507 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
508 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
509 |
* Tests changing of homepage. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
510 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
511 |
void TestCpPacketDataApPlugin::tcChangeHomepage() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
512 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
513 |
QFETCH(QString, string); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
514 |
QFETCH(QString, result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
515 |
|
32 | 516 |
HbAutoTest::mouseClick(mMainWindow, mHomepageWidget); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
517 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
518 |
// Erase old string |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
519 |
QString text = mTestView->mHomepageItem->contentWidgetData("text").toString(); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
520 |
subClearLineEdit(text.size()); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
521 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
522 |
// Enter new string |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
523 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
524 |
|
32 | 525 |
HbAutoTest::mouseClick(mMainWindow, mHomepageWidget, exitEditorOffset); |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
526 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
527 |
// Verify both commsdat and UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
CMManagerShim::CmStartPage, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
mTestView->mHomepageItem, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
result); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
532 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
533 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
534 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
535 |
* Test data for homepage change test case. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
536 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
537 |
void TestCpPacketDataApPlugin::tcChangeHomepage_data() |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
538 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
539 |
QTest::addColumn<QString>("string"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
QTest::addColumn<QString>("result"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
|
32 | 542 |
QTest::newRow("long") |
543 |
<< "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html" |
|
544 |
<< "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"; |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
545 |
QTest::newRow("basic") // last one should always fit on one line in UI |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
546 |
<< "http://www.symbian.org/" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
547 |
<< "http://www.symbian.org/"; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
548 |
QTest::newRow("empty") |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
549 |
<< "" |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
550 |
<< ""; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
551 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
552 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
553 |
/** |
32 | 554 |
* Opens advanced settings view. |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
555 |
*/ |
32 | 556 |
void TestCpPacketDataApPlugin::tcOpenAdvancedSettingsView() |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
557 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
// Launch advanced settings view |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
559 |
bool status = connect( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
this, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
561 |
SIGNAL(menuActionTriggered(HbAction *)), |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
562 |
mTestView, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
563 |
SLOT(menuActionTriggered(HbAction *))); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
564 |
Q_ASSERT(status); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
emit menuActionTriggered(mTestView->mAdvancedSettingsAction); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
|
32 | 567 |
QTest::qWait(1000); |
568 |
||
569 |
mTestViewAdvanced = static_cast<CpPacketDataApAdvancedView *>(mMainWindow->currentView()); |
|
570 |
} |
|
571 |
||
572 |
/** |
|
573 |
* Expands the IP settings group. |
|
574 |
*/ |
|
575 |
void TestCpPacketDataApPlugin::tcExpandIpSettings() |
|
576 |
{ |
|
577 |
HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, ipGroup); |
|
578 |
||
579 |
subGetAdvancedUiWidgets(0); |
|
580 |
} |
|
581 |
||
582 |
/** |
|
583 |
* Sets the network type to IPv4 and gets UI widget pointers. |
|
584 |
*/ |
|
585 |
void TestCpPacketDataApPlugin::tcSetIpv4NetworkType() |
|
586 |
{ |
|
587 |
QPointF ipv4PointOffset = comboBoxFirstItemOffset; |
|
588 |
||
589 |
// Set network type to IPv4 |
|
590 |
HbAutoTest::mouseClick(mMainWindow, mNetworkTypeWidget); |
|
591 |
HbAutoTest::mouseClick(mMainWindow, mNetworkTypeWidget, ipv4PointOffset, 100); |
|
592 |
subVerifyUint(CMManagerShim::PacketDataPDPType, RPacketContext::EPdpTypeIPv4); |
|
593 |
||
594 |
subGetAdvancedUiWidgets(0); |
|
595 |
} |
|
596 |
||
597 |
/** |
|
598 |
* Tests enabling of automatic phone IP address. |
|
599 |
*/ |
|
600 |
void TestCpPacketDataApPlugin::tcEnableAutomaticIpv4Address() |
|
601 |
{ |
|
602 |
Qt::CheckState state = static_cast<Qt::CheckState> |
|
603 |
(mTestViewAdvanced->mIpv4Automatic->contentWidgetData("checkState").toInt()); |
|
604 |
if (state == Qt::Checked) { |
|
605 |
// Disable automatic IP address |
|
606 |
HbAutoTest::mouseClick(mMainWindow, mIpv4AddressAutomaticWidget); |
|
607 |
} |
|
608 |
// Enable automatic IP address |
|
609 |
HbAutoTest::mouseClick(mMainWindow, mIpv4AddressAutomaticWidget); |
|
610 |
subVerifyBool( |
|
611 |
CMManagerShim::PacketDataIPAddrFromServer, |
|
612 |
true); |
|
613 |
||
614 |
// Ensure that editing the IP address is not allowed |
|
615 |
HbAutoTest::mouseClick(mMainWindow, mIpv4AddressWidget); |
|
616 |
} |
|
617 |
||
618 |
/** |
|
619 |
* Tests disabling of automatic phone IP address. |
|
620 |
*/ |
|
621 |
void TestCpPacketDataApPlugin::tcEnableUserDefinedIpv4Address() |
|
622 |
{ |
|
623 |
Qt::CheckState state = static_cast<Qt::CheckState> |
|
624 |
(mTestViewAdvanced->mIpv4Automatic->contentWidgetData("checkState").toInt()); |
|
625 |
if (state == Qt::Checked) { |
|
626 |
// Disable automatic IP address |
|
627 |
HbAutoTest::mouseClick(mMainWindow, mIpv4AddressAutomaticWidget); |
|
628 |
} |
|
629 |
// Can't verify the setting from CommsDat here, because CMManager will |
|
630 |
// set it back to true if no valid IP address is yet defined. The flag |
|
631 |
// is verified in tcChangeIpAddress(). |
|
632 |
} |
|
633 |
||
634 |
/** |
|
635 |
* Tests changing of IP address. |
|
636 |
*/ |
|
637 |
void TestCpPacketDataApPlugin::tcChangeIpAddress() |
|
638 |
{ |
|
639 |
QFETCH(QString, string); |
|
640 |
QFETCH(QString, result); |
|
641 |
||
642 |
HbAutoTest::mouseClick(mMainWindow, mIpv4AddressWidget); |
|
643 |
||
644 |
// Erase old string |
|
645 |
QString text = mTestViewAdvanced->mIpv4Address->contentWidgetData("text").toString(); |
|
646 |
subClearLineEdit(text.size()); |
|
647 |
||
648 |
// Enter new string |
|
649 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
650 |
||
651 |
HbAutoTest::mouseClick(mMainWindow, mIpv4AddressWidget, exitEditorOffset); |
|
652 |
||
653 |
// Verify both commsdat and UI widget |
|
654 |
subVerifyString( |
|
655 |
CMManagerShim::PacketDataIPAddr, |
|
656 |
mTestViewAdvanced->mIpv4Address, |
|
657 |
result); |
|
658 |
subVerifyBool( |
|
659 |
CMManagerShim::PacketDataIPAddrFromServer, |
|
660 |
false); |
|
661 |
} |
|
662 |
||
663 |
/** |
|
664 |
* Test data for IP address change test case. |
|
665 |
*/ |
|
666 |
void TestCpPacketDataApPlugin::tcChangeIpAddress_data() |
|
667 |
{ |
|
668 |
QTest::addColumn<QString>("string"); |
|
669 |
QTest::addColumn<QString>("result"); |
|
670 |
||
671 |
QTest::newRow("too long") |
|
672 |
<< "255.255.255.2551234" |
|
673 |
<< "255.255.255.255"; |
|
674 |
QTest::newRow("normal") |
|
675 |
<< "192.168.0.1" |
|
676 |
<< "192.168.0.1"; |
|
677 |
} |
|
678 |
||
679 |
/** |
|
680 |
* Scrolls the tested view to the bottom. |
|
681 |
*/ |
|
682 |
void TestCpPacketDataApPlugin::tcScrollToBottom2() |
|
683 |
{ |
|
684 |
subScrollToBottom(); |
|
685 |
||
686 |
subGetAdvancedUiWidgets(0); |
|
687 |
} |
|
688 |
||
689 |
/** |
|
690 |
* Tests enabling of automatic IPv4 DNS addresses. |
|
691 |
*/ |
|
692 |
void TestCpPacketDataApPlugin::tcEnableAutomaticIpv4DnsAddress() |
|
693 |
{ |
|
694 |
Qt::CheckState state = static_cast<Qt::CheckState> |
|
695 |
(mTestViewAdvanced->mIpv4DnsAutomatic->contentWidgetData("checkState").toInt()); |
|
696 |
if (state == Qt::Checked) { |
|
697 |
// Disable automatic IPv4 DNS address |
|
698 |
HbAutoTest::mouseClick(mMainWindow, mIpv4DnsAddressAutomaticWidget); |
|
699 |
} |
|
700 |
// Enable automatic IPv4 DNS address |
|
701 |
HbAutoTest::mouseClick(mMainWindow, mIpv4DnsAddressAutomaticWidget); |
|
702 |
subVerifyBool( |
|
703 |
CMManagerShim::PacketDataIPDNSAddrFromServer, |
|
704 |
true); |
|
705 |
||
706 |
// Ensure that editing the IP address is not allowed |
|
707 |
HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget); |
|
708 |
HbAutoTest::mouseClick(mMainWindow, mIpv4SecondaryDnsAddressWidget); |
|
709 |
} |
|
710 |
||
711 |
/** |
|
712 |
* Tests disabling of automatic IPv4 DNS addresses. |
|
713 |
*/ |
|
714 |
void TestCpPacketDataApPlugin::tcEnableUserDefinedIpv4DnsAddress() |
|
715 |
{ |
|
716 |
Qt::CheckState state = static_cast<Qt::CheckState> |
|
717 |
(mTestViewAdvanced->mIpv4DnsAutomatic->contentWidgetData("checkState").toInt()); |
|
718 |
if (state == Qt::Checked) { |
|
719 |
// Disable automatic IPv4 DNS address |
|
720 |
HbAutoTest::mouseClick(mMainWindow, mIpv4DnsAddressAutomaticWidget); |
|
721 |
} |
|
722 |
// Can't verify the setting from CommsDat here, because CMManager will |
|
723 |
// set it back to true if no valid IP address is yet defined. The flag |
|
724 |
// is verified in tcChangeIpv4DnsAddress(). |
|
725 |
} |
|
726 |
||
727 |
/** |
|
728 |
* Tests changing of IPv4 DNS addresses. |
|
729 |
*/ |
|
730 |
void TestCpPacketDataApPlugin::tcChangeIpv4DnsAddress() |
|
731 |
{ |
|
732 |
QFETCH(QString, string); |
|
733 |
QFETCH(QString, result); |
|
734 |
||
735 |
// Primary DNS address |
|
736 |
HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget); |
|
737 |
||
738 |
// Erase old string |
|
739 |
QString text = mTestViewAdvanced->mIpv4DnsAddress1->contentWidgetData("text").toString(); |
|
740 |
subClearLineEdit(text.size()); |
|
741 |
||
742 |
// Enter new string |
|
743 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
744 |
||
745 |
HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget, exitEditorOffset); |
|
746 |
||
747 |
// Verify both commsdat and UI widget |
|
748 |
subVerifyString( |
|
749 |
CMManagerShim::PacketDataIPNameServer1, |
|
750 |
mTestViewAdvanced->mIpv4DnsAddress1, |
|
751 |
result); |
|
752 |
||
753 |
// Secondary DNS address |
|
754 |
HbAutoTest::mouseClick(mMainWindow, mIpv4SecondaryDnsAddressWidget); |
|
755 |
||
756 |
// Erase old string |
|
757 |
text = mTestViewAdvanced->mIpv4DnsAddress2->contentWidgetData("text").toString(); |
|
758 |
subClearLineEdit(text.size()); |
|
759 |
||
760 |
// Enter new string |
|
761 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
762 |
||
763 |
HbAutoTest::mouseClick(mMainWindow, mIpv4SecondaryDnsAddressWidget, exitEditorOffset); |
|
764 |
||
765 |
// Verify both commsdat and UI widget |
|
766 |
subVerifyString( |
|
767 |
CMManagerShim::PacketDataIPNameServer2, |
|
768 |
mTestViewAdvanced->mIpv4DnsAddress2, |
|
769 |
result); |
|
770 |
||
771 |
// Verify user defined address is in use |
|
772 |
subVerifyBool( |
|
773 |
CMManagerShim::PacketDataIPDNSAddrFromServer, |
|
774 |
false); |
|
775 |
} |
|
776 |
||
777 |
/** |
|
778 |
* Test data for IPv4 DNS address change test case. |
|
779 |
*/ |
|
780 |
void TestCpPacketDataApPlugin::tcChangeIpv4DnsAddress_data() |
|
781 |
{ |
|
782 |
QTest::addColumn<QString>("string"); |
|
783 |
QTest::addColumn<QString>("result"); |
|
784 |
||
785 |
QTest::newRow("too long") |
|
786 |
<< "255.255.255.2551234" |
|
787 |
<< "255.255.255.255"; |
|
788 |
QTest::newRow("normal") |
|
789 |
<< "192.168.0.1" |
|
790 |
<< "192.168.0.1"; |
|
791 |
} |
|
792 |
||
793 |
/** |
|
794 |
* Tests invalid IPv4 DNS address. |
|
795 |
*/ |
|
796 |
void TestCpPacketDataApPlugin::tcInvalidIpv4DnsAddress() |
|
797 |
{ |
|
798 |
QString previous = |
|
799 |
mTestViewAdvanced->mIpv4DnsAddress1->contentWidgetData("text").toString(); |
|
800 |
||
801 |
HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget); |
|
802 |
||
803 |
// Erase old string |
|
804 |
QString text = mTestViewAdvanced->mIpv4DnsAddress1->contentWidgetData("text").toString(); |
|
805 |
subClearLineEdit(text.size()); |
|
806 |
||
807 |
// Enter new string |
|
808 |
HbAutoTest::keyClicks(mMainWindow, "999.999.999.999", 0, waitTime); |
|
809 |
||
810 |
HbAutoTest::mouseClick(mMainWindow, mIpv4PrimaryDnsAddressWidget, exitEditorOffset); |
|
811 |
||
812 |
QTest::qWait(100); |
|
813 |
// Dismiss messagebox |
|
814 |
HbAutoTest::mouseClick( |
|
815 |
mMainWindow, |
|
816 |
mTestViewAdvanced->mMessageBox.data(), |
|
817 |
messageBoxOkButtonOffset); |
|
818 |
||
819 |
// Verify both commsdat and UI widget |
|
820 |
subVerifyString( |
|
821 |
CMManagerShim::PacketDataIPNameServer1, |
|
822 |
mTestViewAdvanced->mIpv4DnsAddress1, |
|
823 |
previous); |
|
824 |
} |
|
825 |
||
826 |
/** |
|
827 |
* Scrolls the tested view to the top. |
|
828 |
*/ |
|
829 |
void TestCpPacketDataApPlugin::tcScrollToTop() |
|
830 |
{ |
|
831 |
subScrollToTop(); |
|
832 |
} |
|
833 |
||
834 |
/** |
|
835 |
* Sets the network type to IPv6 and gets UI widget pointers. |
|
836 |
*/ |
|
837 |
void TestCpPacketDataApPlugin::tcSetIpv6NetworkType() |
|
838 |
{ |
|
839 |
QPointF ipv6PointOffset = comboBoxFirstItemOffset + comboBoxItemOffset; |
|
840 |
||
841 |
// Set network type to IPv6 |
|
842 |
HbAutoTest::mouseClick(mMainWindow, mNetworkTypeWidget); |
|
843 |
HbAutoTest::mouseClick(mMainWindow, mNetworkTypeWidget, ipv6PointOffset, 100); |
|
844 |
subVerifyUint(CMManagerShim::PacketDataPDPType, RPacketContext::EPdpTypeIPv6); |
|
845 |
||
846 |
subGetAdvancedUiWidgets(0); |
|
847 |
} |
|
848 |
||
849 |
/** |
|
850 |
* Tests enabling of automatic IPv6 DNS addresses. |
|
851 |
*/ |
|
852 |
void TestCpPacketDataApPlugin::tcEnableAutomaticIpv6DnsAddress() |
|
853 |
{ |
|
854 |
// Enable automatic IPv6 DNS address |
|
855 |
QPointF automaticPointOffset = comboBoxFirstItemOffset; |
|
856 |
HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
|
857 |
QTest::qWait(100); |
|
858 |
HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, automaticPointOffset, 100); |
|
859 |
QTest::qWait(100); |
|
860 |
subVerifyBool( |
|
861 |
CMManagerShim::PacketDataIPIP6DNSAddrFromServer, |
|
862 |
true); |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
863 |
|
32 | 864 |
// Ensure that editing the IP address is not allowed |
865 |
HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget); |
|
866 |
HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget); |
|
867 |
} |
|
868 |
||
869 |
/** |
|
870 |
* Tests enabling of well-known IPv6 DNS addresses. |
|
871 |
*/ |
|
872 |
void TestCpPacketDataApPlugin::tcEnableWellKnownIpv6DnsAddress() |
|
873 |
{ |
|
874 |
// Enable well-known IPv6 DNS address |
|
875 |
QPointF wellKnownPointOffset = comboBoxFirstItemOffset + comboBoxItemOffset; |
|
876 |
HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
|
877 |
QTest::qWait(100); |
|
878 |
HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, wellKnownPointOffset, 100); |
|
879 |
QTest::qWait(100); |
|
880 |
subVerifyBool( |
|
881 |
CMManagerShim::PacketDataIPIP6DNSAddrFromServer, |
|
882 |
false); |
|
883 |
subVerifyString( |
|
884 |
CMManagerShim::PacketDataIPIP6NameServer1, |
|
885 |
mTestViewAdvanced->mIpv6DnsAddress1, |
|
886 |
"fec0:000:0000:ffff::1"); |
|
887 |
subVerifyString( |
|
888 |
CMManagerShim::PacketDataIPIP6NameServer2, |
|
889 |
mTestViewAdvanced->mIpv6DnsAddress2, |
|
890 |
"fec0:000:0000:ffff::2"); |
|
891 |
||
892 |
// Ensure that editing the IP address is not allowed |
|
893 |
HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget); |
|
894 |
HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget); |
|
895 |
} |
|
896 |
||
897 |
/** |
|
898 |
* Tests enabling of user defined IPv6 DNS addresses. |
|
899 |
*/ |
|
900 |
void TestCpPacketDataApPlugin::tcEnableUserDefinedIpv6DnsAddress() |
|
901 |
{ |
|
902 |
// Select user defined IPv6 DNS address |
|
903 |
QPointF userDefinedPointOffset = comboBoxFirstItemOffset + comboBoxItemOffset * 2; |
|
904 |
//QPointF userDefinedPointOffset(0, 160); |
|
905 |
HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget); |
|
906 |
QTest::qWait(100); |
|
907 |
HbAutoTest::mouseClick(mMainWindow, mIpv6DnsAddressAutomaticWidget, userDefinedPointOffset, 100); |
|
908 |
QTest::qWait(100); |
|
909 |
// Can't verify the setting from CommsDat here, because CMManager will |
|
910 |
// set it back to true if no valid IP address is yet defined. The flag |
|
911 |
// is verified in tcChangeIpv4DnsAddress(). |
|
912 |
} |
|
913 |
||
914 |
/** |
|
915 |
* Tests changing of IPv6 DNS addresses. |
|
916 |
*/ |
|
917 |
void TestCpPacketDataApPlugin::tcChangeIpv6DnsAddress() |
|
918 |
{ |
|
919 |
QFETCH(QString, string); |
|
920 |
QFETCH(QString, result); |
|
921 |
||
922 |
// Primary DNS address |
|
923 |
HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget); |
|
924 |
||
925 |
// Erase old string |
|
926 |
QString text = mTestViewAdvanced->mIpv6DnsAddress1->contentWidgetData("text").toString(); |
|
927 |
subClearLineEdit(text.size()); |
|
928 |
||
929 |
// Enter new string |
|
930 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
931 |
||
932 |
HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget, exitEditorOffset); |
|
933 |
||
934 |
// Verify both commsdat and UI widget |
|
935 |
subVerifyString( |
|
936 |
CMManagerShim::PacketDataIPIP6NameServer1, |
|
937 |
mTestViewAdvanced->mIpv6DnsAddress1, |
|
938 |
result); |
|
939 |
||
940 |
// Secondary DNS address |
|
941 |
HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget); |
|
942 |
||
943 |
// Erase old string |
|
944 |
text = mTestViewAdvanced->mIpv6DnsAddress2->contentWidgetData("text").toString(); |
|
945 |
subClearLineEdit(text.size()); |
|
946 |
||
947 |
// Enter new string |
|
948 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
949 |
||
950 |
HbAutoTest::mouseClick(mMainWindow, mIpv6SecondaryDnsAddressWidget, exitEditorOffset); |
|
951 |
||
952 |
// Verify both commsdat and UI widget |
|
953 |
subVerifyString( |
|
954 |
CMManagerShim::PacketDataIPIP6NameServer2, |
|
955 |
mTestViewAdvanced->mIpv6DnsAddress2, |
|
956 |
result); |
|
957 |
||
958 |
// Verify user defined address is in use |
|
959 |
subVerifyBool( |
|
960 |
CMManagerShim::PacketDataIPIP6DNSAddrFromServer, |
|
961 |
false); |
|
962 |
} |
|
963 |
||
964 |
/** |
|
965 |
* Test data for IPv6 DNS address change test case. |
|
966 |
*/ |
|
967 |
void TestCpPacketDataApPlugin::tcChangeIpv6DnsAddress_data() |
|
968 |
{ |
|
969 |
QTest::addColumn<QString>("string"); |
|
970 |
QTest::addColumn<QString>("result"); |
|
971 |
||
972 |
QTest::newRow("normal") |
|
973 |
<< "2001:db8:85a3::8a2e:370:7334" |
|
974 |
<< "2001:db8:85a3:0:0:8a2e:370:7334"; |
|
975 |
} |
|
976 |
||
977 |
/** |
|
978 |
* Tests invalid IPv6 DNS address. |
|
979 |
*/ |
|
980 |
void TestCpPacketDataApPlugin::tcInvalidIpv6DnsAddress() |
|
981 |
{ |
|
982 |
QString previous = |
|
983 |
mTestViewAdvanced->mIpv6DnsAddress1->contentWidgetData("text").toString(); |
|
984 |
||
985 |
HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget); |
|
986 |
||
987 |
// Erase old string |
|
988 |
QString text = mTestViewAdvanced->mIpv6DnsAddress1->contentWidgetData("text").toString(); |
|
989 |
subClearLineEdit(text.size()); |
|
990 |
||
991 |
// Enter new string |
|
992 |
HbAutoTest::keyClicks(mMainWindow, "abcdef:fedcba", 0, waitTime); |
|
993 |
||
994 |
HbAutoTest::mouseClick(mMainWindow, mIpv6PrimaryDnsAddressWidget, exitEditorOffset); |
|
995 |
||
996 |
QTest::qWait(100); |
|
997 |
// Dismiss messagebox |
|
998 |
HbAutoTest::mouseClick( |
|
999 |
mMainWindow, |
|
1000 |
mTestViewAdvanced->mMessageBox.data(), |
|
1001 |
messageBoxOkButtonOffset); |
|
1002 |
||
1003 |
// Verify both commsdat and UI widget |
|
1004 |
subVerifyString( |
|
1005 |
CMManagerShim::PacketDataIPIP6NameServer1, |
|
1006 |
mTestViewAdvanced->mIpv6DnsAddress1, |
|
1007 |
previous); |
|
1008 |
} |
|
1009 |
||
1010 |
/** |
|
1011 |
* Collapses the IP settings group. |
|
1012 |
*/ |
|
1013 |
void TestCpPacketDataApPlugin::tcCollapseIpSettings() |
|
1014 |
{ |
|
1015 |
HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, ipGroup); |
|
1016 |
} |
|
1017 |
||
1018 |
/** |
|
1019 |
* Expands the proxy settings group and gets UI widget pointers. |
|
1020 |
*/ |
|
1021 |
void TestCpPacketDataApPlugin::tcExpandProxySettingsAndGetUiWidgets() |
|
1022 |
{ |
|
1023 |
HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, proxyGroup); |
|
1024 |
||
1025 |
QTest::qWait(500); |
|
1026 |
||
1027 |
subGetAdvancedUiWidgets(1); |
|
1028 |
} |
|
1029 |
||
1030 |
/** |
|
1031 |
* Tests changing of proxy server address. |
|
1032 |
*/ |
|
1033 |
void TestCpPacketDataApPlugin::tcChangeProxyServerAddress() |
|
1034 |
{ |
|
1035 |
QFETCH(QString, string); |
|
1036 |
QFETCH(QString, result); |
|
1037 |
||
1038 |
HbAutoTest::mouseClick(mMainWindow, mProxyServerAddressWidget); |
|
1039 |
||
1040 |
// Erase old string |
|
1041 |
QString text = mTestViewAdvanced->mProxyServer->contentWidgetData("text").toString(); |
|
1042 |
subClearLineEdit(text.size()); |
|
1043 |
||
1044 |
// Enter new string |
|
1045 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
1046 |
||
1047 |
HbAutoTest::mouseClick(mMainWindow, mProxyServerAddressWidget, exitEditorOffset); |
|
1048 |
||
1049 |
// Verify both commsdat and UI widget |
|
1050 |
subVerifyString( |
|
1051 |
CMManagerShim::CmProxyServerName, |
|
1052 |
mTestViewAdvanced->mProxyServer, |
|
1053 |
result); |
|
1054 |
// Verify user defined address flag is set correctly |
|
1055 |
if (result.isEmpty()) { |
|
1056 |
subVerifyBool( |
|
1057 |
CMManagerShim::CmProxyUsageEnabled, |
|
1058 |
false); |
|
1059 |
} else { |
|
1060 |
subVerifyBool( |
|
1061 |
CMManagerShim::CmProxyUsageEnabled, |
|
1062 |
true); |
|
1063 |
} |
|
1064 |
} |
|
1065 |
||
1066 |
/** |
|
1067 |
* Test data for proxy server address change test case. |
|
1068 |
*/ |
|
1069 |
void TestCpPacketDataApPlugin::tcChangeProxyServerAddress_data() |
|
1070 |
{ |
|
1071 |
QTest::addColumn<QString>("string"); |
|
1072 |
QTest::addColumn<QString>("result"); |
|
1073 |
||
1074 |
QTest::newRow("long") |
|
1075 |
<< "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html" |
|
1076 |
<< "http://developer.symbian.org/main/documentation/reference/s^3/doc_source/AboutSymbianOSLibrary9.6/index.html"; |
|
1077 |
QTest::newRow("empty") |
|
1078 |
<< "" |
|
1079 |
<< ""; |
|
1080 |
QTest::newRow("basic") // last one should always fit on one line in UI |
|
1081 |
<< "http://www.symbian.org/" |
|
1082 |
<< "http://www.symbian.org/"; |
|
1083 |
} |
|
1084 |
||
1085 |
/** |
|
1086 |
* Tests changing of proxy port number. |
|
1087 |
*/ |
|
1088 |
void TestCpPacketDataApPlugin::tcChangeProxyPortNumber() |
|
1089 |
{ |
|
1090 |
QFETCH(QString, string); |
|
1091 |
QFETCH(QString, result); |
|
1092 |
||
1093 |
HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget); |
|
1094 |
||
1095 |
// Erase old string |
|
1096 |
QString text = mTestViewAdvanced->mProxyPort->contentWidgetData("text").toString(); |
|
1097 |
subClearLineEdit(text.size()); |
|
1098 |
||
1099 |
// Enter new string |
|
1100 |
HbAutoTest::keyClicks(mMainWindow, string, 0, waitTime); |
|
1101 |
||
1102 |
HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget, exitEditorOffset); |
|
1103 |
||
1104 |
// Verify both commsdat and UI widget |
|
1105 |
subVerifyUint( |
|
1106 |
CMManagerShim::CmProxyPortNumber, |
|
1107 |
result.toInt()); |
|
1108 |
QCOMPARE( |
|
1109 |
mTestViewAdvanced->mProxyPort->contentWidgetData("text").toInt(), |
|
1110 |
result.toInt()); |
|
1111 |
} |
|
1112 |
||
1113 |
/** |
|
1114 |
* Test data for proxy port number change test case. |
|
1115 |
*/ |
|
1116 |
void TestCpPacketDataApPlugin::tcChangeProxyPortNumber_data() |
|
1117 |
{ |
|
1118 |
QTest::addColumn<QString>("string"); |
|
1119 |
QTest::addColumn<QString>("result"); |
|
1120 |
||
1121 |
QTest::newRow("basic") |
|
1122 |
<< "8080" |
|
1123 |
<< "8080"; |
|
1124 |
QTest::newRow("too long") |
|
1125 |
<< "1234567890" |
|
1126 |
<< "12345"; |
|
1127 |
QTest::newRow("zero") |
|
1128 |
<< "0" |
|
1129 |
<< ""; |
|
1130 |
QTest::newRow("empty") |
|
1131 |
<< "" |
|
1132 |
<< ""; |
|
1133 |
} |
|
1134 |
||
1135 |
/** |
|
1136 |
* Tests invalid proxy port number. |
|
1137 |
*/ |
|
1138 |
void TestCpPacketDataApPlugin::tcInvalidProxyPortNumber() |
|
1139 |
{ |
|
1140 |
int previous = |
|
1141 |
mTestViewAdvanced->mProxyPort->contentWidgetData("text").toInt(); |
|
1142 |
||
1143 |
HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget); |
|
1144 |
||
1145 |
// Erase old string |
|
1146 |
QString text = mTestViewAdvanced->mProxyPort->contentWidgetData("text").toString(); |
|
1147 |
subClearLineEdit(text.size()); |
|
1148 |
||
1149 |
// Enter new string |
|
1150 |
HbAutoTest::keyClicks(mMainWindow, "65536", 0, waitTime); |
|
1151 |
||
1152 |
HbAutoTest::mouseClick(mMainWindow, mProxyPortNumberWidget, exitEditorOffset); |
|
1153 |
||
1154 |
QTest::qWait(100); |
|
1155 |
// Dismiss messagebox |
|
1156 |
HbAutoTest::mouseClick( |
|
1157 |
mMainWindow, |
|
1158 |
mTestViewAdvanced->mMessageBox.data(), |
|
1159 |
messageBoxOkButtonOffset); |
|
1160 |
||
1161 |
// Verify both commsdat and UI widget |
|
1162 |
subVerifyUint( |
|
1163 |
CMManagerShim::CmProxyPortNumber, |
|
1164 |
previous); |
|
1165 |
QCOMPARE( |
|
1166 |
mTestViewAdvanced->mProxyPort->contentWidgetData("text").toInt(), |
|
1167 |
previous); |
|
1168 |
} |
|
1169 |
||
1170 |
/** |
|
1171 |
* Collapses the proxy settings group. |
|
1172 |
*/ |
|
1173 |
void TestCpPacketDataApPlugin::tcCollapseProxySettings() |
|
1174 |
{ |
|
1175 |
HbAutoTest::mouseClick(mMainWindow, mTestViewAdvanced, proxyGroup); |
|
1176 |
} |
|
1177 |
||
1178 |
/** |
|
1179 |
* Returns from advanced settings view. |
|
1180 |
*/ |
|
1181 |
void TestCpPacketDataApPlugin::tcCloseAdvancedSettingsView() |
|
1182 |
{ |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1183 |
// Return from advanced settings view |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1184 |
subClickWidget("HbNavigationButton"); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1185 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1186 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1187 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1188 |
// SUB TEST CASES |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1189 |
// ----------------------------------------------------------------------------- |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1190 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1191 |
/** |
32 | 1192 |
* Gets UI widget pointers. |
1193 |
*/ |
|
1194 |
void TestCpPacketDataApPlugin::subGetUiWidgets() |
|
1195 |
{ |
|
1196 |
HbModelIterator iterator(mTestView->mModel); |
|
1197 |
||
1198 |
// Get "Access point settings" group item |
|
1199 |
QModelIndex apGroupIndex = iterator.index(0); |
|
1200 |
||
1201 |
// Get UI widgets |
|
1202 |
mConnectionNameWidget = subGetWidgetByIndex( |
|
1203 |
mTestView->mForm, |
|
1204 |
iterator.index(0, apGroupIndex)); |
|
1205 |
mAccessPointNameWidget = subGetWidgetByIndex( |
|
1206 |
mTestView->mForm, |
|
1207 |
iterator.index(1, apGroupIndex)); |
|
1208 |
mUserNameWidget = subGetWidgetByIndex( |
|
1209 |
mTestView->mForm, |
|
1210 |
iterator.index(2, apGroupIndex)); |
|
1211 |
mPasswordPromptWidget = subGetWidgetByIndex( |
|
1212 |
mTestView->mForm, |
|
1213 |
iterator.index(3, apGroupIndex)); |
|
1214 |
mPasswordWidget = subGetWidgetByIndex( |
|
1215 |
mTestView->mForm, |
|
1216 |
iterator.index(4, apGroupIndex)); |
|
1217 |
mAuthenticationWidget = subGetWidgetByIndex( |
|
1218 |
mTestView->mForm, |
|
1219 |
iterator.index(5, apGroupIndex)); |
|
1220 |
mHomepageWidget = subGetWidgetByIndex( |
|
1221 |
mTestView->mForm, |
|
1222 |
iterator.index(6, apGroupIndex)); |
|
1223 |
} |
|
1224 |
||
1225 |
/** |
|
1226 |
* Gets advanced settings view UI widget pointers by group index. |
|
1227 |
*/ |
|
1228 |
void TestCpPacketDataApPlugin::subGetAdvancedUiWidgets( |
|
1229 |
uint index) |
|
1230 |
{ |
|
1231 |
// Get the group item |
|
1232 |
HbModelIterator iterator(mTestViewAdvanced->mModel); |
|
1233 |
QModelIndex groupIndex = iterator.index(index); |
|
1234 |
||
1235 |
// Get UI widgets |
|
1236 |
if (index == 0) { |
|
1237 |
// IP settings group |
|
1238 |
mNetworkTypeWidget = subGetWidgetByIndex( |
|
1239 |
mTestViewAdvanced->mForm, |
|
1240 |
iterator.index(0, groupIndex)); |
|
1241 |
if (qobject_cast<HbComboBox *>(mNetworkTypeWidget)->currentIndex() == 0) { |
|
1242 |
// IPv4 |
|
1243 |
mIpv4AddressAutomaticWidget = subGetWidgetByIndex( |
|
1244 |
mTestViewAdvanced->mForm, |
|
1245 |
iterator.index(1, groupIndex)); |
|
1246 |
mIpv4AddressWidget = subGetWidgetByIndex( |
|
1247 |
mTestViewAdvanced->mForm, |
|
1248 |
iterator.index(2, groupIndex)); |
|
1249 |
mIpv4DnsAddressAutomaticWidget = subGetWidgetByIndex( |
|
1250 |
mTestViewAdvanced->mForm, |
|
1251 |
iterator.index(3, groupIndex)); |
|
1252 |
mIpv4PrimaryDnsAddressWidget = subGetWidgetByIndex( |
|
1253 |
mTestViewAdvanced->mForm, |
|
1254 |
iterator.index(4, groupIndex)); |
|
1255 |
mIpv4SecondaryDnsAddressWidget = subGetWidgetByIndex( |
|
1256 |
mTestViewAdvanced->mForm, |
|
1257 |
iterator.index(5, groupIndex)); |
|
1258 |
} else { |
|
1259 |
// IPv6 |
|
1260 |
mIpv6DnsAddressAutomaticWidget = subGetWidgetByIndex( |
|
1261 |
mTestViewAdvanced->mForm, |
|
1262 |
iterator.index(1, groupIndex)); |
|
1263 |
mIpv6PrimaryDnsAddressWidget = subGetWidgetByIndex( |
|
1264 |
mTestViewAdvanced->mForm, |
|
1265 |
iterator.index(2, groupIndex)); |
|
1266 |
mIpv6SecondaryDnsAddressWidget = subGetWidgetByIndex( |
|
1267 |
mTestViewAdvanced->mForm, |
|
1268 |
iterator.index(3, groupIndex)); |
|
1269 |
} |
|
1270 |
} else { |
|
1271 |
// Proxy settings group |
|
1272 |
mProxyServerAddressWidget = subGetWidgetByIndex( |
|
1273 |
mTestViewAdvanced->mForm, |
|
1274 |
iterator.index(0, groupIndex)); |
|
1275 |
mProxyPortNumberWidget = subGetWidgetByIndex( |
|
1276 |
mTestViewAdvanced->mForm, |
|
1277 |
iterator.index(1, groupIndex)); |
|
1278 |
} |
|
1279 |
} |
|
1280 |
||
1281 |
/** |
|
1282 |
* Gets an UI widget from HbDataForm by index. |
|
1283 |
*/ |
|
1284 |
HbWidget *TestCpPacketDataApPlugin::subGetWidgetByIndex( |
|
1285 |
HbDataForm *form, |
|
1286 |
const QModelIndex &index) |
|
1287 |
{ |
|
1288 |
HbDataFormViewItem *viewItem = qobject_cast<HbDataFormViewItem *> |
|
1289 |
(form->itemByIndex(index)); |
|
1290 |
HbWidget *widget = viewItem->dataItemContentWidget(); |
|
1291 |
//QString widgetClassName(widget->metaObject()->className()); |
|
1292 |
//qDebug() << widgetClassName; |
|
1293 |
return widget; |
|
1294 |
} |
|
1295 |
||
1296 |
/** |
|
1297 |
* Writes initial settings to CommsDat needed by some test cases. |
|
1298 |
*/ |
|
1299 |
void TestCpPacketDataApPlugin::subInitializeCommsDat() |
|
1300 |
{ |
|
1301 |
QScopedPointer<CmManagerShim> cmManager(new CmManagerShim); |
|
1302 |
QScopedPointer<CmConnectionMethodShim> connectionMethod( |
|
1303 |
cmManager->connectionMethod(testApId)); |
|
1304 |
||
1305 |
// Initial settings |
|
1306 |
connectionMethod->setStringAttribute( |
|
1307 |
CMManagerShim::PacketDataIFAuthName, |
|
1308 |
tooLongUserName); |
|
1309 |
||
1310 |
connectionMethod->update(); |
|
1311 |
} |
|
1312 |
||
1313 |
/** |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1314 |
* Creates the settings view and shows it. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1315 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1316 |
void TestCpPacketDataApPlugin::subCreateSettingsView(uint connectionMethodId) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1317 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1318 |
// Create settings view |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1319 |
HbView *view = mPlugin->createSettingView(connectionMethodId); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1320 |
QVERIFY(view != NULL); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1321 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1322 |
// Display the view |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1323 |
mMainWindow->addView(view); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1324 |
mMainWindow->setCurrentView(view); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1325 |
// Store pointer to settings view class |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1326 |
mTestView = static_cast<CpPacketDataApView *>(view); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1327 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1328 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1329 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1330 |
* Verifies that given string is correctly stored in CommsDat and shown on UI. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1331 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1332 |
void TestCpPacketDataApPlugin::subVerifyString( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1333 |
CMManagerShim::ConnectionMethodAttribute attribute, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1334 |
HbDataFormModelItem *item, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1335 |
QString expected) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1336 |
{ |
32 | 1337 |
QTest::qWait(waitTime); |
1338 |
||
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1339 |
// Read attribute value from CommsDat |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1340 |
QScopedPointer<CmManagerShim> cmManager(new CmManagerShim); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1341 |
QScopedPointer<CmConnectionMethodShim> connectionMethod( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1342 |
cmManager->connectionMethod(testApId)); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1343 |
QString commsdat = connectionMethod->getStringAttribute(attribute); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1344 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1345 |
QCOMPARE(commsdat, expected); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1346 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1347 |
// Get value from UI widget |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1348 |
QString widget = item->contentWidgetData("text").toString(); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1349 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1350 |
QCOMPARE(widget, expected); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1351 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1352 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1353 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1354 |
* Clears a HbLineEdit. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1355 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1356 |
void TestCpPacketDataApPlugin::subClearLineEdit( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1357 |
uint length) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1358 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1359 |
// Move cursor to end of string |
32 | 1360 |
//HbAutoTest::keyClick(mMainWindow, Qt::Key_End, Qt::ControlModifier, waitTime); // doesn't seem to do anything? |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1361 |
HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1362 |
HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1363 |
HbAutoTest::keyClick(mMainWindow, Qt::Key_Down, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1364 |
for (int i=0; i<25; i++) { |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1365 |
HbAutoTest::keyClick(mMainWindow, Qt::Key_Right, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1366 |
} |
32 | 1367 |
// Erase string |
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1368 |
for (int i=0; i<length; i++) { |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1369 |
HbAutoTest::keyClick(mMainWindow, Qt::Key_Backspace, 0, waitTime); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1370 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1371 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1372 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1373 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1374 |
* Gets value of a boolean attribute from CommsDat. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1375 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1376 |
bool TestCpPacketDataApPlugin::subGetBool( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1377 |
CMManagerShim::ConnectionMethodAttribute attribute) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1378 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1379 |
QScopedPointer<CmManagerShim> cmManager(new CmManagerShim); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1380 |
QScopedPointer<CmConnectionMethodShim> connectionMethod( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1381 |
cmManager->connectionMethod(testApId)); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1382 |
return connectionMethod->getBoolAttribute(attribute); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1383 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1384 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1385 |
/** |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1386 |
* Verifies that given attribute contains expected boolean value in CommsDat. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1387 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1388 |
void TestCpPacketDataApPlugin::subVerifyBool( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1389 |
CMManagerShim::ConnectionMethodAttribute attribute, |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1390 |
bool expected) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1391 |
{ |
32 | 1392 |
QTest::qWait(waitTime); |
1393 |
||
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1394 |
// Read attribute value from CommsDat |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1395 |
QScopedPointer<CmManagerShim> cmManager(new CmManagerShim); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1396 |
QScopedPointer<CmConnectionMethodShim> connectionMethod( |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1397 |
cmManager->connectionMethod(testApId)); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1398 |
bool commsdat = connectionMethod->getBoolAttribute(attribute); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1399 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1400 |
QCOMPARE(commsdat, expected); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1401 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1402 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1403 |
/** |
32 | 1404 |
* Verifies that given attribute contains expected integer value in CommsDat. |
1405 |
*/ |
|
1406 |
void TestCpPacketDataApPlugin::subVerifyUint( |
|
1407 |
CMManagerShim::ConnectionMethodAttribute attribute, |
|
1408 |
uint expected) |
|
1409 |
{ |
|
1410 |
QTest::qWait(waitTime); |
|
1411 |
||
1412 |
// Read attribute value from CommsDat |
|
1413 |
QScopedPointer<CmManagerShim> cmManager(new CmManagerShim); |
|
1414 |
QScopedPointer<CmConnectionMethodShim> connectionMethod( |
|
1415 |
cmManager->connectionMethod(testApId)); |
|
1416 |
uint commsdat = connectionMethod->getIntAttribute(attribute); |
|
1417 |
||
1418 |
QCOMPARE(commsdat, expected); |
|
1419 |
} |
|
1420 |
||
1421 |
/** |
|
20
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1422 |
* Clicks a widget currently on UI by class name. |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1423 |
*/ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1424 |
void TestCpPacketDataApPlugin::subClickWidget(const QString &name) |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1425 |
{ |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1426 |
QList<QGraphicsItem *> itemList = mMainWindow->scene()->items(); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1427 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1428 |
QGraphicsItem *target = 0; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1429 |
foreach (QGraphicsItem* item, itemList) { |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1430 |
if (item->isWidget()) { |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1431 |
QString widgetClassName(static_cast<QGraphicsWidget*>(item)->metaObject()->className()); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1432 |
//qDebug() << widgetClassName; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1433 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1434 |
if (widgetClassName == name) { |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1435 |
target = item; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1436 |
break; |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1437 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1438 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1439 |
} |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1440 |
|
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1441 |
Q_ASSERT(target); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1442 |
HbAutoTest::mouseClick(mMainWindow, static_cast<HbWidget *>(target)); |
9c97ad6591ae
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1443 |
} |
32 | 1444 |
|
1445 |
/** |
|
1446 |
* Scrolls the tested view to the bottom. |
|
1447 |
*/ |
|
1448 |
void TestCpPacketDataApPlugin::subScrollToBottom() |
|
1449 |
{ |
|
1450 |
// Scroll to the bottom of the view |
|
1451 |
HbAutoTest::mousePress(mMainWindow, mTestView, scrollMiddle); |
|
1452 |
QTest::qWait(1000); |
|
1453 |
HbAutoTest::mouseMove(mMainWindow, mTestView, scrollTop); |
|
1454 |
HbAutoTest::mouseRelease(mMainWindow, mTestView, scrollTop); |
|
1455 |
} |
|
1456 |
||
1457 |
/** |
|
1458 |
* Scrolls the tested view to the top. |
|
1459 |
*/ |
|
1460 |
void TestCpPacketDataApPlugin::subScrollToTop() |
|
1461 |
{ |
|
1462 |
// Scroll to the top of the view |
|
1463 |
HbAutoTest::mousePress(mMainWindow, mTestView, scrollMiddle); |
|
1464 |
QTest::qWait(1000); |
|
1465 |
HbAutoTest::mouseMove(mMainWindow, mTestView, scrollBottom); |
|
1466 |
HbAutoTest::mouseRelease(mMainWindow, mTestView, scrollBottom); |
|
1467 |
} |