|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Control Panel WLAN AP plugin unit testing. |
|
16 */ |
|
17 |
|
18 #include <QStringList> |
|
19 #include <QtTest/QtTest> |
|
20 #include <cmmanagerdefines_shim.h> |
|
21 |
|
22 class HbWidget; |
|
23 class HbDialog; |
|
24 class HbMainWindow; |
|
25 class HbAutoTestMainWindow; |
|
26 class HbDataForm; |
|
27 class HbDataFormModelItem; |
|
28 class HbDataFormViewItem; |
|
29 class HbAction; |
|
30 class CpPacketDataApView; |
|
31 class CpPacketDataApAdvancedView; |
|
32 class CpBearerApPluginInterface; |
|
33 |
|
34 class TestCpPacketDataApPlugin : public QObject |
|
35 { |
|
36 Q_OBJECT |
|
37 |
|
38 signals: |
|
39 // Test signals |
|
40 void menuActionTriggered(HbAction *); |
|
41 |
|
42 public slots: |
|
43 // Test framework functions |
|
44 void initTestCase(); |
|
45 void cleanupTestCase(); |
|
46 void init(); |
|
47 void cleanup(); |
|
48 |
|
49 private slots: |
|
50 // Test cases |
|
51 void tcChangeConnectionName(); |
|
52 void tcChangeConnectionName_data(); |
|
53 void tcConnectionNameEmpty(); |
|
54 void tcChangeAccessPointName(); |
|
55 void tcChangeAccessPointName_data(); |
|
56 void tcAccessPointNameEmpty(); |
|
57 void tcTooLongUserNameInCommsDat(); |
|
58 void tcChangeUserName(); |
|
59 void tcChangeUserName_data(); |
|
60 void tcScrollToBottom(); |
|
61 void tcChangePassword(); |
|
62 void tcChangePassword_data(); |
|
63 void tcChangeAuthenticationMode(); |
|
64 void tcChangeHomepage(); |
|
65 void tcChangeHomepage_data(); |
|
66 void tcOpenAdvancedSettingsView(); |
|
67 void tcExpandIpSettings(); |
|
68 void tcSetIpv4NetworkType(); |
|
69 void tcEnableAutomaticIpv4Address(); |
|
70 void tcEnableUserDefinedIpv4Address(); |
|
71 void tcChangeIpAddress(); |
|
72 void tcChangeIpAddress_data(); |
|
73 void tcScrollToBottom2(); |
|
74 void tcEnableAutomaticIpv4DnsAddress(); |
|
75 void tcEnableUserDefinedIpv4DnsAddress(); |
|
76 void tcChangeIpv4DnsAddress(); |
|
77 void tcChangeIpv4DnsAddress_data(); |
|
78 void tcInvalidIpv4DnsAddress(); |
|
79 void tcScrollToTop(); |
|
80 void tcSetIpv6NetworkType(); |
|
81 void tcEnableAutomaticIpv6DnsAddress(); |
|
82 void tcEnableWellKnownIpv6DnsAddress(); |
|
83 void tcEnableUserDefinedIpv6DnsAddress(); |
|
84 void tcChangeIpv6DnsAddress(); |
|
85 void tcChangeIpv6DnsAddress_data(); |
|
86 void tcInvalidIpv6DnsAddress(); |
|
87 void tcCollapseIpSettings(); |
|
88 void tcExpandProxySettingsAndGetUiWidgets(); |
|
89 void tcChangeProxyServerAddress(); |
|
90 void tcChangeProxyServerAddress_data(); |
|
91 void tcChangeProxyPortNumber(); |
|
92 void tcChangeProxyPortNumber_data(); |
|
93 void tcInvalidProxyPortNumber(); |
|
94 void tcCollapseProxySettings(); |
|
95 void tcCloseAdvancedSettingsView(); |
|
96 |
|
97 private: |
|
98 // Sub test cases |
|
99 void subGetUiWidgets(); |
|
100 void subGetAdvancedUiWidgets(uint index); |
|
101 HbWidget *subGetWidgetByIndex( |
|
102 HbDataForm *form, |
|
103 const QModelIndex &index); |
|
104 void subInitializeCommsDat(); |
|
105 void subCreateSettingsView(uint connetionMethodId); |
|
106 void subVerifyString( |
|
107 CMManagerShim::ConnectionMethodAttribute attribute, |
|
108 HbDataFormModelItem *item, |
|
109 QString expected); |
|
110 void subClearLineEdit(uint length); |
|
111 bool subGetBool(CMManagerShim::ConnectionMethodAttribute attribute); |
|
112 void subVerifyBool( |
|
113 CMManagerShim::ConnectionMethodAttribute attribute, |
|
114 bool expected); |
|
115 void subVerifyUint( |
|
116 CMManagerShim::ConnectionMethodAttribute attribute, |
|
117 uint expected); |
|
118 void subClickWidget(const QString &name); |
|
119 void subScrollToBottom(); |
|
120 void subScrollToTop(); |
|
121 |
|
122 private: |
|
123 // Code references |
|
124 CpPacketDataApView *mTestView; |
|
125 CpPacketDataApAdvancedView *mTestViewAdvanced; |
|
126 // "Access point settings" UI widgets |
|
127 HbWidget *mConnectionNameWidget; |
|
128 HbWidget *mAccessPointNameWidget; |
|
129 HbWidget *mUserNameWidget; |
|
130 HbWidget *mPasswordWidget; |
|
131 HbWidget *mAuthenticationWidget; |
|
132 HbWidget *mHomepageWidget; |
|
133 // "Advanced settings" UI widgets |
|
134 HbDataFormViewItem *mIpGroupViewItem; |
|
135 HbDataFormViewItem *mProxyGroupViewItem; |
|
136 HbWidget *mNetworkTypeWidget; |
|
137 HbWidget *mIpv4AddressAutomaticWidget; |
|
138 HbWidget *mIpv4AddressWidget; |
|
139 HbWidget *mIpv4DnsAddressAutomaticWidget; |
|
140 HbWidget *mIpv4PrimaryDnsAddressWidget; |
|
141 HbWidget *mIpv4SecondaryDnsAddressWidget; |
|
142 HbWidget *mIpv6DnsAddressAutomaticWidget; |
|
143 HbWidget *mIpv6PrimaryDnsAddressWidget; |
|
144 HbWidget *mIpv6SecondaryDnsAddressWidget; |
|
145 HbWidget *mProxyServerAddressWidget; |
|
146 HbWidget *mProxyPortNumberWidget; |
|
147 |
|
148 // Test data |
|
149 HbAutoTestMainWindow *mMainWindow; |
|
150 QPluginLoader *mPluginLoader; |
|
151 CpBearerApPluginInterface *mPlugin; |
|
152 }; |