author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:16:48 +0300 | |
changeset 77 | 2be0b271d017 |
parent 64 | 6aaf0276100e |
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 <HbDataFormModel> |
|
19 |
#include <HbCheckBox> |
|
20 |
#include <psetwrapper.h> |
|
56
5bcb308bd24d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
21 |
#include <psuinotes.h> |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
22 |
#include <nwdefs.h> |
37 | 23 |
#include "ut_barringplugingroup.h" |
24 |
#include "qtestmains60.h" |
|
25 |
#include "cpitemdatahelper.h" |
|
26 |
#define private friend class UT_CpBarringPluginGroup; private |
|
27 |
#include "cpbarringplugingroup.h" |
|
28 |
||
29 |
void setNoteIdentifier(int ¬eId, const QString& text) |
|
30 |
{ |
|
31 |
Q_UNUSED(text) |
|
32 |
||
33 |
noteId = 1; |
|
34 |
} |
|
35 |
||
36 |
||
37 |
const QString KCurrentPassword = "1234"; |
|
38 |
void setCurrentPasswordParams( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
39 |
const QString &title, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
40 |
const QValidator &validator, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
41 |
int maxPasswordLength) |
37 | 42 |
{ |
43 |
Q_UNUSED(title) |
|
44 |
Q_UNUSED(validator) |
|
45 |
Q_UNUSED(maxPasswordLength) |
|
46 |
} |
|
47 |
||
48 |
||
49 |
const QString KNewAndVerifiedPassword = "4321"; |
|
50 |
void setNewAndVerifiedPasswordParams( |
|
51 |
const QString &title, |
|
52 |
const QValidator &validator, |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
53 |
int maxPasswordLength) |
37 | 54 |
{ |
55 |
Q_UNUSED(title) |
|
56 |
Q_UNUSED(validator) |
|
57 |
Q_UNUSED(maxPasswordLength) |
|
58 |
} |
|
59 |
||
60 |
||
61 |
void setPasswordParamsCancel( |
|
62 |
const QString &title, |
|
63 |
const QValidator &validator, |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
64 |
int maxPasswordLength) |
37 | 65 |
{ |
66 |
Q_UNUSED(title) |
|
67 |
Q_UNUSED(validator) |
|
68 |
Q_UNUSED(maxPasswordLength) |
|
69 |
} |
|
70 |
||
71 |
||
72 |
/*! |
|
73 |
UT_CpBarringPluginGroup::UT_CpBarringPluginGroup |
|
74 |
*/ |
|
75 |
UT_CpBarringPluginGroup::UT_CpBarringPluginGroup() |
|
76 |
: |
|
77 |
m_barringpluginGroup(NULL), |
|
78 |
m_barringWrapperMock(NULL), |
|
79 |
m_dataFormModel(NULL) |
|
80 |
{ |
|
81 |
||
82 |
} |
|
83 |
||
84 |
||
85 |
/*! |
|
86 |
UT_CpBarringPluginGroup::~UT_CpBarringPluginGroup |
|
87 |
*/ |
|
88 |
UT_CpBarringPluginGroup::~UT_CpBarringPluginGroup() |
|
89 |
{ |
|
90 |
delete m_barringWrapperMock; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
91 |
delete m_dataFormModel; |
37 | 92 |
} |
93 |
||
94 |
||
95 |
/*! |
|
96 |
UT_CpBarringPluginGroup::init |
|
97 |
*/ |
|
98 |
void UT_CpBarringPluginGroup::init() |
|
99 |
{ |
|
100 |
initialize(); |
|
101 |
QT_TRAP_THROWING(SmcDefaultValue<QString>::SetL(QString(""))); |
|
102 |
||
103 |
CPsetContainer &dummyContainer = reinterpret_cast<CPsetContainer &>(*this); |
|
104 |
m_barringWrapperMock = new PSetCallBarringWrapper(dummyContainer); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
105 |
EXPECT(PSetWrapper, callBarringWrapper).returns(m_barringWrapperMock); |
37 | 106 |
|
107 |
CpItemDataHelper itemDataHelper; |
|
108 |
m_barringpluginGroup = new CpBarringPluginGroup(itemDataHelper); |
|
109 |
||
110 |
m_dataFormModel = new HbDataFormModel(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
111 |
m_dataFormModel->appendDataFormItem(m_barringpluginGroup); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
112 |
m_barringpluginGroup->m_model = m_dataFormModel; |
37 | 113 |
|
114 |
QVERIFY(verify()); |
|
115 |
||
116 |
connect( |
|
117 |
this, SIGNAL(simulateCheckStateChange(int)), |
|
118 |
m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); |
|
119 |
} |
|
120 |
||
121 |
||
122 |
/*! |
|
123 |
UT_CpBarringPluginGroup::cleanup |
|
124 |
*/ |
|
125 |
void UT_CpBarringPluginGroup::cleanup() |
|
126 |
{ |
|
127 |
reset(); |
|
128 |
||
129 |
disconnect( |
|
130 |
this, SIGNAL(simulateCheckStateChange(int)), |
|
131 |
m_barringpluginGroup, SLOT(changeBarringStateRequested(int))); |
|
132 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
133 |
delete m_dataFormModel; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
134 |
m_dataFormModel = NULL; |
37 | 135 |
delete m_barringWrapperMock; |
136 |
m_barringWrapperMock = NULL; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
137 |
|
37 | 138 |
} |
139 |
||
140 |
||
141 |
/*! |
|
142 |
UT_CpBarringPluginGroup::t_memleak |
|
143 |
*/ |
|
144 |
void UT_CpBarringPluginGroup::t_memleak() |
|
145 |
{ |
|
146 |
||
147 |
} |
|
148 |
||
149 |
||
150 |
/*! |
|
151 |
UT_CpBarringPluginGroup::t_itemShownNotBarringItem |
|
152 |
Tests that itemShown() for other setting group's item is not handled. |
|
153 |
*/ |
|
154 |
void UT_CpBarringPluginGroup::t_itemShownNotBarringItem() |
|
155 |
{ |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
156 |
EXPECT(PSetCallBarringWrapper, barringStatus).times(0); |
37 | 157 |
|
158 |
QScopedPointer<CpSettingFormItemData> item(new CpSettingFormItemData( |
|
159 |
HbDataFormModelItem::CheckBoxItem, hbTrId(""), NULL)); |
|
160 |
m_dataFormModel->appendDataFormItem(item.data(), m_barringpluginGroup); |
|
161 |
m_barringpluginGroup->itemShown( |
|
162 |
m_dataFormModel->indexFromItem(item.data())); |
|
163 |
m_dataFormModel->removeItem(item.take()); |
|
164 |
||
165 |
QVERIFY(verify()); |
|
166 |
} |
|
167 |
||
168 |
||
169 |
/*! |
|
170 |
UT_CpBarringPluginGroup::t_itemShownBarringStatusRequestOngoing |
|
171 |
Tests that another progress note is not launched if one is already shown. |
|
172 |
*/ |
|
173 |
void UT_CpBarringPluginGroup::t_itemShownBarringStatusRequestOngoing() |
|
174 |
{ |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
175 |
EXPECT(PSetCallBarringWrapper, barringStatus); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
176 |
EXPECT(PsUiNotes, noteShowing).returns(true); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
177 |
EXPECT(PsUiNotes, showGlobalProgressNote).times(0); |
37 | 178 |
|
179 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); |
|
180 |
m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); |
|
181 |
||
182 |
QVERIFY(verify()); |
|
183 |
} |
|
184 |
||
185 |
||
186 |
/*! |
|
187 |
UT_CpBarringPluginGroup::t_barringStatusRequestCompletedForUpdateInquiry |
|
188 |
*/ |
|
189 |
void UT_CpBarringPluginGroup::t_barringStatusRequestCompletedForUpdateInquiry() |
|
190 |
{ |
|
191 |
// simulate successfull initial status inquiry |
|
192 |
QList<unsigned char> basicServiceGroupIds; |
|
193 |
const int errorCode = 0; |
|
194 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
195 |
for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { |
|
196 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
197 |
m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); |
|
198 |
||
199 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
200 |
errorCode, |
|
201 |
basicServiceGroupIds, |
|
202 |
PSetCallBarringWrapper::BarringStatusActive); |
|
203 |
} |
|
204 |
||
205 |
// simulate barring enable request |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
206 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this).times(1); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
207 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 208 |
.willOnce(invoke(setCurrentPasswordParams)); |
209 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
210 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
211 |
KCurrentPassword, true); |
37 | 212 |
|
213 |
// verify that already connected items are not enabled/connected again |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
214 |
EXPECT(CpItemDataHelper, removeConnection).times(1); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
215 |
EXPECT(CpItemDataHelper, addConnection).times(1); |
37 | 216 |
m_barringpluginGroup->barringStatusRequestCompleted( |
217 |
errorCode, |
|
218 |
basicServiceGroupIds, |
|
219 |
PSetCallBarringWrapper::BarringStatusActive); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
220 |
|
37 | 221 |
QVERIFY(verify()); |
222 |
} |
|
223 |
||
224 |
||
225 |
/*! |
|
226 |
UT_CpBarringPluginGroup::t_barringStatusRequestCompletedWithAnError |
|
227 |
*/ |
|
228 |
void UT_CpBarringPluginGroup::t_barringStatusRequestCompletedWithAnError() |
|
229 |
{ |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
230 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
231 |
EXPECT(PsUiNotes, showGlobalErrorNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
232 |
EXPECT(CpItemDataHelper, addConnection).times(0); |
37 | 233 |
|
234 |
QList<unsigned char> basicServiceGroupIds; |
|
235 |
const int errorCode = -1; |
|
236 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
237 |
errorCode, |
|
238 |
basicServiceGroupIds, |
|
239 |
PSetCallBarringWrapper::BarringStatusUnavailable); |
|
240 |
||
241 |
QVERIFY(verify()); |
|
242 |
} |
|
243 |
||
244 |
||
245 |
/*! |
|
246 |
UT_CpBarringPluginGroup::t_getBarringStatuses |
|
247 |
Tests functions |
|
248 |
CpBarringPluginGroup::itemShown, |
|
249 |
CpBarringPluginGroup::barringStatusRequestCompleted |
|
250 |
*/ |
|
251 |
Q_DECLARE_METATYPE(QModelIndex) |
|
252 |
void UT_CpBarringPluginGroup::t_getBarringStatuses() |
|
253 |
{ |
|
254 |
qRegisterMetaType<QModelIndex>("QModelIndex"); |
|
255 |
||
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
256 |
EXPECT(PSetCallBarringWrapper, barringStatus) |
37 | 257 |
.with(ServiceGroupVoice, |
258 |
PSetCallBarringWrapper::BarringTypeAllOutgoing); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
259 |
EXPECT(PSetCallBarringWrapper, barringStatus) |
37 | 260 |
.with(ServiceGroupVoice, |
261 |
PSetCallBarringWrapper::BarringTypeOutgoingInternational); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
262 |
EXPECT(PSetCallBarringWrapper, barringStatus) |
37 | 263 |
.with(ServiceGroupVoice, |
264 |
PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
265 |
EXPECT(PSetCallBarringWrapper, barringStatus) |
37 | 266 |
.with(ServiceGroupVoice, |
267 |
PSetCallBarringWrapper::BarringTypeAllIncoming); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
268 |
EXPECT(PSetCallBarringWrapper, barringStatus) |
37 | 269 |
.with(ServiceGroupVoice, |
270 |
PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
271 |
EXPECT(PsUiNotes, showGlobalProgressNote) |
37 | 272 |
.willOnce(invoke(setNoteIdentifier)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
273 |
EXPECT(CpItemDataHelper, addConnection).times(6); |
37 | 274 |
|
275 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
276 |
for (int childIndex = 0; childIndex < numOfChilds; childIndex++) { |
|
277 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
278 |
m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); |
|
279 |
} |
|
280 |
||
281 |
connect( |
|
282 |
m_dataFormModel, |
|
283 |
SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), |
|
284 |
this, |
|
285 |
SLOT(dataChanged(const QModelIndex &, const QModelIndex &))); |
|
286 |
||
287 |
QSignalSpy spy( |
|
288 |
m_dataFormModel, |
|
289 |
SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &))); |
|
290 |
QList<unsigned char> basicServiceGroupIds; |
|
291 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
292 |
PSetCallBarringWrapper::BarringErrorNone, |
|
293 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
294 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
295 |
PSetCallBarringWrapper::BarringErrorNone, |
|
296 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusInactive); |
|
297 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
298 |
PSetCallBarringWrapper::BarringErrorNone, |
|
299 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusNotProvisioned); |
|
300 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
301 |
PSetCallBarringWrapper::BarringErrorNone, |
|
302 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusUnavailable); |
|
303 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
304 |
PSetCallBarringWrapper::BarringErrorNone, |
|
305 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusUnknown); |
|
306 |
QCOMPARE(spy.count(), 11); |
|
307 |
||
308 |
QVERIFY(verify()); |
|
309 |
||
310 |
// Verify that barring status checking is not started on item show if |
|
311 |
// status is already queried. |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
312 |
EXPECT(PSetCallBarringWrapper, barringStatus).times(0); |
37 | 313 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); |
314 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
315 |
m_barringpluginGroup->itemShown(m_dataFormModel->indexFromItem(item)); |
|
316 |
||
317 |
QVERIFY(verify()); |
|
318 |
} |
|
319 |
||
320 |
||
321 |
/*! |
|
322 |
UT_CpBarringPluginGroup::t_enableBarringRequestCompleted |
|
323 |
*/ |
|
324 |
void UT_CpBarringPluginGroup::t_enableBarringRequestCompleted() |
|
325 |
{ |
|
326 |
// request completed succesfully -case |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
327 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this).times(1); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
328 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 329 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
330 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
331 |
EXPECT(PsUiNotes, showNotificationDialog); |
37 | 332 |
|
333 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
334 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
335 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
336 |
|
37 | 337 |
m_barringpluginGroup->enableBarringRequestCompleted( |
338 |
0, |
|
339 |
PSetCallBarringWrapper::BarringTypeAllBarrings, |
|
340 |
PSetCallBarringWrapper::BarringStatusActive, |
|
341 |
false); |
|
342 |
||
343 |
QVERIFY(verify()); |
|
344 |
QList<unsigned char> basicServiceGroupIds; |
|
345 |
||
346 |
// request completed with an error -case |
|
347 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); |
|
348 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
349 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
350 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 351 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
352 |
EXPECT(CpItemDataHelper, removeConnection); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
353 |
EXPECT(CpItemDataHelper, addConnection); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
354 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
355 |
EXPECT(PsUiNotes, showGlobalErrorNote); |
37 | 356 |
|
357 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
358 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
359 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
360 |
|
37 | 361 |
m_barringpluginGroup->enableBarringRequestCompleted( |
362 |
-1, |
|
363 |
PSetCallBarringWrapper::BarringTypeAllBarrings, |
|
364 |
PSetCallBarringWrapper::BarringStatusActive, |
|
365 |
false); |
|
366 |
||
367 |
QVERIFY(verify()); |
|
368 |
||
369 |
// request completed successfully and dependent barring setting needs |
|
370 |
// status inquiry |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
371 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
372 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 373 |
.willOnce(invoke(setCurrentPasswordParams)); |
374 |
// some other (outgoing) barring is enabled, status inquiery for that |
|
375 |
// should be done. |
|
376 |
item = m_barringpluginGroup->childAt(1); |
|
377 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
378 |
EXPECT(PSetCallBarringWrapper, barringStatus); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
379 |
EXPECT(PsUiNotes, cancelNote).times(0); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
380 |
EXPECT(PsUiNotes, showGlobalNote).times(0); |
37 | 381 |
|
382 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
383 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
384 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
385 |
|
37 | 386 |
m_barringpluginGroup->enableBarringRequestCompleted( |
387 |
0, |
|
388 |
PSetCallBarringWrapper::BarringTypeAllBarrings, |
|
389 |
PSetCallBarringWrapper::BarringStatusActive, |
|
390 |
false); |
|
391 |
||
392 |
QVERIFY(verify()); |
|
393 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
394 |
PSetCallBarringWrapper::BarringErrorNone, |
|
395 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
396 |
} |
|
397 |
||
398 |
||
399 |
/*! |
|
400 |
UT_CpBarringPluginGroup::t_enableBarringRequestCompletedUnknownBarring |
|
401 |
*/ |
|
402 |
void UT_CpBarringPluginGroup::t_enableBarringRequestCompletedUnknownBarring() |
|
403 |
{ |
|
404 |
// something very weird has happened and enable request completes for unknown |
|
405 |
// barring type. |
|
406 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(5); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
407 |
QModelIndex modelIndex = m_dataFormModel->indexFromItem(item); |
37 | 408 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
409 |
EXPECT(CpItemDataHelper, widgetFromModelIndex) |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
410 |
.with(modelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
411 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 412 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
413 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
414 |
EXPECT(PsUiNotes, showNotificationDialog); |
37 | 415 |
// completion of unknown barring type should not lead to updating |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
416 |
EXPECT(PSetCallBarringWrapper, barringStatus).times(0); |
37 | 417 |
emit simulateCheckStateChange(Qt::Checked); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
418 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
419 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
420 |
|
37 | 421 |
m_barringpluginGroup->enableBarringRequestCompleted( |
422 |
0, |
|
423 |
PSetCallBarringWrapper::BarringTypeAllBarrings, |
|
424 |
PSetCallBarringWrapper::BarringStatusActive, |
|
425 |
false); |
|
426 |
||
427 |
QVERIFY(verify()); |
|
428 |
} |
|
429 |
||
430 |
||
431 |
/*! |
|
432 |
UT_CpBarringPluginGroup::t_enableBAOCRequestCompletedStatusUpdate |
|
433 |
*/ |
|
434 |
void UT_CpBarringPluginGroup::t_enableBAOCRequestCompletedStatusUpdate() |
|
435 |
{ |
|
436 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
437 |
for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { |
|
438 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
439 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
440 |
} |
|
441 |
||
442 |
QList<unsigned char> basicServiceGroupIds; |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
443 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
444 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 445 |
.willOnce(invoke(setCurrentPasswordParams)); |
446 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
447 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
448 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
449 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
450 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 451 |
ServiceGroupVoice, PSetCallBarringWrapper::BarringTypeOutgoingInternational); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
452 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 453 |
ServiceGroupVoice, |
454 |
PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); |
|
455 |
m_barringpluginGroup->enableBarringRequestCompleted( |
|
456 |
0, |
|
457 |
PSetCallBarringWrapper::BarringTypeAllOutgoing, |
|
458 |
PSetCallBarringWrapper::BarringStatusActive, |
|
459 |
false); |
|
460 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
461 |
PSetCallBarringWrapper::BarringErrorNone, |
|
462 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
463 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
464 |
PSetCallBarringWrapper::BarringErrorNone, |
|
465 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
466 |
QVERIFY(verify()); |
|
467 |
} |
|
468 |
||
469 |
||
470 |
/*! |
|
471 |
UT_CpBarringPluginGroup::t_enableBOICRequestCompletedStatusUpdate |
|
472 |
*/ |
|
473 |
void UT_CpBarringPluginGroup::t_enableBOICRequestCompletedStatusUpdate() |
|
474 |
{ |
|
475 |
QModelIndex modelIndex; |
|
476 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
477 |
for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { |
|
478 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
479 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
480 |
if (childIndex == 1) { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
481 |
modelIndex = m_dataFormModel->indexFromItem(item); |
37 | 482 |
} |
483 |
} |
|
484 |
||
485 |
QList<unsigned char> basicServiceGroupIds; |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
486 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).with(modelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
487 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 488 |
.willOnce(invoke(setCurrentPasswordParams)); |
489 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
490 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
491 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
492 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
493 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 494 |
ServiceGroupVoice, |
495 |
PSetCallBarringWrapper::BarringTypeAllOutgoing); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
496 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 497 |
ServiceGroupVoice, |
498 |
PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); |
|
499 |
m_barringpluginGroup->enableBarringRequestCompleted( |
|
500 |
0, |
|
501 |
PSetCallBarringWrapper::BarringTypeOutgoingInternational, |
|
502 |
PSetCallBarringWrapper::BarringStatusActive, |
|
503 |
false); |
|
504 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
505 |
PSetCallBarringWrapper::BarringErrorNone, |
|
506 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
507 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
508 |
PSetCallBarringWrapper::BarringErrorNone, |
|
509 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
510 |
QVERIFY(verify()); |
|
511 |
} |
|
512 |
||
513 |
||
514 |
/*! |
|
515 |
UT_CpBarringPluginGroup::t_enableBOICexHCRequestCompletedStatusUpdate |
|
516 |
*/ |
|
517 |
void UT_CpBarringPluginGroup::t_enableBOICexHCRequestCompletedStatusUpdate() |
|
518 |
{ |
|
519 |
QModelIndex modelIndex; |
|
520 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
521 |
for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { |
|
522 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
523 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
524 |
if (childIndex == 2) { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
525 |
modelIndex = m_dataFormModel->indexFromItem(item); |
37 | 526 |
} |
527 |
} |
|
528 |
||
529 |
QList<unsigned char> basicServiceGroupIds; |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
530 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).with(modelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
531 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 532 |
.willOnce(invoke(setCurrentPasswordParams)); |
533 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
534 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
535 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
536 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
537 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 538 |
ServiceGroupVoice, |
539 |
PSetCallBarringWrapper::BarringTypeAllOutgoing); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
540 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 541 |
ServiceGroupVoice, |
542 |
PSetCallBarringWrapper::BarringTypeOutgoingInternational); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
543 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 544 |
ServiceGroupVoice, |
545 |
PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry); |
|
546 |
m_barringpluginGroup->enableBarringRequestCompleted( |
|
547 |
0, |
|
548 |
PSetCallBarringWrapper::BarringTypeOutgoingInternationalExceptToHomeCountry, |
|
549 |
PSetCallBarringWrapper::BarringStatusActive, |
|
550 |
false); |
|
551 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
552 |
PSetCallBarringWrapper::BarringErrorNone, |
|
553 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
554 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
555 |
PSetCallBarringWrapper::BarringErrorNone, |
|
556 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
557 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
558 |
PSetCallBarringWrapper::BarringErrorNone, |
|
559 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
560 |
QVERIFY(verify()); |
|
561 |
} |
|
562 |
||
563 |
||
564 |
/*! |
|
565 |
UT_CpBarringPluginGroup::t_enableBAICRequestCompletedStatusUpdate |
|
566 |
*/ |
|
567 |
void UT_CpBarringPluginGroup::t_enableBAICRequestCompletedStatusUpdate() |
|
568 |
{ |
|
569 |
QModelIndex modelIndex; |
|
570 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
571 |
for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { |
|
572 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
573 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
574 |
if (childIndex == 3) { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
575 |
modelIndex = m_dataFormModel->indexFromItem(item); |
37 | 576 |
} |
577 |
} |
|
578 |
||
579 |
QList<unsigned char> basicServiceGroupIds; |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
580 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).with(modelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
581 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 582 |
.willOnce(invoke(setCurrentPasswordParams)); |
583 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
584 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
585 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
586 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
587 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 588 |
ServiceGroupVoice, |
589 |
PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming); |
|
590 |
m_barringpluginGroup->enableBarringRequestCompleted( |
|
591 |
0, |
|
592 |
PSetCallBarringWrapper::BarringTypeAllIncoming, |
|
593 |
PSetCallBarringWrapper::BarringStatusActive, |
|
594 |
false); |
|
595 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
596 |
PSetCallBarringWrapper::BarringErrorNone, |
|
597 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
598 |
QVERIFY(verify()); |
|
599 |
} |
|
600 |
||
601 |
||
602 |
/*! |
|
603 |
UT_CpBarringPluginGroup::t_enableBICRoamRequestCompletedStatusUpdate |
|
604 |
*/ |
|
605 |
void UT_CpBarringPluginGroup::t_enableBICRoamRequestCompletedStatusUpdate() |
|
606 |
{ |
|
607 |
QModelIndex modelIndex; |
|
608 |
int numOfChilds = m_barringpluginGroup->childCount(); |
|
609 |
for (int childIndex = 0; childIndex < numOfChilds - 1; childIndex++) { |
|
610 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(childIndex); |
|
611 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
|
612 |
if (childIndex == 4) { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
613 |
modelIndex = m_dataFormModel->indexFromItem(item); |
37 | 614 |
} |
615 |
} |
|
616 |
||
617 |
QList<unsigned char> basicServiceGroupIds; |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
618 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).with(modelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
619 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 620 |
.willOnce(invoke(setCurrentPasswordParams)); |
621 |
emit simulateCheckStateChange(Qt::Checked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
622 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
623 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
624 |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
625 |
EXPECT(PSetCallBarringWrapper, barringStatus).with( |
37 | 626 |
ServiceGroupVoice, |
627 |
PSetCallBarringWrapper::BarringTypeAllIncoming); |
|
628 |
m_barringpluginGroup->enableBarringRequestCompleted( |
|
629 |
0, |
|
630 |
PSetCallBarringWrapper::BarringTypeIncomingWhenRoaming, |
|
631 |
PSetCallBarringWrapper::BarringStatusActive, |
|
632 |
false); |
|
633 |
m_barringpluginGroup->barringStatusRequestCompleted( |
|
634 |
PSetCallBarringWrapper::BarringErrorNone, |
|
635 |
basicServiceGroupIds, PSetCallBarringWrapper::BarringStatusActive); |
|
636 |
QVERIFY(verify()); |
|
637 |
} |
|
638 |
||
639 |
||
640 |
/*! |
|
641 |
UT_CpBarringPluginGroup::t_disableBarringRequestCompleted |
|
642 |
*/ |
|
643 |
void UT_CpBarringPluginGroup::t_disableBarringRequestCompleted() |
|
644 |
{ |
|
645 |
// request completed succesfully -case |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
646 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this).times(1); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
647 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 648 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
649 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
650 |
EXPECT(PsUiNotes, showNotificationDialog); |
37 | 651 |
emit simulateCheckStateChange(Qt::Unchecked); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
652 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
653 |
KCurrentPassword, true); |
37 | 654 |
|
655 |
m_barringpluginGroup->disableBarringRequestCompleted( |
|
656 |
0, |
|
657 |
PSetCallBarringWrapper::BarringTypeAllBarrings, |
|
658 |
PSetCallBarringWrapper::BarringStatusActive, |
|
659 |
false); |
|
660 |
||
661 |
QVERIFY(verify()); |
|
662 |
||
663 |
// request completed with an error -case |
|
664 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); |
|
665 |
item->setContentWidgetData("checkState", QVariant(Qt::Unchecked)); |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
666 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
667 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 668 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
669 |
EXPECT(CpItemDataHelper, removeConnection); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
670 |
EXPECT(CpItemDataHelper, addConnection); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
671 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
672 |
EXPECT(PsUiNotes, showGlobalErrorNote); |
37 | 673 |
|
674 |
emit simulateCheckStateChange(Qt::Unchecked); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
675 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
676 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
677 |
|
37 | 678 |
m_barringpluginGroup->disableBarringRequestCompleted( |
679 |
-1, |
|
680 |
PSetCallBarringWrapper::BarringTypeAllBarrings, |
|
681 |
PSetCallBarringWrapper::BarringStatusActive, |
|
682 |
false); |
|
683 |
||
684 |
QVERIFY(verify()); |
|
685 |
} |
|
686 |
||
687 |
||
688 |
/*! |
|
689 |
UT_CpBarringPluginGroup::t_barringPasswordChangeRequestCompleted |
|
690 |
*/ |
|
691 |
void UT_CpBarringPluginGroup::t_barringPasswordChangeRequestCompleted() |
|
692 |
{ |
|
693 |
// request completed with no error |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
694 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
695 |
EXPECT(PsUiNotes, showNotificationDialog); |
37 | 696 |
|
697 |
m_barringpluginGroup->barringPasswordChangeRequestCompleted(0); |
|
698 |
||
699 |
QVERIFY(verify()); |
|
700 |
||
701 |
// request completed with an error |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
702 |
EXPECT(PsUiNotes, cancelNote); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
703 |
EXPECT(PsUiNotes, showGlobalErrorNote); |
37 | 704 |
|
705 |
m_barringpluginGroup->barringPasswordChangeRequestCompleted(-1); |
|
706 |
||
707 |
QVERIFY(verify()); |
|
708 |
} |
|
709 |
||
710 |
||
711 |
/*! |
|
712 |
UT_CpBarringPluginGroup::t_changeBarringStateRequested |
|
713 |
*/ |
|
714 |
void UT_CpBarringPluginGroup::t_changeBarringStateRequested() |
|
715 |
{ |
|
716 |
// barring enable request case |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
717 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
718 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 719 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
720 |
EXPECT(PSetCallBarringWrapper, enableBarring) |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
721 |
.with(EAllTeleAndBearer, ServiceGroupVoice, |
37 | 722 |
PSetCallBarringWrapper::BarringTypeAllOutgoing, KCurrentPassword); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
723 |
EXPECT(PsUiNotes, showGlobalProgressNote); |
37 | 724 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
725 |
HbDataFormModelItem *item = m_barringpluginGroup->childAt(0); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
726 |
item->setContentWidgetData("checkState", QVariant(Qt::Checked)); |
37 | 727 |
emit simulateCheckStateChange(Qt::Checked); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
728 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
729 |
KCurrentPassword, true); |
37 | 730 |
|
731 |
QVERIFY(verify()); |
|
732 |
||
733 |
// barring disable request case |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
734 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
735 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 736 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
737 |
EXPECT(PSetCallBarringWrapper, disableBarring) |
77
2be0b271d017
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
738 |
.with(EAllTeleAndBearer, ServiceGroupVoice, |
37 | 739 |
PSetCallBarringWrapper::BarringTypeAllOutgoing, KCurrentPassword); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
740 |
EXPECT(PsUiNotes, showGlobalProgressNote); |
37 | 741 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
742 |
item = m_barringpluginGroup->childAt(0); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
743 |
item->setContentWidgetData("checkState", QVariant(Qt::Unchecked)); |
37 | 744 |
emit simulateCheckStateChange(Qt::Unchecked); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
745 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
746 |
KCurrentPassword, true); |
37 | 747 |
|
748 |
QVERIFY(verify()); |
|
749 |
||
750 |
// cancel pressed while querying barring password |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
751 |
EXPECT(CpItemDataHelper, widgetFromModelIndex).returns(this); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
752 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 753 |
.willOnce(invoke(setPasswordParamsCancel)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
754 |
EXPECT(CpItemDataHelper, removeConnection); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
755 |
EXPECT(CpItemDataHelper, addConnection); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
756 |
EXPECT(PSetCallBarringWrapper, disableBarring).times(0); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
757 |
EXPECT(PsUiNotes, showGlobalProgressNote).times(0); |
37 | 758 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
759 |
item = m_barringpluginGroup->childAt(0); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
760 |
item->setContentWidgetData("checkState", QVariant(Qt::Unchecked)); |
37 | 761 |
emit simulateCheckStateChange(Qt::Unchecked); |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
762 |
m_barringpluginGroup->completeBarringStateChangeRequestHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
763 |
"", false); |
37 | 764 |
|
765 |
QVERIFY(verify()); |
|
766 |
||
767 |
// barring item not found case |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
768 |
EXPECT(PSetCallBarringWrapper, enableBarring).times(0); |
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
769 |
EXPECT(PsUiNotes, showGlobalProgressNote).times(0); |
37 | 770 |
|
771 |
emit simulateCheckStateChange(Qt::Checked); |
|
772 |
||
773 |
QVERIFY(verify()); |
|
774 |
} |
|
775 |
||
776 |
||
777 |
/*! |
|
778 |
UT_CpBarringPluginGroup::t_changeBarringPasswordRequested |
|
779 |
*/ |
|
780 |
void UT_CpBarringPluginGroup::t_changeBarringPasswordRequested() |
|
781 |
{ |
|
782 |
connect( |
|
783 |
this, SIGNAL(simulateEditPasswordButtonClicked(bool)), |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
784 |
m_barringpluginGroup, SLOT(changeBarringPasswordRequested())); |
37 | 785 |
|
786 |
// cancel from current password query |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
787 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 788 |
.willOnce(invoke(setPasswordParamsCancel)); |
789 |
emit simulateEditPasswordButtonClicked(false); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
790 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling("", false); |
37 | 791 |
QVERIFY(verify()); |
792 |
||
793 |
// cancel from new password query |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
794 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 795 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
796 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 797 |
.willOnce(invoke(setPasswordParamsCancel)); |
798 |
emit simulateEditPasswordButtonClicked(false); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
799 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
800 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
801 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
802 |
"", false); |
37 | 803 |
QVERIFY(verify()); |
804 |
||
805 |
// cancel from verify new password query |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
806 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 807 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
808 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 809 |
.willOnce(invoke(setNewAndVerifiedPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
810 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 811 |
.willOnce(invoke(setPasswordParamsCancel)); |
812 |
emit simulateEditPasswordButtonClicked(false); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
813 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
814 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
815 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
816 |
KNewAndVerifiedPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
817 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
818 |
"", false); |
37 | 819 |
QVERIFY(verify()); |
820 |
||
821 |
// all data successfully queried |
|
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
822 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 823 |
.willOnce(invoke(setCurrentPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
824 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 825 |
.willOnce(invoke(setNewAndVerifiedPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
826 |
EXPECT(PsUiNotes, showPasswordQueryDialog) |
37 | 827 |
.willOnce(invoke(setNewAndVerifiedPasswordParams)); |
64
6aaf0276100e
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
828 |
EXPECT(PSetCallBarringWrapper, changeBarringPassword) |
37 | 829 |
.with(KCurrentPassword, KNewAndVerifiedPassword, KNewAndVerifiedPassword); |
830 |
emit simulateEditPasswordButtonClicked(false); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
831 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
832 |
KCurrentPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
833 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
834 |
KNewAndVerifiedPassword, true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
835 |
m_barringpluginGroup->changeBarringPasswordPhasesHandling( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
836 |
KNewAndVerifiedPassword, true); |
37 | 837 |
QVERIFY(verify()); |
838 |
} |
|
839 |
||
840 |
QTEST_MAIN_S60(UT_CpBarringPluginGroup) |