39
|
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 |
*/
|
|
16 |
|
|
17 |
// System includes
|
|
18 |
#include <QTest>
|
|
19 |
#include <QDebug>
|
|
20 |
#include <QList>
|
|
21 |
#include <cmmanagerdefines_shim.h>
|
|
22 |
#include <wlanerrorcodes.h>
|
|
23 |
|
|
24 |
// User includes
|
|
25 |
#include "testwlanwizardwps.h"
|
|
26 |
#include "testwlanwizardwps_conf.h"
|
|
27 |
#include "wlanwizard.h"
|
|
28 |
#include "wlanwizard_p.h"
|
|
29 |
#include "wlanqtutils_context.h"
|
|
30 |
#include "wlanqtutils.h"
|
|
31 |
#include "wlanqtutilsap.h"
|
|
32 |
#include "wlanwizardpageinternal.h"
|
|
33 |
#include "wpswizardpage.h"
|
|
34 |
|
|
35 |
#include "wlanmgmtclient_context.h"
|
|
36 |
|
|
37 |
// External function prototypes
|
|
38 |
|
|
39 |
// Local constants
|
|
40 |
|
|
41 |
|
|
42 |
// ======== LOCAL FUNCTIONS ========
|
|
43 |
|
|
44 |
// ======== MEMBER FUNCTIONS ========
|
|
45 |
|
|
46 |
|
|
47 |
// ---------------------------------------------------------
|
|
48 |
// TEST CASES
|
|
49 |
// ---------------------------------------------------------
|
|
50 |
|
|
51 |
void TestWlanWizardWps::tcConfigureManualOpen()
|
|
52 |
{
|
|
53 |
#ifdef tcConfigureManualOpen_enabled
|
|
54 |
const QString ssid("tcConfigureManualOpen");
|
|
55 |
mWlanQtUtilsContext->setCreateWlanIapResult(3);
|
|
56 |
mWlanQtUtilsContext->setConnectionSuccessed(true);
|
|
57 |
mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
|
|
58 |
mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
|
|
59 |
|
|
60 |
WlanQtUtilsAp ap;
|
|
61 |
ap.setValue(WlanQtUtilsAp::ConfIdConnectionMode, CMManagerShim::Infra);
|
|
62 |
ap.setValue(WlanQtUtilsAp::ConfIdSecurityMode, CMManagerShim::WlanSecModeOpen);
|
|
63 |
ap.setValue(WlanQtUtilsAp::ConfIdSsid, ssid);
|
|
64 |
ap.setValue(WlanQtUtilsAp::ConfIdHidden, false);
|
|
65 |
|
|
66 |
// Default values
|
|
67 |
ap.setValue(WlanQtUtilsAp::ConfIdWpaPsk, QString());
|
|
68 |
ap.setValue(WlanQtUtilsAp::ConfIdWpaPskUse, true );
|
|
69 |
ap.setValue(WlanQtUtilsAp::ConfIdWepDefaultIndex, CMManagerShim::WepKeyIndex1 );
|
|
70 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey1, QString());
|
|
71 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey2, QString());
|
|
72 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey3, QString());
|
|
73 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey4, QString());
|
|
74 |
|
|
75 |
mView->mWizard->setParameters(
|
|
76 |
ssid,
|
|
77 |
CMManagerShim::Infra,
|
|
78 |
CMManagerShim::WlanSecModeOpen,
|
|
79 |
false, false, true);
|
|
80 |
|
|
81 |
mView->showWizard();
|
|
82 |
verifyModeSelection();
|
|
83 |
QCOMPARE(selectRadioButton("radioButtonList", 2), true);
|
|
84 |
QTest::qWait(WaitTimeForUi);
|
|
85 |
QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
|
|
86 |
QCOMPARE(mouseClickNext(), true);
|
|
87 |
QTest::qWait(WaitTimeForUi);
|
|
88 |
|
|
89 |
QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, ssid), true );
|
|
90 |
QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
|
|
91 |
QCOMPARE( mWlanQtUtilsContext->verifyWlanIapSettings(ap), true);
|
|
92 |
#endif
|
|
93 |
}
|
|
94 |
|
|
95 |
void TestWlanWizardWps::tcPushButtonOpen()
|
|
96 |
{
|
|
97 |
#ifdef tcPushButtonOpen_enabled
|
|
98 |
tcPushButton(
|
|
99 |
"tcPushButtonOpen",
|
|
100 |
EWlanIapSecurityModeAllowUnsecure,
|
|
101 |
CMManagerShim::WlanSecModeOpen,
|
|
102 |
EWlanOperatingModeInfrastructure,
|
|
103 |
CMManagerShim::Infra,
|
|
104 |
EWlanDefaultWepKey1,
|
|
105 |
CMManagerShim::WepKeyIndex1);
|
|
106 |
#endif
|
|
107 |
}
|
|
108 |
|
|
109 |
void TestWlanWizardWps::tcPushButtonWep1()
|
|
110 |
{
|
|
111 |
#ifdef tcPushButtonWep1_enabled
|
|
112 |
tcPushButton(
|
|
113 |
"tcPushButtonWep1",
|
|
114 |
EWlanIapSecurityModeWep,
|
|
115 |
CMManagerShim::WlanSecModeWep,
|
|
116 |
EWlanOperatingModeAdhoc,
|
|
117 |
CMManagerShim::Adhoc,
|
|
118 |
EWlanDefaultWepKey1,
|
|
119 |
CMManagerShim::WepKeyIndex1);
|
|
120 |
#endif
|
|
121 |
}
|
|
122 |
|
|
123 |
void TestWlanWizardWps::tcPushButtonWep2()
|
|
124 |
{
|
|
125 |
#ifdef tcPushButtonWep2_enabled
|
|
126 |
tcPushButton(
|
|
127 |
"tcPushButtonWep2",
|
|
128 |
EWlanIapSecurityModeWep,
|
|
129 |
CMManagerShim::WlanSecModeWep,
|
|
130 |
EWlanOperatingModeAdhoc,
|
|
131 |
CMManagerShim::Adhoc,
|
|
132 |
EWlanDefaultWepKey2,
|
|
133 |
CMManagerShim::WepKeyIndex2);
|
|
134 |
#endif
|
|
135 |
}
|
|
136 |
|
|
137 |
void TestWlanWizardWps::tcPushButtonWep3()
|
|
138 |
{
|
|
139 |
#ifdef tcPushButtonWep3_enabled
|
|
140 |
tcPushButton(
|
|
141 |
"tcPushButtonWep3",
|
|
142 |
EWlanIapSecurityModeWep,
|
|
143 |
CMManagerShim::WlanSecModeWep,
|
|
144 |
EWlanOperatingModeAdhoc,
|
|
145 |
CMManagerShim::Adhoc,
|
|
146 |
EWlanDefaultWepKey3,
|
|
147 |
CMManagerShim::WepKeyIndex3);
|
|
148 |
#endif
|
|
149 |
}
|
|
150 |
|
|
151 |
void TestWlanWizardWps::tcPushButtonWep4()
|
|
152 |
{
|
|
153 |
#ifdef tcPushButtonWep4_enabled
|
|
154 |
tcPushButton(
|
|
155 |
"tcPushButtonWep4",
|
|
156 |
EWlanIapSecurityModeWep,
|
|
157 |
CMManagerShim::WlanSecModeWep,
|
|
158 |
EWlanOperatingModeAdhoc,
|
|
159 |
CMManagerShim::Adhoc,
|
|
160 |
EWlanDefaultWepKey4,
|
|
161 |
CMManagerShim::WepKeyIndex4);
|
|
162 |
#endif
|
|
163 |
}
|
|
164 |
|
|
165 |
void TestWlanWizardWps::tcPushButtonWpa()
|
|
166 |
{
|
|
167 |
#ifdef tcPushButtonWpa_enabled
|
|
168 |
tcPushButton(
|
|
169 |
"tcPushButtonWpa",
|
|
170 |
EWlanIapSecurityModeWpa,
|
|
171 |
CMManagerShim::WlanSecModeWpa,
|
|
172 |
EWlanOperatingModeAdhoc,
|
|
173 |
CMManagerShim::Adhoc,
|
|
174 |
EWlanDefaultWepKey1,
|
|
175 |
CMManagerShim::WepKeyIndex1);
|
|
176 |
#endif
|
|
177 |
}
|
|
178 |
|
|
179 |
void TestWlanWizardWps::tcPushButtonWpa2()
|
|
180 |
{
|
|
181 |
#ifdef tcPushButtonWpa2_enabled
|
|
182 |
tcPushButton(
|
|
183 |
"tcPushButtonWpa2",
|
|
184 |
EWlanIapSecurityModeWpa2Only,
|
|
185 |
CMManagerShim::WlanSecModeWpa2,
|
|
186 |
EWlanOperatingModeAdhoc,
|
|
187 |
CMManagerShim::Adhoc,
|
|
188 |
EWlanDefaultWepKey1,
|
|
189 |
CMManagerShim::WepKeyIndex1);
|
|
190 |
#endif
|
|
191 |
}
|
|
192 |
|
|
193 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupOOBInterfaceReadError()
|
|
194 |
{
|
|
195 |
#ifdef tcPinCode_KErrWlanProtectedSetupOOBInterfaceReadError_enabled
|
|
196 |
tcPinCode_failure(
|
|
197 |
KErrWlanProtectedSetupOOBInterfaceReadError,
|
|
198 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
199 |
#endif
|
|
200 |
}
|
|
201 |
|
|
202 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupDecryptionCRCFailure()
|
|
203 |
{
|
|
204 |
#ifdef tcPinCode_KErrWlanProtectedSetupDecryptionCRCFailure_enabled
|
|
205 |
tcPinCode_failure(
|
|
206 |
KErrWlanProtectedSetupDecryptionCRCFailure,
|
|
207 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
208 |
#endif
|
|
209 |
}
|
|
210 |
|
|
211 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetup2_4ChannelNotSupported()
|
|
212 |
{
|
|
213 |
#ifdef tcPinCode_KErrWlanProtectedSetup2_4ChannelNotSupported_enabled
|
|
214 |
tcPinCode_failure(
|
|
215 |
KErrWlanProtectedSetup2_4ChannelNotSupported,
|
|
216 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
217 |
#endif
|
|
218 |
}
|
|
219 |
|
|
220 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetup5_0ChannelNotSupported()
|
|
221 |
{
|
|
222 |
#ifdef tcPinCode_KErrWlanProtectedSetup5_0ChannelNotSupported_enabled
|
|
223 |
tcPinCode_failure(
|
|
224 |
KErrWlanProtectedSetup5_0ChannelNotSupported,
|
|
225 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
226 |
#endif
|
|
227 |
}
|
|
228 |
|
|
229 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupNetworkAuthFailure()
|
|
230 |
{
|
|
231 |
#ifdef tcPinCode_KErrWlanProtectedSetupNetworkAuthFailure_enabled
|
|
232 |
tcPinCode_failure(
|
|
233 |
KErrWlanProtectedSetupNetworkAuthFailure,
|
|
234 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
235 |
#endif
|
|
236 |
}
|
|
237 |
|
|
238 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupNoDHCPResponse()
|
|
239 |
{
|
|
240 |
#ifdef tcPinCode_KErrWlanProtectedSetupNoDHCPResponse_enabled
|
|
241 |
tcPinCode_failure(
|
|
242 |
KErrWlanProtectedSetupNoDHCPResponse,
|
|
243 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
244 |
#endif
|
|
245 |
}
|
|
246 |
|
|
247 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupFailedDHCPConfig()
|
|
248 |
{
|
|
249 |
#ifdef tcPinCode_KErrWlanProtectedSetupFailedDHCPConfig_enabled
|
|
250 |
tcPinCode_failure(
|
|
251 |
KErrWlanProtectedSetupFailedDHCPConfig,
|
|
252 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
253 |
#endif
|
|
254 |
}
|
|
255 |
|
|
256 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupIPAddressConflict()
|
|
257 |
{
|
|
258 |
#ifdef tcPinCode_KErrWlanProtectedSetupIPAddressConflict_enabled
|
|
259 |
tcPinCode_failure(
|
|
260 |
KErrWlanProtectedSetupIPAddressConflict,
|
|
261 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
262 |
#endif
|
|
263 |
}
|
|
264 |
|
|
265 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupCouldNotConnectToRegistrar()
|
|
266 |
{
|
|
267 |
#ifdef tcPinCode_KErrWlanProtectedSetupCouldNotConnectToRegistrar_enabled
|
|
268 |
tcPinCode_failure(
|
|
269 |
KErrWlanProtectedSetupCouldNotConnectToRegistrar,
|
|
270 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
271 |
#endif
|
|
272 |
}
|
|
273 |
|
|
274 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupMultiplePBCSessionsDetected()
|
|
275 |
{
|
|
276 |
#ifdef tcPinCode_KErrWlanProtectedSetupMultiplePBCSessionsDetected_enabled
|
|
277 |
tcPinCode_failure(
|
|
278 |
KErrWlanProtectedSetupMultiplePBCSessionsDetected,
|
|
279 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
280 |
#endif
|
|
281 |
}
|
|
282 |
|
|
283 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupRogueActivitySuspected()
|
|
284 |
{
|
|
285 |
#ifdef tcPinCode_KErrWlanProtectedSetupRogueActivitySuspected_enabled
|
|
286 |
tcPinCode_failure(
|
|
287 |
KErrWlanProtectedSetupRogueActivitySuspected,
|
|
288 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
289 |
#endif
|
|
290 |
}
|
|
291 |
|
|
292 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupDeviceBusy()
|
|
293 |
{
|
|
294 |
#ifdef tcPinCode_KErrWlanProtectedSetupDeviceBusy_enabled
|
|
295 |
tcPinCode_failure(
|
|
296 |
KErrWlanProtectedSetupDeviceBusy,
|
|
297 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
298 |
#endif
|
|
299 |
}
|
|
300 |
|
|
301 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupSetupLocked()
|
|
302 |
{
|
|
303 |
#ifdef tcPinCode_KErrWlanProtectedSetupSetupLocked_enabled
|
|
304 |
tcPinCode_failure(
|
|
305 |
KErrWlanProtectedSetupSetupLocked,
|
|
306 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
307 |
#endif
|
|
308 |
}
|
|
309 |
|
|
310 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupMessageTimeout()
|
|
311 |
{
|
|
312 |
#ifdef tcPinCode_KErrWlanProtectedSetupMessageTimeout_enabled
|
|
313 |
tcPinCode_failure(
|
|
314 |
KErrWlanProtectedSetupMessageTimeout,
|
|
315 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
316 |
#endif
|
|
317 |
}
|
|
318 |
|
|
319 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupRegistrationSessionTimeout()
|
|
320 |
{
|
|
321 |
#ifdef tcPinCode_KErrWlanProtectedSetupRegistrationSessionTimeout_enabled
|
|
322 |
tcPinCode_failure(
|
|
323 |
KErrWlanProtectedSetupRegistrationSessionTimeout,
|
|
324 |
hbTrId("txt_occ_dialog_configuration_failed_please_try_ag"));
|
|
325 |
#endif
|
|
326 |
}
|
|
327 |
|
|
328 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupDevicePasswordAuthFailure()
|
|
329 |
{
|
|
330 |
#ifdef tcPinCode_KErrWlanProtectedSetupDevicePasswordAuthFailure_enabled
|
|
331 |
tcPinCode_failure(
|
|
332 |
KErrWlanProtectedSetupDevicePasswordAuthFailure,
|
|
333 |
hbTrId("txt_occ_dialog_configuration_failed_authenticatio"));
|
|
334 |
#endif
|
|
335 |
}
|
|
336 |
|
|
337 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupPINMethodNotSupported()
|
|
338 |
{
|
|
339 |
#ifdef tcPinCode_KErrWlanProtectedSetupPINMethodNotSupported_enabled
|
|
340 |
tcPinCode_failure(
|
|
341 |
KErrWlanProtectedSetupPINMethodNotSupported,
|
|
342 |
hbTrId("txt_occ_dialog_configuration_failed_authenticatio"));
|
|
343 |
#endif
|
|
344 |
}
|
|
345 |
|
|
346 |
void TestWlanWizardWps::tcPinCode_KErrWlanProtectedSetupPBMethodNotSupported()
|
|
347 |
{
|
|
348 |
#ifdef tcPinCode_KErrWlanProtectedSetupPBMethodNotSupported_enabled
|
|
349 |
tcPinCode_failure(
|
|
350 |
KErrWlanProtectedSetupPBMethodNotSupported,
|
|
351 |
hbTrId("txt_occ_dialog_configuration_failed_authenticatio"));
|
|
352 |
#endif
|
|
353 |
}
|
|
354 |
|
|
355 |
void TestWlanWizardWps::verifyModeSelection()
|
|
356 |
{
|
|
357 |
QCOMPARE( verifyCurrentPage(WpsWizardPage::PageWpsWizardStep2 ), true );
|
|
358 |
QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
|
|
359 |
|
|
360 |
QStringList list;
|
|
361 |
list << hbTrId("txt_occ_list_use_pushbutton")
|
|
362 |
<< hbTrId("txt_occ_list_use_pin_code")
|
|
363 |
<< hbTrId("txt_occ_list_configure_manually");
|
|
364 |
|
|
365 |
QCOMPARE(verifyRadioButtons("radioButtonList"), list);
|
|
366 |
}
|
|
367 |
|
|
368 |
|
|
369 |
void TestWlanWizardWps::tcPushButton(
|
|
370 |
const QString &ssid,
|
|
371 |
int secModeWlan,
|
|
372 |
int secModeCmm,
|
|
373 |
int operModeWlan,
|
|
374 |
int operModeCmm,
|
|
375 |
int defaultWepKeyIndexWlan,
|
|
376 |
int defaultWepKeyIndexCmm)
|
|
377 |
{
|
|
378 |
mWlanQtUtilsContext->setCreateWlanIapResult(3);
|
|
379 |
mWlanQtUtilsContext->setConnectionSuccessed(true);
|
|
380 |
mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
|
|
381 |
mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
|
|
382 |
|
|
383 |
WlanQtUtilsAp ap;
|
|
384 |
ap.setValue(WlanQtUtilsAp::ConfIdConnectionMode, operModeCmm);
|
|
385 |
ap.setValue(WlanQtUtilsAp::ConfIdSecurityMode, secModeCmm);
|
|
386 |
ap.setValue(WlanQtUtilsAp::ConfIdSsid, ssid);
|
|
387 |
ap.setValue(WlanQtUtilsAp::ConfIdHidden, false);
|
|
388 |
|
|
389 |
// Default values
|
|
390 |
ap.setValue(WlanQtUtilsAp::ConfIdWpaPsk, QString());
|
|
391 |
ap.setValue(WlanQtUtilsAp::ConfIdWpaPskUse, true );
|
|
392 |
ap.setValue(WlanQtUtilsAp::ConfIdWepDefaultIndex, CMManagerShim::WepKeyIndex1 );
|
|
393 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey1, QString());
|
|
394 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey2, QString());
|
|
395 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey3, QString());
|
|
396 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey4, QString());
|
|
397 |
|
|
398 |
if (secModeCmm == CMManagerShim::WlanSecModeWep){
|
|
399 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey1, "wepkey1");
|
|
400 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey2, "wepkey2");
|
|
401 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey3, "wepkey3");
|
|
402 |
ap.setValue(WlanQtUtilsAp::ConfIdWepKey4, "wepkey4");
|
|
403 |
ap.setValue(WlanQtUtilsAp::ConfIdWepDefaultIndex, defaultWepKeyIndexCmm );
|
|
404 |
} else if (secModeCmm == CMManagerShim::WlanSecModeWpa ||
|
|
405 |
secModeCmm == CMManagerShim::WlanSecModeWpa2) {
|
|
406 |
ap.setValue(WlanQtUtilsAp::ConfIdWpaPsk, "wpapsk");
|
|
407 |
}
|
|
408 |
|
|
409 |
mWlanMgmtClientContext->setRunProtectedSetup(ssid, KErrNone);
|
|
410 |
mWlanMgmtClientContext->appendResult(
|
|
411 |
ssid,
|
|
412 |
secModeWlan,
|
|
413 |
operModeWlan,
|
|
414 |
defaultWepKeyIndexWlan,
|
|
415 |
"wepkey1",
|
|
416 |
"wepkey2",
|
|
417 |
"wepkey3",
|
|
418 |
"wepkey4",
|
|
419 |
"wpapsk");
|
|
420 |
|
|
421 |
mView->mWizard->setParameters(
|
|
422 |
ssid,
|
|
423 |
CMManagerShim::Adhoc,
|
|
424 |
CMManagerShim::WlanSecModeWep,
|
|
425 |
false, false, true);
|
|
426 |
|
|
427 |
mView->showWizard();
|
|
428 |
verifyModeSelection();
|
|
429 |
|
|
430 |
QCOMPARE(selectRadioButton("radioButtonList", 0), true);
|
|
431 |
QTest::qWait(WaitTimeForUi);
|
|
432 |
QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
|
|
433 |
QCOMPARE(mouseClickNext(), true);
|
|
434 |
QTest::qWait(WaitTimeForUi);
|
|
435 |
|
|
436 |
QCOMPARE( verifyCurrentPage(WpsWizardPage::PageWpsWizardStep3_Button), true );
|
|
437 |
QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
|
|
438 |
QCOMPARE( mouseClickNext(), true);
|
|
439 |
QCOMPARE( verifyCurrentPage(WpsWizardPage::PageWpsWizardStep4), true );
|
|
440 |
QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
|
|
441 |
|
|
442 |
QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageProcessSettings, ssid), true );
|
|
443 |
QCOMPARE( verifyCurrentPage(WlanWizardPageInternal::PageSummary, 10, 500), true );
|
|
444 |
QTest::qWait(WaitTimeForUi);
|
|
445 |
|
|
446 |
QCOMPARE( mWlanQtUtilsContext->verifyWlanIapSettings(ap), true);
|
|
447 |
}
|
|
448 |
|
|
449 |
|
|
450 |
void TestWlanWizardWps::tcPinCode_failure(
|
|
451 |
int errorCode,
|
|
452 |
const QString &errorText)
|
|
453 |
{
|
|
454 |
const QString ssid("tcPinCode_failure");
|
|
455 |
|
|
456 |
mWlanQtUtilsContext->setCreateWlanIapResult(3);
|
|
457 |
mWlanQtUtilsContext->setConnectionSuccessed(true);
|
|
458 |
mWlanQtUtilsContext->setSignalWlanNetworkOpened(3);
|
|
459 |
mWlanQtUtilsContext->setSignalIctResult(3, WlanQtUtils::IctPassed);
|
|
460 |
|
|
461 |
mWlanMgmtClientContext->setRunProtectedSetup(ssid, errorCode);
|
|
462 |
|
|
463 |
mView->mWizard->setParameters(
|
|
464 |
ssid,
|
|
465 |
CMManagerShim::Adhoc,
|
|
466 |
CMManagerShim::WlanSecModeWep,
|
|
467 |
false, false, true);
|
|
468 |
|
|
469 |
mView->showWizard();
|
|
470 |
verifyModeSelection();
|
|
471 |
|
|
472 |
QCOMPARE(selectRadioButton("radioButtonList", 1), true);
|
|
473 |
QTest::qWait(WaitTimeForUi);
|
|
474 |
QCOMPARE( verifyActionButtons(ButtonHidden, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
|
|
475 |
QCOMPARE(mouseClickNext(), true);
|
|
476 |
QTest::qWait(WaitTimeForUi);
|
|
477 |
|
|
478 |
QCOMPARE( verifyCurrentPage(WpsWizardPage::PageWpsWizardStep3_Number), true );
|
|
479 |
QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonEnabled, ButtonHidden), true );
|
|
480 |
|
|
481 |
QCOMPARE(mouseClickNext(), true);
|
|
482 |
QTest::qWait(WaitTimeForUi);
|
|
483 |
|
|
484 |
QCOMPARE( verifyCurrentPage(WpsWizardPage::PageWpsWizardStep4), true );
|
|
485 |
QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
|
|
486 |
|
|
487 |
QCOMPARE( verifyCurrentPageWithInfo(WlanWizardPageInternal::PageGenericError, errorText), true );
|
|
488 |
QCOMPARE( verifyActionButtons(ButtonEnabled, ButtonEnabled, ButtonDisabled, ButtonHidden), true );
|
|
489 |
QTest::qWait(WaitTimeForUi);
|
|
490 |
}
|