author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 02 Sep 2010 20:26:16 +0300 | |
changeset 64 | 6aaf0276100e |
parent 46 | bc5a64e5bc3c |
child 76 | cfea66083b62 |
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 |
/*! |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
82 |
UT_CpNetworkPluginForm::cleanup |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
83 |
*/ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
84 |
void UT_CpNetworkPluginForm::cleanup() |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
85 |
{ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
86 |
reset(); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
87 |
delete m_networkPluginForm; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
88 |
m_networkPluginForm = NULL; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
89 |
delete m_networkWrapper; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
90 |
m_networkWrapper = NULL; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
91 |
} |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
92 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
93 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
94 |
/*! |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
95 |
UT_CpNetworkPluginForm::updateNetworkSelectionMode |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
96 |
*/ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
97 |
void UT_CpNetworkPluginForm::updateNetworkSelectionMode( |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
98 |
PSetNetworkWrapper::NetworkSelectionMode& mode) |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
99 |
{ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
100 |
mode = m_NetworkSelectionMode; |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
101 |
} |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
102 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
103 |
/*! |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
104 |
UT_CpNetworkPluginForm::t_memleak |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
105 |
*/ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
106 |
void UT_CpNetworkPluginForm::t_memleak() |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
107 |
{ |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
108 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
109 |
} |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
110 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
111 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
112 |
/*! |
37 | 113 |
UT_CpNetworkPluginForm::t_networkModeStateChanged |
114 |
*/ |
|
115 |
void UT_CpNetworkPluginForm::t_networkModeStateChanged() |
|
116 |
{ |
|
117 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
118 |
m_networkPluginForm->networkModeStateChanged(0); |
|
119 |
||
120 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
121 |
m_networkPluginForm->networkModeStateChanged(1); |
|
122 |
||
123 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
124 |
m_networkPluginForm->networkModeStateChanged(2); |
|
125 |
||
126 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
127 |
m_networkPluginForm->networkModeStateChanged(3); |
37 | 128 |
|
129 |
expect("CpSettingsWrapper::isPhoneOffline").returns(true); |
|
130 |
m_networkPluginForm->networkModeStateChanged(0); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
131 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
132 |
QVERIFY(verify()); |
37 | 133 |
} |
134 |
||
135 |
/*! |
|
136 |
UT_CpNetworkPluginForm::t_operatorSelectionStateChanged |
|
137 |
*/ |
|
138 |
void UT_CpNetworkPluginForm::t_operatorSelectionStateChanged() |
|
139 |
{ |
|
140 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
141 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic; |
|
142 |
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
|
143 |
m_networkPluginForm->operatorSelectionStateChanged(); |
37 | 144 |
|
145 |
expect("CpSettingsWrapper::isPhoneOffline").returns(false); |
|
146 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual; |
|
147 |
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
|
148 |
m_networkPluginForm->operatorSelectionStateChanged(); |
37 | 149 |
|
150 |
expect("CpSettingsWrapper::isPhoneOffline").returns(true); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
151 |
m_networkPluginForm->operatorSelectionStateChanged(); |
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_networkAccessModeGot |
|
158 |
*/ |
|
159 |
void UT_CpNetworkPluginForm::t_networkAccessModeGot() |
|
160 |
{ |
|
161 |
m_networkPluginForm->networkAccessModeGot(0); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
162 |
|
37 | 163 |
m_networkPluginForm->networkAccessModeGot(1); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
164 |
|
37 | 165 |
m_networkPluginForm->networkAccessModeGot(2); |
166 |
||
167 |
m_networkPluginForm->networkAccessModeGot(3); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
168 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
169 |
QVERIFY(verify()); |
37 | 170 |
} |
171 |
||
172 |
/*! |
|
173 |
UT_CpNetworkPluginForm::t_availableNetworksGot |
|
174 |
*/ |
|
175 |
void UT_CpNetworkPluginForm::t_availableNetworksGot() |
|
176 |
{ |
|
177 |
PSetNetworkWrapper::NetworkInfo temp; |
|
178 |
QList<PSetNetworkWrapper::NetworkInfo*> networkInfoList; |
|
179 |
networkInfoList.append(&temp); |
|
180 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
181 |
expect("HbDialog::open"); |
37 | 182 |
m_networkPluginForm->availableNetworksGot(networkInfoList); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
183 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
184 |
QVERIFY(verify()); |
37 | 185 |
} |
186 |
||
187 |
/*! |
|
188 |
UT_CpNetworkPluginForm::t_networkReqestFailed |
|
189 |
*/ |
|
190 |
void UT_CpNetworkPluginForm::t_networkReqestFailed() |
|
191 |
{ |
|
192 |
PSetNetworkWrapper::ErrorCode error(PSetNetworkWrapper::ErrCauseCallActive); |
|
193 |
PSetNetworkWrapper::RequestType type(PSetNetworkWrapper::RequestSetNetworkMode); |
|
194 |
expect("PSetNetworkWrapper::getNetworkAccessMode"); |
|
195 |
m_networkPluginForm->networkReqestFailed(error, type); |
|
196 |
||
197 |
error = PSetNetworkWrapper::ErrNoNetworkService; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
198 |
type = PSetNetworkWrapper::RequestSetNetworkMode; |
37 | 199 |
expect("PSetNetworkWrapper::getNetworkAccessMode"); |
200 |
m_networkPluginForm->networkReqestFailed(error, type); |
|
201 |
||
202 |
error = PSetNetworkWrapper::ErrOfflineOpNotAllowed; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
203 |
type = PSetNetworkWrapper::RequestSetNetworkMode; |
37 | 204 |
expect("PSetNetworkWrapper::getNetworkAccessMode"); |
205 |
m_networkPluginForm->networkReqestFailed(error, type); |
|
206 |
||
207 |
PSetNetworkWrapper::NetworkInfo temp; |
|
208 |
QList<PSetNetworkWrapper::NetworkInfo*> networkInfoList; |
|
209 |
networkInfoList.append(&temp); |
|
210 |
m_networkPluginForm->availableNetworksGot(networkInfoList); |
|
211 |
error = PSetNetworkWrapper::ErrNoNetworkAccess; |
|
212 |
type = PSetNetworkWrapper::RequestSetNetwork; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
213 |
expect("HbDialog::open"); |
37 | 214 |
m_networkPluginForm->networkReqestFailed(error, type); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
215 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
216 |
QVERIFY(verify()); |
37 | 217 |
} |
218 |
||
219 |
/*! |
|
220 |
UT_CpNetworkPluginForm::t_userCancel |
|
221 |
*/ |
|
222 |
void UT_CpNetworkPluginForm::t_userCancel() |
|
223 |
{ |
|
224 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeManual; |
|
225 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
226 |
m_networkPluginForm->userCancel(); |
|
227 |
||
228 |
m_NetworkSelectionMode = PSetNetworkWrapper::SelectionModeAutomatic; |
|
229 |
expect("PSetNetworkWrapper::getNetworkSelectionMode").willOnce(invoke(this, &updateNetworkSelectionMode)); |
|
230 |
m_networkPluginForm->userCancel(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
231 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
232 |
QVERIFY(verify()); |
37 | 233 |
} |
234 |
||
235 |
/*! |
|
236 |
UT_CpNetworkPluginForm::t_handleSearchingNetworks |
|
237 |
*/ |
|
238 |
void UT_CpNetworkPluginForm::t_handleSearchingNetworks() |
|
239 |
{ |
|
240 |
PSetNetworkWrapper::RequestType type(PSetNetworkWrapper::RequestNone); |
|
241 |
m_networkPluginForm->handleSearchingNetworks(type); |
|
242 |
||
243 |
type = PSetNetworkWrapper::RequestEnumerateNetworks; |
|
244 |
m_networkPluginForm->handleSearchingNetworks(type); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
245 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
246 |
QVERIFY(verify()); |
37 | 247 |
} |
248 |
||
249 |
/*! |
|
250 |
UT_CpNetworkPluginForm::t_handleRequestingSelectedNetwork |
|
251 |
*/ |
|
252 |
void UT_CpNetworkPluginForm::t_handleRequestingSelectedNetwork() |
|
253 |
{ |
|
254 |
m_networkPluginForm->handleRequestingSelectedNetwork(true); |
|
255 |
m_networkPluginForm->handleRequestingSelectedNetwork(false); |
|
256 |
} |
|
257 |
||
258 |
/*! |
|
259 |
UT_CpNetworkPluginForm::t_handleNetworkChanged |
|
260 |
*/ |
|
261 |
void UT_CpNetworkPluginForm::t_handleNetworkChanged() |
|
262 |
{ |
|
263 |
PSetNetworkWrapper::NetworkInfo currentInfo; |
|
264 |
PSetNetworkWrapper::RegistrationStatus status(PSetNetworkWrapper::RegisteredOnHomeNetwork); |
|
265 |
m_networkPluginForm->handleNetworkChanged(currentInfo, status); |
|
266 |
||
267 |
status = PSetNetworkWrapper::RegisteredRoaming; |
|
268 |
currentInfo.m_longName = "test"; |
|
269 |
m_networkPluginForm->handleNetworkChanged(currentInfo, status); |
|
270 |
||
271 |
status = PSetNetworkWrapper::RegisteredRoaming; |
|
272 |
currentInfo.m_shortName = "test"; |
|
273 |
m_networkPluginForm->handleNetworkChanged(currentInfo, status); |
|
274 |
} |
|
275 |
||
276 |
/*! |
|
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
277 |
UT_CpNetworkPluginForm::t_primaryIconForNetwork |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
278 |
*/ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
279 |
void UT_CpNetworkPluginForm::t_primaryIconForNetwork() |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
280 |
{ |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
281 |
QScopedPointer<PSetWrapper> wrapper(new PSetWrapper()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
282 |
expect("PSetWrapper::networkWrapper").returns(wrapper.data()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
283 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
284 |
QScopedPointer<CpNetworkPluginFormAdapter> |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
285 |
formClassAdapter(new CpNetworkPluginFormAdapter()); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
286 |
PSetNetworkWrapper::NetworkInfo currentInfo; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
287 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
288 |
// 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
|
289 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsm; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
290 |
currentInfo.m_status = PSetNetworkWrapper::StatusForbidden; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
291 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
292 |
QString iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
293 |
QCOMPARE(iconName, KIconGsmForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
294 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
295 |
// 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
|
296 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsm; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
297 |
currentInfo.m_status = PSetNetworkWrapper::StatusAvailable; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
298 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
299 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
300 |
QCOMPARE(iconName, KIconGsmNotForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
301 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
302 |
// 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
|
303 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
304 |
currentInfo.m_status = PSetNetworkWrapper::StatusForbidden; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
305 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
306 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
307 |
QCOMPARE(iconName, KIconWcdmaForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
308 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
309 |
// 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
|
310 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
311 |
currentInfo.m_status = PSetNetworkWrapper::StatusAvailable; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
312 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
313 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
314 |
QCOMPARE(iconName, KIconWcdmaNotForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
315 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
316 |
// 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
|
317 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsmAndWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
318 |
currentInfo.m_status = PSetNetworkWrapper::StatusForbidden; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
319 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
320 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
321 |
QCOMPARE(iconName, KIconGsmAndWcdmaForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
322 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
323 |
// 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
|
324 |
currentInfo.m_access = PSetNetworkWrapper::AccessTypeGsmAndWcdma; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
325 |
currentInfo.m_status = PSetNetworkWrapper::StatusAvailable; |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
326 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(true); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
327 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
328 |
QCOMPARE(iconName, KIconGsmAndWcdmaNotForbidden); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
329 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
330 |
// Test: forbidden icon flag OFF |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
331 |
expect("CpSettingsWrapper::forbiddenIconSupported").returns(false); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
332 |
iconName = formClassAdapter->primaryIconForNetwork(currentInfo); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
333 |
QCOMPARE(iconName, QString("")); |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
334 |
} |
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
335 |
|
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
336 |
/*! |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
337 |
UT_CpNetworkPluginForm::t_chageVisbilityOfManualNetworkSelection |
37 | 338 |
*/ |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
339 |
void UT_CpNetworkPluginForm::t_chageVisbilityOfManualNetworkSelection() |
37 | 340 |
{ |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
341 |
m_networkPluginForm->chageVisbilityOfManualNetworkSelection(false); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
342 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
343 |
m_networkPluginForm->chageVisbilityOfManualNetworkSelection(false); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
344 |
|
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
345 |
m_networkPluginForm->chageVisbilityOfManualNetworkSelection(true); |
37 | 346 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
347 |
m_networkPluginForm->chageVisbilityOfManualNetworkSelection(true); |
37 | 348 |
} |
349 |
||
46
bc5a64e5bc3c
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
350 |
|
37 | 351 |
QTEST_MAIN_S60UI(UT_CpNetworkPluginForm) |