author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:33:21 +0100 | |
branch | GCC_SURGE |
changeset 51 | f39ed5e045e0 |
parent 22 | 6bb1b21d2484 |
parent 46 | bc5a64e5bc3c |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 2009 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 |
||
18 |
#include "ut_networkpluginform.h" |
|
19 |
#include "qtestmains60ui.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
20 |
#include "cpitemdatahelper.h" |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
21 |
#include "psetwrapper.h" |
37 | 22 |
#define private public |
23 |
#include "cpnetworkpluginform.h" |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
24 |
|
37 | 25 |
|
26 |
class CPsetContainer |
|
27 |
{ |
|
28 |
public: |
|
29 |
CPsetContainer(){}; |
|
30 |
~CPsetContainer(){}; |
|
31 |
}; |
|
32 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
33 |
const QString KIconGsmForbidden("qtg_small_network_off"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
34 |
const QString KIconGsmNotForbidden("qtg_small_network"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
35 |
const QString KIconWcdmaForbidden("qtg_small_wcdma_off"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
36 |
const QString KIconWcdmaNotForbidden("qtg_small_wcdma"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
37 |
const QString KIconGsmAndWcdmaForbidden("qtg_small_pd_wcdma_off"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
38 |
const QString KIconGsmAndWcdmaNotForbidden("qtg_small_pd_wcdma"); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
39 |
|
37 | 40 |
/*! |
41 |
UT_CpNetworkPluginForm::UT_CpNetworkPluginForm |
|
42 |
*/ |
|
43 |
UT_CpNetworkPluginForm::UT_CpNetworkPluginForm() |
|
44 |
: m_networkPluginForm(NULL), i(0) |
|
45 |
{ |
|
46 |
SmcDefaultValue<PSetNetworkWrapper::ErrorCode>::SetL(PSetNetworkWrapper::ErrNoError); |
|
47 |
} |
|
48 |
||
49 |
/*! |
|
50 |
UT_CpNetworkPluginForm::~UT_CpNetworkPluginForm |
|
51 |
*/ |
|
52 |
UT_CpNetworkPluginForm::~UT_CpNetworkPluginForm() |
|
53 |
{ |
|
54 |
||
55 |
} |
|
56 |
||
57 |
/*! |
|
58 |
UT_CpNetworkPluginForm::init |
|
59 |
*/ |
|
60 |
void UT_CpNetworkPluginForm::init() |
|
61 |
{ |
|
62 |
initialize(); |
|
63 |
||
64 |
QVERIFY(!m_networkPluginForm); |
|
65 |
CPsetContainer tmpPsetContainer; |
|
66 |
m_networkWrapper = new PSetNetworkWrapper(tmpPsetContainer); |
|
67 |
expect("PSetWrapper::networkWrapper").returns(m_networkWrapper); |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
68 |
expect("PSetNetworkWrapper::isManualNetworkSelectionSupported").returns(true); |
37 | 69 |
if(i) { |
70 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic; |
|
71 |
} else { |
|
72 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual; |
|
73 |
} |
|
74 |
i++; |
|
75 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
76 |
m_networkPluginForm = new CpNetworkPluginForm(); |
|
77 |
QVERIFY(m_networkPluginForm); |
|
78 |
} |
|
79 |
||
80 |
||
81 |
/*! |
|
82 |
UT_CpNetworkPluginForm::t_networkModeStateChanged |
|
83 |
*/ |
|
84 |
void UT_CpNetworkPluginForm::t_networkModeStateChanged() |
|
85 |
{ |
|
86 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
87 |
m_networkPluginForm->networkModeStateChanged(0); |
|
88 |
||
89 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
90 |
m_networkPluginForm->networkModeStateChanged(1); |
|
91 |
||
92 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
93 |
m_networkPluginForm->networkModeStateChanged(2); |
|
94 |
||
95 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
96 |
m_networkPluginForm->networkModeStateChanged(3); |
|
97 |
||
98 |
expect("CpSettingsWrapper::isPhoneOffline").returns(true); |
|
99 |
m_networkPluginForm->networkModeStateChanged(0); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
100 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
101 |
QVERIFY(verify()); |
37 | 102 |
} |
103 |
||
104 |
/*! |
|
105 |
UT_CpNetworkPluginForm::t_operatorSelectionStateChanged |
|
106 |
*/ |
|
107 |
void UT_CpNetworkPluginForm::t_operatorSelectionStateChanged() |
|
108 |
{ |
|
109 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
110 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic; |
|
111 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
112 |
m_networkPluginForm->operatorSelectionStateChanged(); |
37 | 113 |
|
114 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
115 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual; |
|
116 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
117 |
m_networkPluginForm->operatorSelectionStateChanged(); |
37 | 118 |
|
119 |
expect("CpSettingsWrapper::isPhoneOffline").returns(true); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
120 |
m_networkPluginForm->operatorSelectionStateChanged(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
121 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
122 |
QVERIFY(verify()); |
37 | 123 |
} |
124 |
||
125 |
/*! |
|
126 |
UT_CpNetworkPluginForm::t_networkAccessModeGot |
|
127 |
*/ |
|
128 |
void UT_CpNetworkPluginForm::t_networkAccessModeGot() |
|
129 |
{ |
|
130 |
m_networkPluginForm->networkAccessModeGot(0); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
131 |
|
37 | 132 |
m_networkPluginForm->networkAccessModeGot(1); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
133 |
|
37 | 134 |
m_networkPluginForm->networkAccessModeGot(2); |
135 |
||
136 |
m_networkPluginForm->networkAccessModeGot(3); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
137 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
138 |
QVERIFY(verify()); |
37 | 139 |
} |
140 |
||
141 |
/*! |
|
142 |
UT_CpNetworkPluginForm::t_availableNetworksGot |
|
143 |
*/ |
|
144 |
void UT_CpNetworkPluginForm::t_availableNetworksGot() |
|
145 |
{ |
|
146 |
PSetNetworkWrapper::NetworkInfo temp; |
|
147 |
QList<PSetNetworkWrapper::NetworkInfo*> networkInfoList; |
|
148 |
networkInfoList.append(&temp); |
|
149 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
150 |
expect("HbDialog::open"); |
37 | 151 |
m_networkPluginForm->availableNetworksGot(networkInfoList); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
152 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
153 |
QVERIFY(verify()); |
37 | 154 |
} |
155 |
||
156 |
/*! |
|
157 |
UT_CpNetworkPluginForm::t_networkReqestFailed |
|
158 |
*/ |
|
159 |
void UT_CpNetworkPluginForm::t_networkReqestFailed() |
|
160 |
{ |
|
161 |
PSetNetworkWrapper::ErrorCode error(PSetNetworkWrapper::ErrCauseCallActive); |
|
162 |
PSetNetworkWrapper::RequestType type(PSetNetworkWrapper::RequestSetNetworkMode); |
|
163 |
expect("PSetNetworkWrapper::getNetworkAccessMode"); |
|
164 |
m_networkPluginForm->networkReqestFailed(error, type); |
|
165 |
||
166 |
error = PSetNetworkWrapper::ErrNoNetworkService; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
167 |
type = PSetNetworkWrapper::RequestSetNetworkMode; |
37 | 168 |
expect("PSetNetworkWrapper::getNetworkAccessMode"); |
169 |
m_networkPluginForm->networkReqestFailed(error, type); |
|
170 |
||
171 |
error = PSetNetworkWrapper::ErrOfflineOpNotAllowed; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
172 |
type = PSetNetworkWrapper::RequestSetNetworkMode; |
37 | 173 |
expect("PSetNetworkWrapper::getNetworkAccessMode"); |
174 |
m_networkPluginForm->networkReqestFailed(error, type); |
|
175 |
||
176 |
PSetNetworkWrapper::NetworkInfo temp; |
|
177 |
QList<PSetNetworkWrapper::NetworkInfo*> networkInfoList; |
|
178 |
networkInfoList.append(&temp); |
|
179 |
m_networkPluginForm->availableNetworksGot(networkInfoList); |
|
180 |
error = PSetNetworkWrapper::ErrNoNetworkAccess; |
|
181 |
type = PSetNetworkWrapper::RequestSetNetwork; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
182 |
expect("HbDialog::open"); |
37 | 183 |
m_networkPluginForm->networkReqestFailed(error, type); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
184 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
185 |
QVERIFY(verify()); |
37 | 186 |
} |
187 |
||
188 |
/*! |
|
189 |
UT_CpNetworkPluginForm::t_userCancel |
|
190 |
*/ |
|
191 |
void UT_CpNetworkPluginForm::t_userCancel() |
|
192 |
{ |
|
193 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual; |
|
194 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
195 |
m_networkPluginForm->userCancel(); |
|
196 |
||
197 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic; |
|
198 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
199 |
m_networkPluginForm->userCancel(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
200 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
201 |
QVERIFY(verify()); |
37 | 202 |
} |
203 |
||
204 |
/*! |
|
205 |
UT_CpNetworkPluginForm::t_handleSearchingNetworks |
|
206 |
*/ |
|
207 |
void UT_CpNetworkPluginForm::t_handleSearchingNetworks() |
|
208 |
{ |
|
209 |
PSetNetworkWrapper::RequestType type(PSetNetworkWrapper::RequestNone); |
|
210 |
m_networkPluginForm->handleSearchingNetworks(type); |
|
211 |
||
212 |
type = PSetNetworkWrapper::RequestEnumerateNetworks; |
|
213 |
m_networkPluginForm->handleSearchingNetworks(type); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
214 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
215 |
QVERIFY(verify()); |
37 | 216 |
} |
217 |
||
218 |
/*! |
|
219 |
UT_CpNetworkPluginForm::t_handleRequestingSelectedNetwork |
|
220 |
*/ |
|
221 |
void UT_CpNetworkPluginForm::t_handleRequestingSelectedNetwork() |
|
222 |
{ |
|
223 |
m_networkPluginForm->handleRequestingSelectedNetwork(true); |
|
224 |
m_networkPluginForm->handleRequestingSelectedNetwork(false); |
|
225 |
} |
|
226 |
||
227 |
/*! |
|
228 |
UT_CpNetworkPluginForm::t_handleNetworkChanged |
|
229 |
*/ |
|
230 |
void UT_CpNetworkPluginForm::t_handleNetworkChanged() |
|
231 |
{ |
|
232 |
PSetNetworkWrapper::NetworkInfo currentInfo; |
|
233 |
PSetNetworkWrapper::RegistrationStatus status(PSetNetworkWrapper::RegisteredOnHomeNetwork); |
|
234 |
m_networkPluginForm->handleNetworkChanged(currentInfo, status); |
|
235 |
||
236 |
status = PSetNetworkWrapper::RegisteredRoaming; |
|
237 |
currentInfo.m_longName = "test"; |
|
238 |
m_networkPluginForm->handleNetworkChanged(currentInfo, status); |
|
239 |
||
240 |
status = PSetNetworkWrapper::RegisteredRoaming; |
|
241 |
currentInfo.m_shortName = "test"; |
|
242 |
m_networkPluginForm->handleNetworkChanged(currentInfo, status); |
|
243 |
} |
|
244 |
||
245 |
/*! |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
246 |
UT_CpNetworkPluginForm::t_primaryIconForNetwork |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
247 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
248 |
void UT_CpNetworkPluginForm::t_primaryIconForNetwork() |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
249 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
250 |
QScopedPointer<PSetWrapper> wrapper(new PSetWrapper()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
251 |
expect("PSetWrapper::networkWrapper").returns(wrapper.data()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
252 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
253 |
QScopedPointer<CpNetworkPluginFormAdapter> |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
254 |
formClassAdapter(new CpNetworkPluginFormAdapter()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
255 |
PSetNetworkWrapper::NetworkInfo currentInfo; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
256 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
257 |
// Test: forbidden icon flag ON, mode: GSM, status: forbidden |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
258 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsm; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
259 |
currentInfo.m_status = PSetNetworkWrapper::StatusForbidden; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
260 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
261 |
QString iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
262 |
QCOMPARE(iconName, KIconGsmForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
263 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
264 |
// Test: forbidden icon flag ON, mode: GSM, status: available |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
265 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsm; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
266 |
currentInfo.m_status = PSetNetworkWrapper::StatusAvailable; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
267 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
268 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
269 |
QCOMPARE(iconName, KIconGsmNotForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
270 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
271 |
// Test: forbidden icon flag ON, mode: WCDMA, status: forbidden |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
272 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
273 |
currentInfo.m_status = PSetNetworkWrapper::StatusForbidden; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
274 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
275 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
276 |
QCOMPARE(iconName, KIconWcdmaForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
277 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
278 |
// Test: forbidden icon flag ON, mode: WCDMA, status: available |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
279 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
280 |
currentInfo.m_status = PSetNetworkWrapper::StatusAvailable; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
281 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
282 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
283 |
QCOMPARE(iconName, KIconWcdmaNotForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
284 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
285 |
// Test: forbidden icon flag ON, mode: GSM and WCDMA, status: forbidden |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
286 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsmAndWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
287 |
currentInfo.m_status = PSetNetworkWrapper::StatusForbidden; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
288 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
289 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
290 |
QCOMPARE(iconName, KIconGsmAndWcdmaForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
291 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
292 |
// Test: forbidden icon flag ON, mode: GSM and WCDMA, status: available |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
293 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsmAndWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
294 |
currentInfo.m_status = PSetNetworkWrapper::StatusAvailable; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
295 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
296 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
297 |
QCOMPARE(iconName, KIconGsmAndWcdmaNotForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
298 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
299 |
// Test: forbidden icon flag OFF |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
300 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(false); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
301 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
302 |
QCOMPARE(iconName, QString("")); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
303 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
304 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
305 |
/*! |
37 | 306 |
UT_CpNetworkPluginForm::cleanup |
307 |
*/ |
|
308 |
void UT_CpNetworkPluginForm::cleanup() |
|
309 |
{ |
|
310 |
reset(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
311 |
delete m_networkPluginForm; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
312 |
m_networkPluginForm = NULL; |
37 | 313 |
delete m_networkWrapper; |
314 |
m_networkWrapper = NULL; |
|
315 |
} |
|
316 |
||
317 |
/*! |
|
318 |
UT_CpNetworkPluginForm::t_memleak |
|
319 |
*/ |
|
320 |
void UT_CpNetworkPluginForm::t_memleak() |
|
321 |
{ |
|
322 |
||
323 |
} |
|
324 |
||
325 |
/*! |
|
326 |
UT_CpNetworkPluginForm::updateNetworkSelectionMode |
|
327 |
*/ |
|
328 |
void UT_CpNetworkPluginForm::updateNetworkSelectionMode( |
|
329 |
PSetNetworkWrapper::NetworkSelectionMode& mode) |
|
330 |
{ |
|
331 |
mode = m_NetworkSelectionMode; |
|
332 |
} |
|
333 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
334 |
|
37 | 335 |
QTEST_MAIN_S60UI(UT_CpNetworkPluginForm) |