24
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file The TEFUnit test suite for PhoneControl in the Common TSY.
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "cctsyphonefu.h"
|
|
23 |
#include <etel.h>
|
|
24 |
#include <etelmm.h>
|
|
25 |
#include <et_clsvr.h>
|
|
26 |
#include <ctsy/mmtsy_names.h>
|
|
27 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
28 |
#include <test/tmockltsydata.h>
|
|
29 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
30 |
#include <ctsy/serviceapi/cmmutility.h>
|
|
31 |
#include <ctsy/ltsy/mltsydispatchcallcontrolinterface.h>
|
|
32 |
#include <ctsy/ltsy/mltsydispatchsiminterface.h>
|
|
33 |
#include <ctsy/ltsy/mltsydispatchphoneinterface.h>
|
|
34 |
#include <ctsy/ltsy/mltsydispatchpacketservicesinterface.h>
|
|
35 |
#include <etelmmerr.h>
|
|
36 |
#include "listretrieverao.h"
|
|
37 |
#include "mockltsyindicatorids.h"
|
|
38 |
#include <ctsy/rmmcustomapi.h>
|
|
39 |
#include <ctsy/ltsy/mltsydispatchpacketservicesinterface.h>
|
|
40 |
|
|
41 |
#include "cctsyactiveretriever.h"
|
|
42 |
|
|
43 |
CTestSuite* CCTsyPhoneFU::CreateSuiteL(const TDesC& aName)
|
|
44 |
{
|
|
45 |
SUB_SUITE;
|
|
46 |
|
|
47 |
//add use-case tests
|
|
48 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUseCase0001L);
|
|
49 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUseCase0002L);
|
|
50 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUseCase0003L);
|
|
51 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUseCase0004L);
|
|
52 |
|
|
53 |
//add other unit tests
|
|
54 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0001L);
|
|
55 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0002L);
|
|
56 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0003L);
|
|
57 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0004L);
|
|
58 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0005L);
|
|
59 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0006L);
|
|
60 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0007L);
|
|
61 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0008L);
|
|
62 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0009L);
|
|
63 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0010L);
|
|
64 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0011L);
|
|
65 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0012L);
|
|
66 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0013L);
|
|
67 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0014L);
|
|
68 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0015L);
|
|
69 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0016L);
|
|
70 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0017L);
|
|
71 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0018L);
|
|
72 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0019L);
|
|
73 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0020L);
|
|
74 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0021L);
|
|
75 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0022L);
|
|
76 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0023L);
|
|
77 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0024L);
|
|
78 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0025L);
|
|
79 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0026L);
|
|
80 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0027L);
|
|
81 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0028L);
|
|
82 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0029L);
|
|
83 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0030L);
|
|
84 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0031L);
|
|
85 |
ADD_TEST_STEP_ISO_CPP(CCTsyPhoneFU, TestUnit0032L);
|
|
86 |
|
|
87 |
END_SUITE;
|
|
88 |
}
|
|
89 |
|
|
90 |
//
|
|
91 |
// Use-case tests
|
|
92 |
//
|
|
93 |
|
|
94 |
/**
|
|
95 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UC0001
|
|
96 |
@SYMComponent telephony_ctsy
|
|
97 |
@SYMTestCaseDesc Use-case: boot phone.
|
|
98 |
@SYMTestPriority High
|
|
99 |
@SYMTestActions Invokes APIs to go through booting phone.
|
|
100 |
@SYMTestExpectedResults Pass
|
|
101 |
@SYMTestType CT
|
|
102 |
*/
|
|
103 |
void CCTsyPhoneFU::TestUseCase0001L()
|
|
104 |
{
|
|
105 |
OpenEtelServerL(EUseExtendedError);
|
|
106 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
107 |
//simple boot phone use-case is actually incorporated as the OpenPhoneL() function.
|
|
108 |
OpenPhoneL();
|
|
109 |
AssertMockLtsyStatusL();
|
|
110 |
|
|
111 |
CleanupStack::PopAndDestroy(this);
|
|
112 |
}
|
|
113 |
|
|
114 |
/**
|
|
115 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UC0002
|
|
116 |
@SYMComponent telephony_ctsy
|
|
117 |
@SYMTestCaseDesc Use-case: manual network detection and selection
|
|
118 |
@SYMTestPriority High
|
|
119 |
@SYMTestActions Invokes APIs to go through detecting and selecting a network to register onto.
|
|
120 |
@SYMTestExpectedResults Pass
|
|
121 |
@SYMTestType CT
|
|
122 |
*/
|
|
123 |
void CCTsyPhoneFU::TestUseCase0002L()
|
|
124 |
{
|
|
125 |
OpenEtelServerL(EUseExtendedError);
|
|
126 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
127 |
OpenPhoneL();
|
|
128 |
|
|
129 |
TRequestStatus status;
|
|
130 |
|
|
131 |
RBuf8 data;
|
|
132 |
CleanupClosePushL(data);
|
|
133 |
|
|
134 |
|
|
135 |
/********************************Set network selection to manual***********************************/
|
|
136 |
|
|
137 |
//set up the notified data
|
|
138 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 notifiedPhoneNetworkSelection;
|
|
139 |
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg notifiedPckg(notifiedPhoneNetworkSelection);
|
|
140 |
|
|
141 |
//set up the set data
|
|
142 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 phoneNetworkSelection;
|
|
143 |
phoneNetworkSelection.iMethod = RMobilePhone::ENetworkSelectionManual;
|
|
144 |
phoneNetworkSelection.iBandClass = RMobilePhone::ENetworkBandClassAOnly;
|
|
145 |
phoneNetworkSelection.iOperationMode = RMobilePhone::ENetworkOperationAnalogPreferred;
|
|
146 |
|
|
147 |
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg setPckg(phoneNetworkSelection);
|
|
148 |
|
|
149 |
//set up the Mock LTSY data
|
|
150 |
TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkSelectionV1> phoneNetworkSelectionExpData(phoneNetworkSelection);
|
|
151 |
phoneNetworkSelectionExpData.SerialiseL(data);
|
|
152 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetNetworkSelectionSetting::KLtsyDispatchPhoneSetNetworkSelectionSettingApiId, data, KErrNone);
|
|
153 |
data.Close();
|
|
154 |
|
|
155 |
TMockLtsyData1<RMobilePhone::TMobilePhoneSelectionMethod> phoneNetworkSelectionCompData(phoneNetworkSelection.iMethod);
|
|
156 |
phoneNetworkSelectionCompData.SerialiseL(data);
|
|
157 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetNetworkSelectionSetting::KLtsyDispatchPhoneSetNetworkSelectionSettingApiId, KErrNone, data);
|
|
158 |
data.Close();
|
|
159 |
|
|
160 |
//ETel calls
|
|
161 |
TRequestStatus notifyStatus;
|
|
162 |
iPhone.NotifyNetworkSelectionSettingChange(notifyStatus,notifiedPckg);
|
|
163 |
iPhone.SetNetworkSelectionSetting(status,setPckg);
|
|
164 |
|
|
165 |
User::WaitForRequest(status);
|
|
166 |
User::WaitForRequest(notifyStatus);
|
|
167 |
ASSERT_EQUALS(status.Int(),KErrNone);
|
|
168 |
ASSERT_EQUALS(notifyStatus.Int(),KErrNone);
|
|
169 |
|
|
170 |
//CTSY sets iBandClass and iOperationMode to defults values
|
|
171 |
ASSERT_EQUALS(phoneNetworkSelection.iMethod,notifiedPhoneNetworkSelection.iMethod);
|
|
172 |
ASSERT_EQUALS(RMobilePhone::ENetworkBandClassUnknown,notifiedPhoneNetworkSelection.iBandClass);
|
|
173 |
ASSERT_EQUALS(RMobilePhone::ENetworkOperationUnknown,notifiedPhoneNetworkSelection.iOperationMode);
|
|
174 |
AssertMockLtsyStatusL();
|
|
175 |
|
|
176 |
/*********************************************************************************************/
|
|
177 |
|
|
178 |
/********************************Get Detected Network List************************************/
|
|
179 |
|
|
180 |
CGetDetectedNetworksAO* detAO = CGetDetectedNetworksAO::NewLC(iPhone,iMockLTSY);
|
|
181 |
|
|
182 |
// --- prepare data for CompleteL ---
|
|
183 |
CMobilePhoneNetworkListV2* networkListV2 = CMobilePhoneNetworkListV2::NewL();
|
|
184 |
CleanupStack::PushL(networkListV2);
|
|
185 |
|
|
186 |
RMobilePhone::TMobilePhoneNetworkInfoV2 infoV2;
|
|
187 |
|
|
188 |
infoV2.iAccess = RMobilePhone::ENetworkAccessUnknown;
|
|
189 |
infoV2.iMode = RMobilePhone::ENetworkModeUnknown;
|
|
190 |
infoV2.iStatus = RMobilePhone::ENetworkStatusUnknown;
|
|
191 |
infoV2.iBandInfo = RMobilePhone::EBandUnknown;
|
|
192 |
|
|
193 |
_LIT(KCountryCode, "1234");
|
|
194 |
infoV2.iCountryCode = KCountryCode;
|
|
195 |
|
|
196 |
_LIT(KAnalogSID, "12345678");
|
|
197 |
infoV2.iAnalogSID = KAnalogSID;
|
|
198 |
|
|
199 |
_LIT(KNetworkId, "12345678");
|
|
200 |
infoV2.iNetworkId = KNetworkId;
|
|
201 |
|
|
202 |
_LIT(KDisplayTag, "1234567890");
|
|
203 |
infoV2.iDisplayTag = KDisplayTag;
|
|
204 |
|
|
205 |
_LIT(KShortName, "1234567890");
|
|
206 |
infoV2.iShortName = KShortName;
|
|
207 |
|
|
208 |
_LIT(KLongName, "12345678901234567890");
|
|
209 |
infoV2.iLongName = KLongName;
|
|
210 |
|
|
211 |
networkListV2->AddEntryL(infoV2);
|
|
212 |
|
|
213 |
//set up Mock LTSY expect and completes for a retrieve (not cancelled)
|
|
214 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetDetectedNetworks::KLtsyDispatchPhoneGetDetectedNetworksApiId, KErrNone);
|
|
215 |
|
|
216 |
//execute the retrieve
|
|
217 |
detAO->TestRetrieveL(*networkListV2);
|
|
218 |
|
|
219 |
//check what has been returned
|
|
220 |
ASSERT_EQUALS(detAO->CheckResultsL(),KErrNone);
|
|
221 |
|
|
222 |
AssertMockLtsyStatusL();
|
|
223 |
|
|
224 |
/*********************************************************************************************/
|
|
225 |
|
|
226 |
/********************************Manual Network Selection************************************/
|
|
227 |
|
|
228 |
//setup ETel required data
|
|
229 |
RMobilePhone::TMobilePhoneNetworkManualSelection selection;
|
|
230 |
selection.iCountry = KCountryCode;
|
|
231 |
selection.iNetwork = KNetworkId;
|
|
232 |
|
|
233 |
//setup MockTSY data
|
|
234 |
TBool isManual = ETrue;
|
|
235 |
TMockLtsyData2<TBool,RMobilePhone::TMobilePhoneNetworkManualSelection> selectData(isManual,selection);
|
|
236 |
selectData.SerialiseL(data);
|
|
237 |
|
|
238 |
//set up Mock LTSY expect and completes for a retrieve (not cancelled)
|
|
239 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSelectNetwork::KLtsyDispatchPhoneSelectNetworkApiId, data, KErrNone);
|
|
240 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSelectNetwork::KLtsyDispatchPhoneSelectNetworkApiId, KErrNone);
|
|
241 |
data.Close();
|
|
242 |
|
|
243 |
//ETel calls
|
|
244 |
iPhone.SelectNetwork(status,isManual,selection);
|
|
245 |
User::WaitForRequest(status);
|
|
246 |
|
|
247 |
AssertMockLtsyStatusL();
|
|
248 |
/*********************************************************************************************/
|
|
249 |
|
|
250 |
CleanupStack::PopAndDestroy(networkListV2);
|
|
251 |
CleanupStack::PopAndDestroy(detAO);
|
|
252 |
CleanupStack::PopAndDestroy(&data);
|
|
253 |
CleanupStack::PopAndDestroy(this);
|
|
254 |
}
|
|
255 |
|
|
256 |
/**
|
|
257 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UC0003
|
|
258 |
@SYMComponent telephony_ctsy
|
|
259 |
@SYMTestCaseDesc Use-case: Network notifications at boot-up.
|
|
260 |
@SYMTestPriority High
|
|
261 |
@SYMTestActions Invokes RMobilePhone::NotifyCurrentNetworkChange, RMobilePhone::NotifyModeChange, RMobilePhone::NotifyNITZInfoChange, RMobilePhone::NotifySignalStrengthChange
|
|
262 |
@SYMTestExpectedResults Pass
|
|
263 |
@SYMTestType CT
|
|
264 |
*/
|
|
265 |
void CCTsyPhoneFU::TestUseCase0003L()
|
|
266 |
{
|
|
267 |
OpenEtelServerL(EUseExtendedError);
|
|
268 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
269 |
OpenPhoneL();
|
|
270 |
|
|
271 |
RBuf8 data;
|
|
272 |
CleanupClosePushL(data);
|
|
273 |
|
|
274 |
TRequestStatus requestStatus1, requestStatus2, requestStatus3, requestStatus4, requestStatus5;
|
|
275 |
TRequestStatus mockLtsyStatus;
|
|
276 |
|
|
277 |
//
|
|
278 |
// Post all the notifiers.
|
|
279 |
//
|
|
280 |
|
|
281 |
// RMobilePhone::NotifyCurrentNetworkChange
|
|
282 |
RMobilePhone::TMobilePhoneNetworkInfoV5 networkInfoRet;
|
|
283 |
TPckg<RMobilePhone::TMobilePhoneNetworkInfoV5> networkInfoRetPckg(networkInfoRet);
|
|
284 |
RMobilePhone::TMobilePhoneLocationAreaV1 locationAreaRet;
|
|
285 |
iPhone.NotifyCurrentNetworkChange(requestStatus1, networkInfoRetPckg, locationAreaRet);
|
|
286 |
|
|
287 |
// RMobilePhone::NotifyNetworkModeChange
|
|
288 |
RMobilePhone::TMobilePhoneNetworkMode networkModeRet;
|
|
289 |
iPhone.NotifyModeChange(requestStatus2, networkModeRet);
|
|
290 |
|
|
291 |
// RMobilePhone::NotifyNitzInfoChange
|
|
292 |
RMobilePhone::TMobilePhoneNITZ nitzRet;
|
|
293 |
iPhone.NotifyNITZInfoChange(requestStatus3, nitzRet);
|
|
294 |
|
|
295 |
// RMobilePhone::NotifySignalStrengthChange
|
|
296 |
TInt32 signalStrength(0);
|
|
297 |
TInt8 bar(0);
|
|
298 |
iPhone.NotifySignalStrengthChange(requestStatus4, signalStrength, bar);
|
|
299 |
|
|
300 |
// RMobilePhone::NotifyBatteryInfoChange
|
|
301 |
RMobilePhone::TMobilePhoneBatteryInfoV1 battInfoRet;
|
|
302 |
iPhone.NotifyBatteryInfoChange(requestStatus5, battInfoRet);
|
|
303 |
|
|
304 |
/*
|
|
305 |
* RMobilePhone::NotifyCurrentNetworkChange
|
|
306 |
*/
|
|
307 |
|
|
308 |
// Prepare the NotifyCurrentNetworkChange data for CompleteL
|
|
309 |
RMobilePhone::TMobilePhoneNetworkInfoV5 networkInfoComplete;
|
|
310 |
|
|
311 |
RMobilePhone::TMobilePhoneNetworkCountryCode countryCode = _L("567");
|
|
312 |
RMobilePhone::TMobilePhoneNetworkIdentity cdmaSID = _L("890");
|
|
313 |
RMobilePhone::TMobilePhoneNetworkIdentity analogSID = _L("123");
|
|
314 |
RMobilePhone::TMobilePhoneNetworkIdentity networkId = _L("56700");
|
|
315 |
RMobilePhone::TMobilePhoneNetworkDisplayTag displayTag = _L("symbian2");
|
|
316 |
RMobilePhone::TMobilePhoneNetworkShortName shortName = _L("symbian2");
|
|
317 |
RMobilePhone::TMobilePhoneNetworkLongName longName = _L("symbian2 mobile");
|
|
318 |
|
|
319 |
// V5
|
|
320 |
networkInfoComplete.iEgprsAvailableIndicator = ETrue;
|
|
321 |
networkInfoComplete.iHsdpaAvailableIndicator = EFalse;
|
|
322 |
// V2
|
|
323 |
networkInfoComplete.iAccess = RMobilePhone::ENetworkAccessGsm;
|
|
324 |
// V1
|
|
325 |
networkInfoComplete.iMode = RMobilePhone::ENetworkModeCdma2000 ;
|
|
326 |
networkInfoComplete.iStatus = RMobilePhone::ENetworkStatusAvailable;
|
|
327 |
networkInfoComplete.iBandInfo = RMobilePhone::E1900BandA ;
|
|
328 |
networkInfoComplete.iCountryCode = countryCode;
|
|
329 |
networkInfoComplete.iCdmaSID = cdmaSID ;
|
|
330 |
networkInfoComplete.iAnalogSID = analogSID ;
|
|
331 |
networkInfoComplete.iNetworkId = networkId ;
|
|
332 |
networkInfoComplete.iDisplayTag = displayTag ;
|
|
333 |
networkInfoComplete.iShortName = shortName ;
|
|
334 |
networkInfoComplete.iLongName = longName ;
|
|
335 |
|
|
336 |
RMobilePhone::TMobilePhoneLocationAreaV1 locationAreaComplete;
|
|
337 |
locationAreaComplete.iAreaKnown = ETrue;
|
|
338 |
locationAreaComplete.iLocationAreaCode = KLocationAreaCode;
|
|
339 |
locationAreaComplete.iCellId = KCellId;
|
|
340 |
|
|
341 |
TMockLtsyData2<RMobilePhone::TMobilePhoneNetworkInfoV5,
|
|
342 |
RMobilePhone::TMobilePhoneLocationAreaV1> mockCNCData2(networkInfoComplete, locationAreaComplete);
|
|
343 |
|
|
344 |
// Send the CompleteL to MockLtsy
|
|
345 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
346 |
|
|
347 |
data.Close();
|
|
348 |
mockCNCData2.SerialiseL(data);
|
|
349 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCurrentNetworkChangeIndId, KErrNone, data);
|
|
350 |
User::WaitForRequest(mockLtsyStatus);
|
|
351 |
AssertMockLtsyStatusL();
|
|
352 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
353 |
|
|
354 |
// Check completion of api
|
|
355 |
User::WaitForRequest(requestStatus1);
|
|
356 |
AssertMockLtsyStatusL();
|
|
357 |
ASSERT_EQUALS(KErrNone, requestStatus1.Int());
|
|
358 |
|
|
359 |
// Check returned data
|
|
360 |
ASSERT_EQUALS(networkInfoRet.iMode, networkInfoComplete.iMode);
|
|
361 |
ASSERT_EQUALS(networkInfoRet.iStatus, networkInfoComplete.iStatus);
|
|
362 |
ASSERT_EQUALS(networkInfoRet.iBandInfo, networkInfoComplete.iBandInfo);
|
|
363 |
ASSERT_EQUALS(networkInfoRet.iCountryCode, networkInfoComplete.iCountryCode);
|
|
364 |
ASSERT_EQUALS(networkInfoRet.iCdmaSID, networkInfoComplete.iCdmaSID);
|
|
365 |
ASSERT_EQUALS(networkInfoRet.iAnalogSID, networkInfoComplete.iAnalogSID);
|
|
366 |
ASSERT_EQUALS(networkInfoRet.iNetworkId, networkInfoComplete.iNetworkId);
|
|
367 |
ASSERT_EQUALS(networkInfoComplete.iDisplayTag, networkInfoComplete.iDisplayTag);
|
|
368 |
ASSERT_EQUALS(networkInfoComplete.iShortName, networkInfoComplete.iShortName);
|
|
369 |
ASSERT_EQUALS(networkInfoComplete.iLongName, networkInfoComplete.iLongName);
|
|
370 |
|
|
371 |
ASSERT_EQUALS(locationAreaRet.iAreaKnown, locationAreaComplete.iAreaKnown);
|
|
372 |
ASSERT_EQUALS(locationAreaRet.iLocationAreaCode, locationAreaComplete.iLocationAreaCode);
|
|
373 |
ASSERT_EQUALS(locationAreaRet.iCellId, locationAreaComplete.iCellId);
|
|
374 |
|
|
375 |
/*
|
|
376 |
* RMobilePhone::NotifyNetworkModeChange
|
|
377 |
*/
|
|
378 |
|
|
379 |
// Prepare the NotifyNetworkModeChange data for CompleteL
|
|
380 |
RMobilePhone::TMobilePhoneNetworkMode networkModeComplete;
|
|
381 |
|
|
382 |
networkModeComplete = RMobilePhone::ENetworkModeCdma95;
|
|
383 |
|
|
384 |
TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkMode> mockNMCData1(networkModeComplete);
|
|
385 |
|
|
386 |
// Send the CompleteL to MockLtsy
|
|
387 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
388 |
|
|
389 |
data.Close();
|
|
390 |
mockNMCData1.SerialiseL(data);
|
|
391 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNetworkModeChangeIndId, KErrNone, data);
|
|
392 |
User::WaitForRequest(mockLtsyStatus);
|
|
393 |
AssertMockLtsyStatusL();
|
|
394 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
395 |
|
|
396 |
// Check completion of api
|
|
397 |
User::WaitForRequest(requestStatus2);
|
|
398 |
AssertMockLtsyStatusL();
|
|
399 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
400 |
|
|
401 |
// Check returned data
|
|
402 |
ASSERT_EQUALS(networkModeRet, networkModeComplete);
|
|
403 |
|
|
404 |
/*
|
|
405 |
* RMobilePhone::NotifyNitzInfoChange
|
|
406 |
*/
|
|
407 |
|
|
408 |
// Prepare the NotifyNetworkModeChange data for CompleteL
|
|
409 |
RMobilePhone::TMobilePhoneNITZ nitzComplete(2007, EOctober, 18, 16, 0, 0, 0);
|
|
410 |
|
|
411 |
RMobilePhone::TMobilePhoneNetworkShortName mobilePhoneNetworkShortName = _L("ShortName");
|
|
412 |
RMobilePhone::TMobilePhoneNetworkLongName mobilePhoneNetworkLongName = _L("MyLongName");
|
|
413 |
TInt32 nitzFieldsUsed = RMobilePhone::KCapsTimeAvailable |
|
|
414 |
RMobilePhone::KCapsTimezoneAvailable |
|
|
415 |
RMobilePhone::KCapsDSTAvailable |
|
|
416 |
RMobilePhone::KCapsShortNameAvailable |
|
|
417 |
RMobilePhone::KCapsLongNameAvailable;
|
|
418 |
|
|
419 |
TInt timeZone = 10;
|
|
420 |
TInt DST = 5;
|
|
421 |
|
|
422 |
nitzComplete.iShortNetworkId = mobilePhoneNetworkShortName;
|
|
423 |
nitzComplete.iLongNetworkId = mobilePhoneNetworkLongName;
|
|
424 |
nitzComplete.iNitzFieldsUsed = nitzFieldsUsed;
|
|
425 |
nitzComplete.iTimeZone = timeZone;
|
|
426 |
nitzComplete.iDST = DST;
|
|
427 |
|
|
428 |
TMockLtsyData1<RMobilePhone::TMobilePhoneNITZ> mockNitzData1(nitzComplete);
|
|
429 |
|
|
430 |
// Send the CompleteL to MockLtsy
|
|
431 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
432 |
|
|
433 |
data.Close();
|
|
434 |
mockNitzData1.SerialiseL(data);
|
|
435 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNitzInfoChangeIndId, KErrNone, data);
|
|
436 |
User::WaitForRequest(mockLtsyStatus);
|
|
437 |
AssertMockLtsyStatusL();
|
|
438 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
439 |
|
|
440 |
// Check completion of api
|
|
441 |
User::WaitForRequest(requestStatus3);
|
|
442 |
AssertMockLtsyStatusL();
|
|
443 |
ASSERT_EQUALS(KErrNone, requestStatus3.Int());
|
|
444 |
|
|
445 |
// Check returned data
|
|
446 |
ASSERT_EQUALS(nitzRet.iNitzFieldsUsed, nitzComplete.iNitzFieldsUsed);
|
|
447 |
ASSERT_EQUALS(nitzRet.iTimeZone, nitzComplete.iTimeZone);
|
|
448 |
ASSERT_EQUALS(nitzRet.iDST, nitzComplete.iDST);
|
|
449 |
// Note: CTSY will overwrite the iShortNetworkId and iLongNetworkId fields in the NITZ data
|
|
450 |
// if it all ready holds values for them from previous notifications (such as a NotifyCurrentNetworkChange).
|
|
451 |
// We therefore compare with values from a TMobilePhoneNetworkInfoV5 which was received earlier in the test.
|
|
452 |
ASSERT_EQUALS(nitzRet.iShortNetworkId, networkInfoComplete.iShortName);
|
|
453 |
ASSERT_EQUALS(nitzRet.iLongNetworkId, networkInfoComplete.iLongName);
|
|
454 |
|
|
455 |
/*
|
|
456 |
* RMobilePhone::NotifySignalStrengthChange
|
|
457 |
*/
|
|
458 |
|
|
459 |
// Prepare the NotifySignalStrengthChange data for CompleteL
|
|
460 |
TInt32 signalStrengthComplete(70);
|
|
461 |
TInt8 barComplete(3);
|
|
462 |
|
|
463 |
TMockLtsyData2<TInt32, TInt8> mockSigSthData2(signalStrengthComplete, barComplete);
|
|
464 |
|
|
465 |
// Send the CompleteL to MockLtsy
|
|
466 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
467 |
|
|
468 |
data.Close();
|
|
469 |
mockSigSthData2.SerialiseL(data);
|
|
470 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifySignalStrengthChangeIndId, KErrNone, data);
|
|
471 |
User::WaitForRequest(mockLtsyStatus);
|
|
472 |
AssertMockLtsyStatusL();
|
|
473 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
474 |
|
|
475 |
// Check completion of api
|
|
476 |
User::WaitForRequest(requestStatus4);
|
|
477 |
AssertMockLtsyStatusL();
|
|
478 |
ASSERT_EQUALS(KErrNone, requestStatus4.Int());
|
|
479 |
|
|
480 |
// Check returned data
|
|
481 |
ASSERT_EQUALS(signalStrength, signalStrengthComplete);
|
|
482 |
ASSERT_EQUALS(bar, barComplete);
|
|
483 |
|
|
484 |
/*
|
|
485 |
* RMobilePhone::NotifyBatteryInfoChange
|
|
486 |
*/
|
|
487 |
|
|
488 |
// Prepare the NotifyBatteryInfoChange data for CompleteL
|
|
489 |
RMobilePhone::TMobilePhoneBatteryInfoV1 battInfoComplete;
|
|
490 |
battInfoComplete.iStatus = RMobilePhone::EBatteryConnectedButExternallyPowered;
|
|
491 |
battInfoComplete.iChargeLevel = 99;
|
|
492 |
|
|
493 |
TMockLtsyData1<RMobilePhone::TMobilePhoneBatteryInfoV1> mockBattData1(battInfoComplete);
|
|
494 |
|
|
495 |
// Send the CompleteL to MockLtsy
|
|
496 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
497 |
|
|
498 |
data.Close();
|
|
499 |
mockBattData1.SerialiseL(data);
|
|
500 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyBatteryInfoChangeIndId, KErrNone, data);
|
|
501 |
User::WaitForRequest(mockLtsyStatus);
|
|
502 |
AssertMockLtsyStatusL();
|
|
503 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
504 |
|
|
505 |
// Check completion of api
|
|
506 |
User::WaitForRequest(requestStatus5);
|
|
507 |
AssertMockLtsyStatusL();
|
|
508 |
ASSERT_EQUALS(KErrNone, requestStatus5.Int());
|
|
509 |
|
|
510 |
// Check returned data
|
|
511 |
ASSERT_EQUALS(battInfoRet.iStatus, battInfoComplete.iStatus);
|
|
512 |
ASSERT_EQUALS(battInfoRet.iChargeLevel, battInfoComplete.iChargeLevel);
|
|
513 |
|
|
514 |
data.Close();
|
|
515 |
AssertMockLtsyStatusL();
|
|
516 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
517 |
}
|
|
518 |
|
|
519 |
/**
|
|
520 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UC0004
|
|
521 |
@SYMComponent telephony_ctsy
|
|
522 |
@SYMTestCaseDesc Use-case: Test for retrieval of network information without having to post notifiers.
|
|
523 |
@SYMTestPriority High
|
|
524 |
@SYMTestActions Invokes RMobilePhone::GetCurrentNetwork, RMobilePhone::GetNITZInfo, RMobilePhone::GetSignalStrength, RMobilePhone::GetCurrentMode
|
|
525 |
@SYMTestExpectedResults Pass
|
|
526 |
@SYMTestType CT
|
|
527 |
*/
|
|
528 |
void CCTsyPhoneFU::TestUseCase0004L()
|
|
529 |
{
|
|
530 |
OpenEtelServerL(EUseExtendedError);
|
|
531 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
532 |
OpenPhoneL();
|
|
533 |
|
|
534 |
RBuf8 data;
|
|
535 |
CleanupClosePushL(data);
|
|
536 |
|
|
537 |
TRequestStatus reqStatusGetCurrentNetwork;
|
|
538 |
TRequestStatus reqStatusGetSigStr;
|
|
539 |
TRequestStatus reqStatusGetBattInfo;
|
|
540 |
TInt ret;
|
|
541 |
|
|
542 |
//
|
|
543 |
// Invoke get api's
|
|
544 |
//
|
|
545 |
|
|
546 |
// RMobilePhone::GetCurrentNetwork
|
|
547 |
RMobilePhone::TMobilePhoneNetworkInfoV5 networkInfo;
|
|
548 |
RMobilePhone::TMobilePhoneNetworkInfoV5Pckg networkInfoPckg(networkInfo);
|
|
549 |
RMobilePhone::TMobilePhoneLocationAreaV1 locationArea;
|
|
550 |
iPhone.GetCurrentNetwork(reqStatusGetCurrentNetwork, networkInfoPckg, locationArea);
|
|
551 |
|
|
552 |
// RMobilePhone::GetNITZInfo
|
|
553 |
RMobilePhone::TMobilePhoneNITZ nitzRet;
|
|
554 |
ret = iPhone.GetNITZInfo(nitzRet);
|
|
555 |
ASSERT_EQUALS(ret, KErrNone);
|
|
556 |
|
|
557 |
// RMobilePhone::GetSignalStrength
|
|
558 |
TInt32 signalStrength(0);
|
|
559 |
TInt8 bar(0);
|
|
560 |
iPhone.GetSignalStrength(reqStatusGetSigStr, signalStrength, bar);
|
|
561 |
|
|
562 |
// RMobilePhone::GetCurrentMode
|
|
563 |
RMobilePhone::TMobilePhoneNetworkMode mode;
|
|
564 |
ret = iPhone.GetCurrentMode(mode);
|
|
565 |
ASSERT_EQUALS(ret, KErrNone);
|
|
566 |
|
|
567 |
// RMobilePhone::GetBatteryInfo
|
|
568 |
RMobilePhone::TMobilePhoneBatteryInfoV1 battInfo;
|
|
569 |
iPhone.GetBatteryInfo(reqStatusGetBattInfo, battInfo);
|
|
570 |
|
|
571 |
//
|
|
572 |
// Check returned values
|
|
573 |
//
|
|
574 |
|
|
575 |
// Check RMobilePhone::GetCurrentMode returned data against the data that was set up in CCtsyComponentTestBase::OpenPhoneL()
|
|
576 |
ASSERT_EQUALS(mode, KNetworkMode); // Note mode is given different value to that retrieved from GetCurrentNetwork for sake of the test.
|
|
577 |
|
|
578 |
// Check RMobilePhone::GetCurrentNetwork returned data against the data that was set up in CCtsyComponentTestBase::OpenPhoneL()
|
|
579 |
User::WaitForRequest(reqStatusGetCurrentNetwork);
|
|
580 |
ASSERT_EQUALS(reqStatusGetCurrentNetwork.Int(), KErrNone);
|
|
581 |
ASSERT_EQUALS(networkInfo.iEgprsAvailableIndicator, KEgprsAvailable);
|
|
582 |
ASSERT_EQUALS(networkInfo.iHsdpaAvailableIndicator, KHsdpaAvailable);
|
|
583 |
ASSERT_EQUALS(networkInfo.iAccess, KAccess);
|
|
584 |
ASSERT_EQUALS(networkInfo.iMode, KMode);
|
|
585 |
ASSERT_EQUALS(networkInfo.iStatus, KStatus);
|
|
586 |
ASSERT_EQUALS(networkInfo.iBandInfo, KBandInfo);
|
|
587 |
ASSERT_EQUALS(networkInfo.iCountryCode, KCountryCode);
|
|
588 |
ASSERT_EQUALS(networkInfo.iCdmaSID, KCdmaSID);
|
|
589 |
ASSERT_EQUALS(networkInfo.iAnalogSID, KAnalogSID);
|
|
590 |
ASSERT_EQUALS(networkInfo.iNetworkId, KNetworkId);
|
|
591 |
ASSERT_EQUALS(networkInfo.iDisplayTag, KDisplayTag);
|
|
592 |
ASSERT_EQUALS(networkInfo.iShortName, KShortName);
|
|
593 |
ASSERT_EQUALS(networkInfo.iLongName, KLongName);
|
|
594 |
|
|
595 |
ASSERT_EQUALS(locationArea.iAreaKnown, KAreaKnown);
|
|
596 |
ASSERT_EQUALS(locationArea.iLocationAreaCode, KLocationAreaCode);
|
|
597 |
ASSERT_EQUALS(locationArea.iCellId, KCellId);
|
|
598 |
|
|
599 |
//Do tests for TMobilePhoneNetworkInfoV1 and TMobilePhoneNetworkInfoV2 ?
|
|
600 |
|
|
601 |
// Check RMobilePhone::GetNITZInfo returned data against the data that was set up in CCtsyComponentTestBase::OpenPhoneL()
|
|
602 |
ASSERT_EQUALS(nitzRet.iShortNetworkId, KShortName);
|
|
603 |
ASSERT_EQUALS(nitzRet.iLongNetworkId, KLongName);
|
|
604 |
ASSERT_EQUALS(nitzRet.iNitzFieldsUsed, KNitzFieldsUsed);
|
|
605 |
ASSERT_EQUALS(nitzRet.iTimeZone, KTimeZone);
|
|
606 |
ASSERT_EQUALS(nitzRet.iDST, KDst);
|
|
607 |
|
|
608 |
// Check RMobilePhone::GetSignalStrength returned data against the data that was set up in CCtsyComponentTestBase::OpenPhoneL()
|
|
609 |
// RMobilePhone::GetSignalStrength
|
|
610 |
User::WaitForRequest(reqStatusGetSigStr);
|
|
611 |
ASSERT_EQUALS(reqStatusGetSigStr.Int(), KErrNone);
|
|
612 |
ASSERT_EQUALS(signalStrength, KSignalStrength);
|
|
613 |
ASSERT_EQUALS(bar, KBar);
|
|
614 |
|
|
615 |
// Check RMobilePhone::GetBatteryInfo returned data against the data that was set up in CCtsyComponentTestBase::OpenPhoneL()
|
|
616 |
User::WaitForRequest(reqStatusGetBattInfo);
|
|
617 |
ASSERT_EQUALS(reqStatusGetBattInfo.Int(), KErrNone);
|
|
618 |
ASSERT_EQUALS(battInfo.iStatus, KBatteryStatus);
|
|
619 |
ASSERT_EQUALS(battInfo.iChargeLevel, KBatteryChargeLevel);
|
|
620 |
|
|
621 |
data.Close();
|
|
622 |
|
|
623 |
AssertMockLtsyStatusL();
|
|
624 |
|
|
625 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
626 |
}
|
|
627 |
|
|
628 |
|
|
629 |
|
|
630 |
//
|
|
631 |
// Other unit tests
|
|
632 |
//
|
|
633 |
|
|
634 |
/**
|
|
635 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0001
|
|
636 |
@SYMComponent telephony_ctsy
|
|
637 |
@SYMTestCaseDesc Test support in CTSY for receiving indication of RF status change.
|
|
638 |
@SYMTestPriority High
|
|
639 |
@SYMTestActions Invokes xxxx
|
|
640 |
@SYMTestExpectedResults Pass
|
|
641 |
@SYMTestType UT
|
|
642 |
*/
|
|
643 |
void CCTsyPhoneFU::TestUnit0001L()
|
|
644 |
{
|
|
645 |
OpenEtelServerL(EUseExtendedError);
|
|
646 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
647 |
OpenPhoneL();
|
|
648 |
|
|
649 |
RBuf8 data;
|
|
650 |
CleanupClosePushL(data);
|
|
651 |
|
|
652 |
TRequestStatus mockLtsyStatus;
|
|
653 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
654 |
|
|
655 |
TRfStateInfo rfstatus = ERfsStateInfoInactive;
|
|
656 |
TMockLtsyData1<TRfStateInfo> rfstatdata(rfstatus);
|
|
657 |
rfstatdata.SerialiseL(data);
|
|
658 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyRfStatusChangeIndId,KErrNone, data, 0);
|
|
659 |
|
|
660 |
User::WaitForRequest(mockLtsyStatus);
|
|
661 |
|
|
662 |
AssertMockLtsyStatusL();
|
|
663 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
664 |
|
|
665 |
}
|
|
666 |
|
|
667 |
/**
|
|
668 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0002
|
|
669 |
@SYMComponent telephony_ctsy
|
|
670 |
@SYMTestCaseDesc Test support in CTSY for retrieving the Phone Identity
|
|
671 |
@SYMTestPriority High
|
|
672 |
@SYMTestActions Invokes RMobilePhone::GetPhoneId
|
|
673 |
@SYMTestExpectedResults Pass
|
|
674 |
@SYMTestType UT
|
|
675 |
*/
|
|
676 |
void CCTsyPhoneFU::TestUnit0002L()
|
|
677 |
{
|
|
678 |
OpenEtelServerL(EUseExtendedError);
|
|
679 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
680 |
OpenPhoneL();
|
|
681 |
|
|
682 |
RBuf8 data;
|
|
683 |
CleanupClosePushL(data);
|
|
684 |
|
|
685 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetPhoneId::KLtsyDispatchPhoneGetPhoneIdApiId);
|
|
686 |
|
|
687 |
_LIT(KManufacturer, "Manufacturer XYZ");
|
|
688 |
_LIT(KModel, "Model XYZ");
|
|
689 |
_LIT(KRevision, "Revision abc");
|
|
690 |
_LIT(KSerialNumber, "SerialNumber 1234");
|
|
691 |
//_LIT(KSerialNumberShort15, "SNum 1234");
|
|
692 |
|
|
693 |
RMobilePhone::TMobilePhoneIdentityV1 phoneId;
|
|
694 |
phoneId.iManufacturer = KManufacturer;
|
|
695 |
phoneId.iModel = KModel;
|
|
696 |
phoneId.iRevision = KRevision;
|
|
697 |
phoneId.iSerialNumber = KSerialNumber;
|
|
698 |
|
|
699 |
TMockLtsyData1<RMobilePhone::TMobilePhoneIdentityV1> phoneIdData(phoneId);
|
|
700 |
data.Close();
|
|
701 |
phoneIdData.SerialiseL(data);
|
|
702 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetPhoneId::KLtsyDispatchPhoneGetPhoneIdApiId, KErrNone, data);
|
|
703 |
|
|
704 |
// IPC call
|
|
705 |
TRequestStatus reqStatus;
|
|
706 |
RMobilePhone::TMobilePhoneIdentityV1 id;
|
|
707 |
iPhone.GetPhoneId(reqStatus, id);
|
|
708 |
User::WaitForRequest(reqStatus);
|
|
709 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
710 |
|
|
711 |
ASSERT_EQUALS(phoneId.iManufacturer, id.iManufacturer);
|
|
712 |
ASSERT_EQUALS(phoneId.iModel, id.iModel);
|
|
713 |
ASSERT_EQUALS(phoneId.iRevision, id.iRevision);
|
|
714 |
ASSERT_EQUALS(phoneId.iSerialNumber, id.iSerialNumber);
|
|
715 |
|
|
716 |
data.Close();
|
|
717 |
AssertMockLtsyStatusL();
|
|
718 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
719 |
}
|
|
720 |
/**
|
|
721 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0003
|
|
722 |
@SYMComponent telephony_ctsy
|
|
723 |
@SYMTestCaseDesc Test support in CTSY for retrieving the service provider name
|
|
724 |
@SYMTestPriority High
|
|
725 |
@SYMTestActions Invokes RMobilePhone::GetServiceProviderName
|
|
726 |
@SYMTestExpectedResults Pass
|
|
727 |
@SYMTestType UT
|
|
728 |
*/
|
|
729 |
void CCTsyPhoneFU::TestUnit0003L()
|
|
730 |
{
|
|
731 |
OpenEtelServerL(EUseExtendedError);
|
|
732 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
733 |
OpenPhoneL();
|
|
734 |
|
|
735 |
RBuf8 data;
|
|
736 |
CleanupClosePushL(data);
|
|
737 |
|
|
738 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetServiceProviderName::KLtsyDispatchPhoneGetServiceProviderNameApiId);
|
|
739 |
|
|
740 |
_LIT(KPLMNField, "plmn123");
|
|
741 |
_LIT(KSPName, "spn123");
|
|
742 |
|
|
743 |
RMobilePhone::TMobilePhoneServiceProviderNameV2 spnExp;
|
|
744 |
spnExp.iDisplayReq = RMobilePhone::KDisplayPLMNRequired | RMobilePhone::KDisplaySPNRequired;
|
|
745 |
spnExp.iPLMNField = KPLMNField;
|
|
746 |
spnExp.iSPName = KSPName;
|
|
747 |
|
|
748 |
TMockLtsyData1<RMobilePhone::TMobilePhoneServiceProviderNameV2> spnData(spnExp);
|
|
749 |
data.Close();
|
|
750 |
spnData.SerialiseL(data);
|
|
751 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetServiceProviderName::KLtsyDispatchPhoneGetServiceProviderNameApiId, KErrNone, data);
|
|
752 |
|
|
753 |
// IPC call
|
|
754 |
TRequestStatus reqStatus;
|
|
755 |
RMobilePhone::TMobilePhoneServiceProviderNameV2 spn;
|
|
756 |
RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg spnPkg(spn);
|
|
757 |
|
|
758 |
iPhone.GetServiceProviderName(reqStatus, spnPkg);
|
|
759 |
User::WaitForRequest(reqStatus);
|
|
760 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
761 |
ASSERT_EQUALS(spn.iDisplayReq, spnExp.iDisplayReq);
|
|
762 |
ASSERT_EQUALS(spn.iPLMNField, spnExp.iPLMNField);
|
|
763 |
ASSERT_EQUALS(spn.iSPName, spnExp.iSPName);
|
|
764 |
|
|
765 |
data.Close();
|
|
766 |
AssertMockLtsyStatusL();
|
|
767 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
768 |
}
|
|
769 |
|
|
770 |
/**
|
|
771 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0004
|
|
772 |
@SYMComponent telephony_ctsy
|
|
773 |
@SYMTestCaseDesc Test support in CTSY for cancelling a Get detected network list
|
|
774 |
@SYMTestPriority High
|
|
775 |
@SYMTestActions Invokes CGetDetectedNetworksAO::Cancel
|
|
776 |
@SYMTestExpectedResults Pass
|
|
777 |
@SYMTestType UT
|
|
778 |
*/
|
|
779 |
void CCTsyPhoneFU::TestUnit0004L()
|
|
780 |
{
|
|
781 |
OpenEtelServerL(EUseExtendedError);
|
|
782 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
783 |
OpenPhoneL();
|
|
784 |
|
|
785 |
CGetDetectedNetworksAO* detAO = CGetDetectedNetworksAO::NewLC(iPhone,iMockLTSY);
|
|
786 |
|
|
787 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetDetectedNetworks::KLtsyDispatchPhoneGetDetectedNetworksApiId, KErrNone);
|
|
788 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetDetectedNetworksCancel::KLtsyDispatchPhoneGetDetectedNetworksCancelApiId, KErrNone);
|
|
789 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetDetectedNetworksCancel::KLtsyDispatchPhoneGetDetectedNetworksCancelApiId, KErrNone);
|
|
790 |
|
|
791 |
detAO->TestCancel();
|
|
792 |
|
|
793 |
AssertMockLtsyStatusL();
|
|
794 |
|
|
795 |
CleanupStack::PopAndDestroy(detAO);
|
|
796 |
CleanupStack::PopAndDestroy(this);
|
|
797 |
}
|
|
798 |
|
|
799 |
/**
|
|
800 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0005
|
|
801 |
@SYMComponent telephony_ctsy
|
|
802 |
@SYMTestCaseDesc Test support in CTSY for cancelling for a manual network selection
|
|
803 |
@SYMTestPriority High
|
|
804 |
@SYMTestActions Invokes RMobilePhone::CancelAsyncRequest(EMobilePhoneSelectNetwork)
|
|
805 |
@SYMTestExpectedResults Pass
|
|
806 |
@SYMTestType UT
|
|
807 |
*/
|
|
808 |
void CCTsyPhoneFU::TestUnit0005L()
|
|
809 |
{
|
|
810 |
OpenEtelServerL(EUseExtendedError);
|
|
811 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
812 |
OpenPhoneL();
|
|
813 |
|
|
814 |
RBuf8 data;
|
|
815 |
CleanupClosePushL(data);
|
|
816 |
|
|
817 |
//setup ETel required data
|
|
818 |
_LIT(KCountryCode, "1234");
|
|
819 |
_LIT(KNetworkId, "12345678");
|
|
820 |
|
|
821 |
RMobilePhone::TMobilePhoneNetworkManualSelection selection;
|
|
822 |
selection.iCountry = KCountryCode;
|
|
823 |
selection.iNetwork = KNetworkId;
|
|
824 |
|
|
825 |
TBool isManual = ETrue;
|
|
826 |
|
|
827 |
TMockLtsyData2<TBool,RMobilePhone::TMobilePhoneNetworkManualSelection> selectData(isManual,selection);
|
|
828 |
|
|
829 |
selectData.SerialiseL(data);
|
|
830 |
|
|
831 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSelectNetwork::KLtsyDispatchPhoneSelectNetworkApiId, data, KErrNone);
|
|
832 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSelectNetworkCancel::KLtsyDispatchPhoneSelectNetworkCancelApiId, KErrNone);
|
|
833 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSelectNetworkCancel::KLtsyDispatchPhoneSelectNetworkCancelApiId, KErrNone);
|
|
834 |
|
|
835 |
TRequestStatus status;
|
|
836 |
iPhone.SelectNetwork(status,isManual,selection);
|
|
837 |
iPhone.CancelAsyncRequest(EMobilePhoneSelectNetwork);
|
|
838 |
User::WaitForRequest(status);
|
|
839 |
|
|
840 |
AssertMockLtsyStatusL();
|
|
841 |
|
|
842 |
CleanupStack::PopAndDestroy(&data);
|
|
843 |
CleanupStack::PopAndDestroy(this);
|
|
844 |
}
|
|
845 |
|
|
846 |
/**
|
|
847 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0006
|
|
848 |
@SYMComponent telephony_ctsy
|
|
849 |
@SYMTestCaseDesc Test support in CTSY network selection change notification
|
|
850 |
@SYMTestPriority High
|
|
851 |
@SYMTestActions Invokes RMobilePhone::NotifyNetworkSelectionSettingChange
|
|
852 |
@SYMTestExpectedResults Pass
|
|
853 |
@SYMTestType UT
|
|
854 |
*/
|
|
855 |
void CCTsyPhoneFU::TestUnit0006L()
|
|
856 |
{
|
|
857 |
OpenEtelServerL(EUseExtendedError);
|
|
858 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
859 |
OpenPhoneL();
|
|
860 |
|
|
861 |
RBuf8 data;
|
|
862 |
CleanupClosePushL(data);
|
|
863 |
|
|
864 |
//set up the set data
|
|
865 |
RMobilePhone::TMobilePhoneSelectionMethod phoneNetworkSelection;
|
|
866 |
phoneNetworkSelection = RMobilePhone::ENetworkSelectionManual;
|
|
867 |
|
|
868 |
//set up the Mock LTSY data
|
|
869 |
TMockLtsyData1<RMobilePhone::TMobilePhoneSelectionMethod> phoneNetworkSelectionData(phoneNetworkSelection);
|
|
870 |
phoneNetworkSelectionData.SerialiseL(data);
|
|
871 |
//set up Mock LTSY expect and completes
|
|
872 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNetworkSelectionSettingChangeIndId, KErrNone, data);
|
|
873 |
|
|
874 |
//ETel calls
|
|
875 |
TRequestStatus status;
|
|
876 |
//set up the notified data
|
|
877 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 notifiedPhoneNetworkSelection;
|
|
878 |
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg notifiedPckg(notifiedPhoneNetworkSelection);
|
|
879 |
iPhone.NotifyNetworkSelectionSettingChange(status,notifiedPckg);
|
|
880 |
|
|
881 |
User::WaitForRequest(status);
|
|
882 |
|
|
883 |
//CTSY sets iBandClass and iOperationMode to defults values
|
|
884 |
ASSERT_EQUALS(phoneNetworkSelection,notifiedPhoneNetworkSelection.iMethod);
|
|
885 |
ASSERT_EQUALS(RMobilePhone::ENetworkBandClassUnknown,notifiedPhoneNetworkSelection.iBandClass);
|
|
886 |
ASSERT_EQUALS(RMobilePhone::ENetworkOperationUnknown,notifiedPhoneNetworkSelection.iOperationMode);
|
|
887 |
AssertMockLtsyStatusL();
|
|
888 |
|
|
889 |
|
|
890 |
AssertMockLtsyStatusL();
|
|
891 |
|
|
892 |
CleanupStack::PopAndDestroy(&data);
|
|
893 |
CleanupStack::PopAndDestroy(this);
|
|
894 |
}
|
|
895 |
|
|
896 |
/**
|
|
897 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0007
|
|
898 |
@SYMComponent telephony_ctsy
|
|
899 |
@SYMTestCaseDesc Test support for battery information change notification.
|
|
900 |
@SYMTestPriority High
|
|
901 |
@SYMTestActions Invokes RMobilePhone::NotifyBatteryInfoChange
|
|
902 |
@SYMTestExpectedResults Pass
|
|
903 |
@SYMTestType UT
|
|
904 |
*/
|
|
905 |
void CCTsyPhoneFU::TestUnit0007L()
|
|
906 |
{
|
|
907 |
OpenEtelServerL(EUseExtendedError);
|
|
908 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
909 |
OpenPhoneL();
|
|
910 |
|
|
911 |
RBuf8 data;
|
|
912 |
CleanupClosePushL(data);
|
|
913 |
|
|
914 |
TRequestStatus mockLtsyStatus;
|
|
915 |
TRequestStatus requestStatus;
|
|
916 |
|
|
917 |
// Post notifier RMobilePhone::NotifyBatteryInfoChange
|
|
918 |
RMobilePhone::TMobilePhoneBatteryInfoV1 battInfoRet;
|
|
919 |
iPhone.NotifyBatteryInfoChange(requestStatus, battInfoRet);
|
|
920 |
|
|
921 |
// Prepare the NotifyBatteryInfoChange data for CompleteL
|
|
922 |
RMobilePhone::TMobilePhoneBatteryInfoV1 battInfoComplete;
|
|
923 |
battInfoComplete.iStatus = RMobilePhone::EBatteryConnectedButExternallyPowered;
|
|
924 |
battInfoComplete.iChargeLevel = 99;
|
|
925 |
|
|
926 |
TMockLtsyData1<RMobilePhone::TMobilePhoneBatteryInfoV1> mockBattData1(battInfoComplete);
|
|
927 |
|
|
928 |
// Send the CompleteL to MockLtsy
|
|
929 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
930 |
|
|
931 |
data.Close();
|
|
932 |
mockBattData1.SerialiseL(data);
|
|
933 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyBatteryInfoChangeIndId, KErrNone, data);
|
|
934 |
User::WaitForRequest(mockLtsyStatus);
|
|
935 |
AssertMockLtsyStatusL();
|
|
936 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
937 |
|
|
938 |
// Check completion of api
|
|
939 |
User::WaitForRequest(requestStatus);
|
|
940 |
AssertMockLtsyStatusL();
|
|
941 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
942 |
|
|
943 |
// Check returned data
|
|
944 |
ASSERT_EQUALS(battInfoRet.iStatus, battInfoComplete.iStatus);
|
|
945 |
ASSERT_EQUALS(battInfoRet.iChargeLevel, battInfoComplete.iChargeLevel);
|
|
946 |
|
|
947 |
data.Close();
|
|
948 |
AssertMockLtsyStatusL();
|
|
949 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
950 |
}
|
|
951 |
|
|
952 |
/**
|
|
953 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0008
|
|
954 |
@SYMComponent telephony_ctsy
|
|
955 |
@SYMTestCaseDesc Test support for retrieval battery information without having to post a notification.
|
|
956 |
@SYMTestPriority High
|
|
957 |
@SYMTestActions Invokes RMobilePhone::GetBatteryInfo
|
|
958 |
@SYMTestExpectedResults Pass
|
|
959 |
@SYMTestType UT
|
|
960 |
*/
|
|
961 |
void CCTsyPhoneFU::TestUnit0008L()
|
|
962 |
{
|
|
963 |
OpenEtelServerL(EUseExtendedError);
|
|
964 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
965 |
OpenPhoneL();
|
|
966 |
|
|
967 |
RBuf8 data;
|
|
968 |
CleanupClosePushL(data);
|
|
969 |
|
|
970 |
TRequestStatus reqStatus;
|
|
971 |
|
|
972 |
RMobilePhone::TMobilePhoneBatteryInfoV1 battInfo;
|
|
973 |
iPhone.GetBatteryInfo(reqStatus, battInfo);
|
|
974 |
|
|
975 |
// Check RMobilePhone::GetBatteryInfo returned data against the data that was set up in CCtsyComponentTestBase::OpenPhoneL()
|
|
976 |
User::WaitForRequest(reqStatus);
|
|
977 |
ASSERT_EQUALS(reqStatus.Int(), KErrNone);
|
|
978 |
ASSERT_EQUALS(battInfo.iStatus, KBatteryStatus);
|
|
979 |
ASSERT_EQUALS(battInfo.iChargeLevel, KBatteryChargeLevel);
|
|
980 |
|
|
981 |
data.Close();
|
|
982 |
AssertMockLtsyStatusL();
|
|
983 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
984 |
}
|
|
985 |
|
|
986 |
/**
|
|
987 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0009
|
|
988 |
@SYMComponent telephony_ctsy
|
|
989 |
@SYMTestCaseDesc Test support for network registration change notification.
|
|
990 |
@SYMTestPriority High
|
|
991 |
@SYMTestActions Invokes RMobilePhone::NotifyNetworkRegistrationStatusChange
|
|
992 |
@SYMTestExpectedResults Pass
|
|
993 |
@SYMTestType UT
|
|
994 |
*/
|
|
995 |
void CCTsyPhoneFU::TestUnit0009L()
|
|
996 |
{
|
|
997 |
OpenEtelServerL(EUseExtendedError);
|
|
998 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
999 |
OpenPhoneL();
|
|
1000 |
|
|
1001 |
RBuf8 data;
|
|
1002 |
CleanupClosePushL(data);
|
|
1003 |
|
|
1004 |
TRequestStatus mockLtsyStatus;
|
|
1005 |
TRequestStatus requestStatus;
|
|
1006 |
|
|
1007 |
// Post notifier RMobilePhone::NotifyNetworkRegistrationStatusChange
|
|
1008 |
RMobilePhone::TMobilePhoneRegistrationStatus regStatus;
|
|
1009 |
iPhone.NotifyNetworkRegistrationStatusChange(requestStatus, regStatus);
|
|
1010 |
|
|
1011 |
// Prepare the NotifyNetworkRegistrationStatusChange data for CompleteL
|
|
1012 |
// The Ctsy expects RMobilePhone::TMobilePhoneRegistrationStatus
|
|
1013 |
RMobilePhone::TMobilePhoneRegistrationStatus regStatusComplete;
|
|
1014 |
// Note: the registration status is made different to that set during phone boot-up intentionally
|
|
1015 |
regStatusComplete = RMobilePhone::ERegisteredRoaming;
|
|
1016 |
|
|
1017 |
TMockLtsyData1<RMobilePhone::TMobilePhoneRegistrationStatus> mockNetRegData1(regStatusComplete);
|
|
1018 |
|
|
1019 |
// Send the CompleteL to MockLtsy
|
|
1020 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
1021 |
|
|
1022 |
data.Close();
|
|
1023 |
mockNetRegData1.SerialiseL(data);
|
|
1024 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNetworkRegistrationStatusChangeIndId, KErrNone, data);
|
|
1025 |
User::WaitForRequest(mockLtsyStatus);
|
|
1026 |
AssertMockLtsyStatusL();
|
|
1027 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
1028 |
|
|
1029 |
// Check completion of api
|
|
1030 |
User::WaitForRequest(requestStatus);
|
|
1031 |
AssertMockLtsyStatusL();
|
|
1032 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1033 |
|
|
1034 |
// Check returned data
|
|
1035 |
ASSERT_EQUALS(regStatus, regStatusComplete);
|
|
1036 |
|
|
1037 |
data.Close();
|
|
1038 |
AssertMockLtsyStatusL();
|
|
1039 |
CleanupStack::PopAndDestroy(2, this); // data, this
|
|
1040 |
}
|
|
1041 |
|
|
1042 |
|
|
1043 |
/**
|
|
1044 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0010
|
|
1045 |
@SYMComponent telephony_ctsy
|
|
1046 |
@SYMTestCaseDesc Test correct function of NSPS (No Signal, Power Save) notification and waking
|
|
1047 |
@SYMTestPriority High
|
|
1048 |
@SYMTestActions Invokes RMmCustomAPI::NotifyNSPSStatus and RMmCustomAPI::NetWakeup
|
|
1049 |
@SYMTestExpectedResults Pass
|
|
1050 |
@SYMTestType UT
|
|
1051 |
*/
|
|
1052 |
void CCTsyPhoneFU::TestUnit0010L()
|
|
1053 |
{
|
|
1054 |
OpenEtelServerL(EUseExtendedError);
|
|
1055 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1056 |
|
|
1057 |
TRequestStatus reqStatus;
|
|
1058 |
|
|
1059 |
RBuf8 data;
|
|
1060 |
CleanupClosePushL(data);
|
|
1061 |
|
|
1062 |
OpenPhoneL();
|
|
1063 |
|
|
1064 |
RMmCustomAPI customApi;
|
|
1065 |
OpenCustomApiLC(customApi);
|
|
1066 |
|
|
1067 |
RMmCustomAPI::TNspsStatus nspsStatus;
|
|
1068 |
|
|
1069 |
TBool nspsEnabled = ETrue;
|
|
1070 |
TMockLtsyData1<TBool> nspsStatusData(nspsEnabled);
|
|
1071 |
|
|
1072 |
|
|
1073 |
customApi.NotifyNSPSStatus(reqStatus,nspsStatus);
|
|
1074 |
|
|
1075 |
data.Close();
|
|
1076 |
nspsStatusData.SerialiseL(data);
|
|
1077 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNspsStatusChangeIndId, KErrNone, data);
|
|
1078 |
|
|
1079 |
User::WaitForRequest(reqStatus);
|
|
1080 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
1081 |
ASSERT_EQUALS(RMmCustomAPI::ENspsOn, nspsStatus);
|
|
1082 |
|
|
1083 |
AssertMockLtsyStatusL();
|
|
1084 |
|
|
1085 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneNspsWakeup::KLtsyDispatchPhoneNspsWakeupApiId, KErrNone);
|
|
1086 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneNspsWakeup::KLtsyDispatchPhoneNspsWakeupApiId, KErrNone);
|
|
1087 |
customApi.NetWakeup(reqStatus);
|
|
1088 |
User::WaitForRequest(reqStatus);
|
|
1089 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
1090 |
|
|
1091 |
customApi.NotifyNSPSStatus(reqStatus,nspsStatus);
|
|
1092 |
nspsEnabled = EFalse;
|
|
1093 |
data.Close();
|
|
1094 |
nspsStatusData.SerialiseL(data);
|
|
1095 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNspsStatusChangeIndId, KErrNone, data);
|
|
1096 |
data.Close();
|
|
1097 |
User::WaitForRequest(reqStatus);
|
|
1098 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
1099 |
ASSERT_EQUALS(RMmCustomAPI::ENspsOff, nspsStatus);
|
|
1100 |
|
|
1101 |
|
|
1102 |
AssertMockLtsyStatusL();
|
|
1103 |
|
|
1104 |
|
|
1105 |
CleanupStack::PopAndDestroy(&customApi);
|
|
1106 |
CleanupStack::PopAndDestroy(&data);
|
|
1107 |
CleanupStack::PopAndDestroy(this);
|
|
1108 |
}
|
|
1109 |
|
|
1110 |
/**
|
|
1111 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0011
|
|
1112 |
@SYMComponent telephony_ctsy
|
|
1113 |
@SYMTestCaseDesc Test correct function of Edge Gprs notification
|
|
1114 |
@SYMTestPriority High
|
|
1115 |
@SYMTestActions Invokes RMmCustomAPI::NotifyEGprsInfoChange
|
|
1116 |
@SYMTestExpectedResults Pass
|
|
1117 |
@SYMTestType UT
|
|
1118 |
*/
|
|
1119 |
void CCTsyPhoneFU::TestUnit0011L()
|
|
1120 |
{
|
|
1121 |
OpenEtelServerL(EUseExtendedError);
|
|
1122 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1123 |
|
|
1124 |
RBuf8 data;
|
|
1125 |
CleanupClosePushL(data);
|
|
1126 |
|
|
1127 |
TRequestStatus reqStatus;
|
|
1128 |
|
|
1129 |
OpenPhoneL();
|
|
1130 |
|
|
1131 |
RMmCustomAPI customApi;
|
|
1132 |
OpenCustomApiLC(customApi);
|
|
1133 |
|
|
1134 |
RPacketService packetService;
|
|
1135 |
OpenPacketServiceLC(packetService,RPacketService::EStatusUnattached);
|
|
1136 |
|
|
1137 |
// custom API info
|
|
1138 |
RMmCustomAPI::TGprsInformation gprsInformation;
|
|
1139 |
RMmCustomAPI::TGprsInformationPckg gprsInformationPckg(gprsInformation);
|
|
1140 |
|
|
1141 |
|
|
1142 |
// test the case when Edge is not supported
|
|
1143 |
TBool edgeSupported = EFalse;
|
|
1144 |
TMockLtsyData1<TBool> egprsInfoData(edgeSupported);
|
|
1145 |
egprsInfoData.SerialiseL(data);
|
|
1146 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyEgprsInfoChangeIndId, KErrNone, data);
|
|
1147 |
data.Close();
|
|
1148 |
|
|
1149 |
customApi.NotifyEGprsInfoChange(reqStatus,gprsInformationPckg);
|
|
1150 |
User::WaitForRequest(reqStatus);
|
|
1151 |
ASSERT_EQUALS(reqStatus.Int(), KErrNone);
|
|
1152 |
ASSERT_EQUALS(gprsInformation.iGprsInfo,RMmCustomAPI::EGprs);
|
|
1153 |
AssertMockLtsyStatusL();
|
|
1154 |
|
|
1155 |
// test the case when Edge is supported
|
|
1156 |
edgeSupported = ETrue;
|
|
1157 |
egprsInfoData.SerialiseL(data);
|
|
1158 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyEgprsInfoChangeIndId, KErrNone, data);
|
|
1159 |
data.Close();
|
|
1160 |
|
|
1161 |
customApi.NotifyEGprsInfoChange(reqStatus,gprsInformationPckg);
|
|
1162 |
User::WaitForRequest(reqStatus);
|
|
1163 |
ASSERT_EQUALS(reqStatus.Int(), KErrNone);
|
|
1164 |
ASSERT_EQUALS(gprsInformation.iGprsInfo ,RMmCustomAPI::EEdgeGprs);
|
|
1165 |
AssertMockLtsyStatusL();
|
|
1166 |
|
|
1167 |
|
|
1168 |
// test the case when Edge is supported and KErrGeneral returned, (error returned not used in the CTSY)
|
|
1169 |
edgeSupported = ETrue;
|
|
1170 |
egprsInfoData.SerialiseL(data);
|
|
1171 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyEgprsInfoChangeIndId, KErrGeneral, data);
|
|
1172 |
data.Close();
|
|
1173 |
|
|
1174 |
customApi.NotifyEGprsInfoChange(reqStatus,gprsInformationPckg);
|
|
1175 |
User::WaitForRequest(reqStatus);
|
|
1176 |
ASSERT_EQUALS(reqStatus.Int(), KErrNone);
|
|
1177 |
ASSERT_EQUALS(gprsInformation.iGprsInfo ,RMmCustomAPI::EEdgeGprs);
|
|
1178 |
AssertMockLtsyStatusL();
|
|
1179 |
|
|
1180 |
CleanupStack::PopAndDestroy(&packetService);
|
|
1181 |
CleanupStack::PopAndDestroy(&customApi);
|
|
1182 |
CleanupStack::PopAndDestroy(&data);
|
|
1183 |
CleanupStack::PopAndDestroy(this);
|
|
1184 |
}
|
|
1185 |
|
|
1186 |
/**
|
|
1187 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0012
|
|
1188 |
@SYMComponent telephony_ctsy
|
|
1189 |
@SYMTestCaseDesc Test correct function of Getting the Fdn Status
|
|
1190 |
@SYMTestPriority High
|
|
1191 |
@SYMTestActions Invokes RMobilePhone::GetFdnStatus() (Sync and Async)
|
|
1192 |
@SYMTestExpectedResults Pass
|
|
1193 |
@SYMTestType UT
|
|
1194 |
*/
|
|
1195 |
void CCTsyPhoneFU::TestUnit0012L()
|
|
1196 |
{
|
|
1197 |
OpenEtelServerL(EUseExtendedError);
|
|
1198 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1199 |
|
|
1200 |
RBuf8 data;
|
|
1201 |
CleanupClosePushL(data);
|
|
1202 |
|
|
1203 |
TRequestStatus reqStatus;
|
|
1204 |
|
|
1205 |
OpenPhoneL();
|
|
1206 |
|
|
1207 |
//test the case where the LTSY returns KErrNone - asynchronous call
|
|
1208 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetFdnStatus::KLtsyDispatchPhoneGetFdnStatusApiId);
|
|
1209 |
|
|
1210 |
RMobilePhone::TMobilePhoneFdnStatus compFdnStatus = RMobilePhone::EFdnNotActive;
|
|
1211 |
TMockLtsyData1<RMobilePhone::TMobilePhoneFdnStatus> fdnStatusData(compFdnStatus);
|
|
1212 |
fdnStatusData.SerialiseL(data);
|
|
1213 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetFdnStatus::KLtsyDispatchPhoneGetFdnStatusApiId,KErrNone,data);
|
|
1214 |
data.Close();
|
|
1215 |
|
|
1216 |
RMobilePhone::TMobilePhoneFdnStatus fdnStatus = RMobilePhone::EFdnUnknown;
|
|
1217 |
iPhone.GetFdnStatus(reqStatus,fdnStatus);
|
|
1218 |
User::WaitForRequest(reqStatus);
|
|
1219 |
ASSERT_EQUALS(reqStatus.Int(), KErrNone);
|
|
1220 |
ASSERT_EQUALS(compFdnStatus,fdnStatus);
|
|
1221 |
AssertMockLtsyStatusL();
|
|
1222 |
|
|
1223 |
//test the case where the LTSY returns KErrGeneral - asynchronous call
|
|
1224 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetFdnStatus::KLtsyDispatchPhoneGetFdnStatusApiId);
|
|
1225 |
|
|
1226 |
compFdnStatus = RMobilePhone::EFdnNotActive;
|
|
1227 |
fdnStatusData.SerialiseL(data);
|
|
1228 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetFdnStatus::KLtsyDispatchPhoneGetFdnStatusApiId,KErrGeneral,data);
|
|
1229 |
data.Close();
|
|
1230 |
|
|
1231 |
fdnStatus = RMobilePhone::EFdnUnknown;
|
|
1232 |
iPhone.GetFdnStatus(reqStatus,fdnStatus);
|
|
1233 |
User::WaitForRequest(reqStatus);
|
|
1234 |
ASSERT_EQUALS(reqStatus.Int(), KErrGeneral);
|
|
1235 |
AssertMockLtsyStatusL();
|
|
1236 |
|
|
1237 |
//test the case where the LTSY returns KErrNone - synchronous call
|
|
1238 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetFdnStatus::KLtsyDispatchPhoneGetFdnStatusApiId);
|
|
1239 |
|
|
1240 |
compFdnStatus = RMobilePhone::EFdnNotActive;
|
|
1241 |
fdnStatusData.SerialiseL(data);
|
|
1242 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetFdnStatus::KLtsyDispatchPhoneGetFdnStatusApiId,KErrNone,data);
|
|
1243 |
data.Close();
|
|
1244 |
|
|
1245 |
fdnStatus = RMobilePhone::EFdnUnknown;
|
|
1246 |
ASSERT_EQUALS(iPhone.GetFdnStatus(fdnStatus), KErrNone);
|
|
1247 |
ASSERT_EQUALS(compFdnStatus,fdnStatus);
|
|
1248 |
AssertMockLtsyStatusL();
|
|
1249 |
|
|
1250 |
CleanupStack::PopAndDestroy(&data);
|
|
1251 |
CleanupStack::PopAndDestroy(this);
|
|
1252 |
}
|
|
1253 |
|
|
1254 |
/**
|
|
1255 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0013
|
|
1256 |
@SYMComponent telephony_ctsy
|
|
1257 |
@SYMTestCaseDesc Test correct function of Set Network Selection Setting error case
|
|
1258 |
@SYMTestPriority High
|
|
1259 |
@SYMTestActions Invokes RMobilePhone::NotifyNetworkSelectionSettingChange() RMobilePhone::SetNetworkSelectionSetting()
|
|
1260 |
@SYMTestExpectedResults Pass
|
|
1261 |
@SYMTestType UT
|
|
1262 |
*/
|
|
1263 |
void CCTsyPhoneFU::TestUnit0013L()
|
|
1264 |
{
|
|
1265 |
OpenEtelServerL(EUseExtendedError);
|
|
1266 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1267 |
|
|
1268 |
RBuf8 data;
|
|
1269 |
CleanupClosePushL(data);
|
|
1270 |
|
|
1271 |
OpenPhoneL();
|
|
1272 |
|
|
1273 |
//set up the notified data
|
|
1274 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 notifiedPhoneNetworkSelection;
|
|
1275 |
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg notifiedPckg(notifiedPhoneNetworkSelection);
|
|
1276 |
|
|
1277 |
//set up the set data
|
|
1278 |
RMobilePhone::TMobilePhoneNetworkSelectionV1 phoneNetworkSelection;
|
|
1279 |
phoneNetworkSelection.iMethod = RMobilePhone::ENetworkSelectionManual;
|
|
1280 |
phoneNetworkSelection.iBandClass = RMobilePhone::ENetworkBandClassAOnly;
|
|
1281 |
phoneNetworkSelection.iOperationMode = RMobilePhone::ENetworkOperationAnalogPreferred;
|
|
1282 |
|
|
1283 |
RMobilePhone::TMobilePhoneNetworkSelectionV1Pckg setPckg(phoneNetworkSelection);
|
|
1284 |
|
|
1285 |
//set up the Mock LTSY data
|
|
1286 |
TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkSelectionV1> phoneNetworkSelectionExpData(phoneNetworkSelection);
|
|
1287 |
phoneNetworkSelectionExpData.SerialiseL(data);
|
|
1288 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetNetworkSelectionSetting::KLtsyDispatchPhoneSetNetworkSelectionSettingApiId, data, KErrNone);
|
|
1289 |
data.Close();
|
|
1290 |
|
|
1291 |
TMockLtsyData1<RMobilePhone::TMobilePhoneSelectionMethod> phoneNetworkSelectionCompData(phoneNetworkSelection.iMethod);
|
|
1292 |
phoneNetworkSelectionCompData.SerialiseL(data);
|
|
1293 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetNetworkSelectionSetting::KLtsyDispatchPhoneSetNetworkSelectionSettingApiId, KErrGeneral, data);
|
|
1294 |
data.Close();
|
|
1295 |
|
|
1296 |
//ETel calls
|
|
1297 |
TRequestStatus notifyStatus;
|
|
1298 |
iPhone.NotifyNetworkSelectionSettingChange(notifyStatus,notifiedPckg);
|
|
1299 |
|
|
1300 |
TRequestStatus setNetworkSelectionStatus;
|
|
1301 |
iPhone.SetNetworkSelectionSetting(setNetworkSelectionStatus,setPckg);
|
|
1302 |
|
|
1303 |
User::WaitForRequest(setNetworkSelectionStatus);
|
|
1304 |
ASSERT_EQUALS(setNetworkSelectionStatus.Int(),KErrGeneral);
|
|
1305 |
ASSERT_EQUALS(notifyStatus.Int(),KRequestPending);
|
|
1306 |
|
|
1307 |
//CTSY sets iBandClass and iOperationMode to defults values
|
|
1308 |
ASSERT_EQUALS(RMobilePhone::ENetworkSelectionUnknown,notifiedPhoneNetworkSelection.iMethod);
|
|
1309 |
ASSERT_EQUALS(RMobilePhone::ENetworkBandClassUnknown,notifiedPhoneNetworkSelection.iBandClass);
|
|
1310 |
ASSERT_EQUALS(RMobilePhone::ENetworkOperationUnknown,notifiedPhoneNetworkSelection.iOperationMode);
|
|
1311 |
AssertMockLtsyStatusL();
|
|
1312 |
|
|
1313 |
iPhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkSelectionSettingChange);
|
|
1314 |
ASSERT_EQUALS(notifyStatus.Int(),KErrCancel);
|
|
1315 |
|
|
1316 |
CleanupStack::PopAndDestroy(&data);
|
|
1317 |
CleanupStack::PopAndDestroy(this);
|
|
1318 |
}
|
|
1319 |
|
|
1320 |
/**
|
|
1321 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0014
|
|
1322 |
@SYMComponent telephony_ctsy
|
|
1323 |
@SYMTestCaseDesc Test RMmCustomAPI::NotifyNetworkConnectionFailure
|
|
1324 |
@SYMTestPriority High
|
|
1325 |
@SYMTestActions Invokes RMmCustomAPI::NotifyNetworkConnectionFailure
|
|
1326 |
@SYMTestExpectedResults Pass
|
|
1327 |
@SYMTestType UT
|
|
1328 |
*/
|
|
1329 |
void CCTsyPhoneFU::TestUnit0014L()
|
|
1330 |
{
|
|
1331 |
OpenEtelServerL(EUseExtendedError);
|
|
1332 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1333 |
OpenPhoneL();
|
|
1334 |
|
|
1335 |
RMmCustomAPI customApi;
|
|
1336 |
OpenCustomApiLC(customApi);
|
|
1337 |
|
|
1338 |
|
|
1339 |
RBuf8 data;
|
|
1340 |
CleanupClosePushL(data);
|
|
1341 |
|
|
1342 |
TRequestStatus requestStatus;
|
|
1343 |
customApi.NotifyNetworkConnectionFailure(requestStatus);
|
|
1344 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1345 |
|
|
1346 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyNetworkConnectionFailureIndId, KErrNone);
|
|
1347 |
User::WaitForRequest(requestStatus);
|
|
1348 |
|
|
1349 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1350 |
|
|
1351 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1352 |
}
|
|
1353 |
|
|
1354 |
/**
|
|
1355 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0015
|
|
1356 |
@SYMComponent telephony_ctsy
|
|
1357 |
@SYMTestCaseDesc Test RMmCustomAPI::NotifyDtmfEvent
|
|
1358 |
@SYMTestPriority High
|
|
1359 |
@SYMTestActions Invokes RMmCustomAPI::NotifyDtmfEvent
|
|
1360 |
@SYMTestExpectedResults Pass
|
|
1361 |
@SYMTestType UT
|
|
1362 |
*/
|
|
1363 |
void CCTsyPhoneFU::TestUnit0015L()
|
|
1364 |
{
|
|
1365 |
OpenEtelServerL(EUseExtendedError);
|
|
1366 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1367 |
OpenPhoneL();
|
|
1368 |
|
|
1369 |
RMmCustomAPI customApi;
|
|
1370 |
OpenCustomApiLC(customApi);
|
|
1371 |
|
|
1372 |
RBuf8 data;
|
|
1373 |
CleanupClosePushL(data);
|
|
1374 |
|
|
1375 |
TRequestStatus requestStatus;
|
|
1376 |
RMmCustomAPI::TDtmfInfo info;
|
|
1377 |
customApi.NotifyDtmfEvent(requestStatus, info);
|
|
1378 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1379 |
|
|
1380 |
RMmCustomAPI::TDtmfEventType compType = RMmCustomAPI::EDtmfSequence;
|
|
1381 |
RMmCustomAPI::TDtmfEvent compEvent = RMmCustomAPI::EDtmfStop;
|
|
1382 |
TChar compChar = '0';
|
|
1383 |
TMockLtsyData3<RMmCustomAPI::TDtmfEventType, RMmCustomAPI::TDtmfEvent, TChar>
|
|
1384 |
modesData(compType, compEvent, compChar);
|
|
1385 |
data.Close();
|
|
1386 |
modesData.SerialiseL(data);
|
|
1387 |
iMockLTSY.CompleteL(KMockLtsyDispatchCustomPhoneNotifyDtmfEventIndId, KErrNone, data);
|
|
1388 |
User::WaitForRequest(requestStatus);
|
|
1389 |
|
|
1390 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1391 |
ASSERT_EQUALS(compType, info.iType);
|
|
1392 |
ASSERT_EQUALS(compEvent, info.iEvent);
|
|
1393 |
ASSERT_EQUALS(compChar, info.iTone);
|
|
1394 |
|
|
1395 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1396 |
}
|
|
1397 |
|
|
1398 |
/**
|
|
1399 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0016
|
|
1400 |
@SYMComponent telephony_ctsy
|
|
1401 |
@SYMTestCaseDesc Test RMmCustomAPI::ResetNetServer
|
|
1402 |
@SYMTestPriority High
|
|
1403 |
@SYMTestActions Invokes RMmCustomAPI::ResetNetServer
|
|
1404 |
@SYMTestExpectedResults Pass
|
|
1405 |
@SYMTestType UT
|
|
1406 |
*/
|
|
1407 |
void CCTsyPhoneFU::TestUnit0016L()
|
|
1408 |
{
|
|
1409 |
OpenEtelServerL(EUseExtendedError);
|
|
1410 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1411 |
OpenPhoneL();
|
|
1412 |
|
|
1413 |
RMmCustomAPI customApi;
|
|
1414 |
OpenCustomApiLC(customApi);
|
|
1415 |
|
|
1416 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneResetNetServer::KLtsyDispatchPhoneResetNetServerApiId, KErrNone);
|
|
1417 |
|
|
1418 |
TRequestStatus requestStatus;
|
|
1419 |
customApi.ResetNetServer(requestStatus);
|
|
1420 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1421 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneResetNetServer::KLtsyDispatchPhoneResetNetServerApiId, KErrNone);
|
|
1422 |
User::WaitForRequest(requestStatus);
|
|
1423 |
|
|
1424 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1425 |
|
|
1426 |
CleanupStack::PopAndDestroy(2, this); // customApi, this
|
|
1427 |
}
|
|
1428 |
|
|
1429 |
/**
|
|
1430 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0017
|
|
1431 |
@SYMComponent telephony_ctsy
|
|
1432 |
@SYMTestCaseDesc Test RMmCustomAPI::SetAlwaysOn
|
|
1433 |
@SYMTestPriority High
|
|
1434 |
@SYMTestActions Invokes RMmCustomAPI::SetAlwaysOn
|
|
1435 |
@SYMTestExpectedResults Pass
|
|
1436 |
@SYMTestType UT
|
|
1437 |
*/
|
|
1438 |
void CCTsyPhoneFU::TestUnit0017L()
|
|
1439 |
{
|
|
1440 |
OpenEtelServerL(EUseExtendedError);
|
|
1441 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1442 |
OpenPhoneL();
|
|
1443 |
|
|
1444 |
RMmCustomAPI customApi;
|
|
1445 |
OpenCustomApiLC(customApi);
|
|
1446 |
|
|
1447 |
|
|
1448 |
RBuf8 data;
|
|
1449 |
CleanupClosePushL(data);
|
|
1450 |
|
|
1451 |
// Open a packet service, ctsy must have a packet service sub session in order to activate the SetAlwaysOn
|
|
1452 |
|
|
1453 |
RPacketService packetService;
|
|
1454 |
OpenPacketServiceLC(packetService,RPacketService::EStatusUnattached);
|
|
1455 |
|
|
1456 |
RMmCustomAPI::TSetAlwaysOnMode expData = RMmCustomAPI::EAlwaysModeBoth;
|
|
1457 |
TMockLtsyData1<RMmCustomAPI::TSetAlwaysOnMode> modesData(expData);
|
|
1458 |
data.Close();
|
|
1459 |
modesData.SerialiseL(data);
|
|
1460 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetAlwaysOnMode::KLtsyDispatchPhoneSetAlwaysOnModeApiId, data, KErrNone);
|
|
1461 |
|
|
1462 |
TRequestStatus requestStatus;
|
|
1463 |
customApi.SetAlwaysOn(requestStatus, expData);
|
|
1464 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1465 |
|
|
1466 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetAlwaysOnMode::KLtsyDispatchPhoneSetAlwaysOnModeApiId, KErrNone);
|
|
1467 |
User::WaitForRequest(requestStatus);
|
|
1468 |
|
|
1469 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1470 |
|
|
1471 |
CleanupStack::PopAndDestroy(4, this); // packetService, data, customApi, this
|
|
1472 |
}
|
|
1473 |
|
|
1474 |
/**
|
|
1475 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0018
|
|
1476 |
@SYMComponent telephony_ctsy
|
|
1477 |
@SYMTestCaseDesc Test RMmCustomAPI::SetDriveMode
|
|
1478 |
@SYMTestPriority High
|
|
1479 |
@SYMTestActions Invokes RMmCustomAPI::SetDriveMode
|
|
1480 |
@SYMTestExpectedResults Pass
|
|
1481 |
@SYMTestType UT
|
|
1482 |
*/
|
|
1483 |
void CCTsyPhoneFU::TestUnit0018L()
|
|
1484 |
{
|
|
1485 |
OpenEtelServerL(EUseExtendedError);
|
|
1486 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1487 |
OpenPhoneL();
|
|
1488 |
|
|
1489 |
RMmCustomAPI customApi;
|
|
1490 |
OpenCustomApiLC(customApi);
|
|
1491 |
|
|
1492 |
|
|
1493 |
RBuf8 data;
|
|
1494 |
CleanupClosePushL(data);
|
|
1495 |
|
|
1496 |
RMmCustomAPI::TSetDriveMode expData = RMmCustomAPI::EActivateDriveMode;
|
|
1497 |
TMockLtsyData1<RMmCustomAPI::TSetDriveMode> modesData(expData);
|
|
1498 |
data.Close();
|
|
1499 |
modesData.SerialiseL(data);
|
|
1500 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetDriveMode::KLtsyDispatchPhoneSetDriveModeApiId, data, KErrNone);
|
|
1501 |
|
|
1502 |
TRequestStatus requestStatus;
|
|
1503 |
customApi.SetDriveMode(requestStatus, RMmCustomAPI::EActivateDriveMode);
|
|
1504 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1505 |
|
|
1506 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetDriveMode::KLtsyDispatchPhoneSetDriveModeApiId, KErrNone);
|
|
1507 |
User::WaitForRequest(requestStatus);
|
|
1508 |
|
|
1509 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1510 |
|
|
1511 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1512 |
}
|
|
1513 |
|
|
1514 |
/**
|
|
1515 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0019
|
|
1516 |
@SYMComponent telephony_ctsy
|
|
1517 |
@SYMTestCaseDesc Test RMmCustomAPI::ReadHSxPAStatus, RMmCustomAPI::WriteHSxPAStatus and RMmCustomAPI::NotifyHSxPAStatus
|
|
1518 |
@SYMTestPriority High
|
|
1519 |
@SYMTestActions Invokes RMmCustomAPI::ReadHSxPAStatus, RMmCustomAPI::WriteHSxPAStatus and RMmCustomAPI::NotifyHSxPAStatus
|
|
1520 |
@SYMTestExpectedResults Pass
|
|
1521 |
@SYMTestType UT
|
|
1522 |
*/
|
|
1523 |
void CCTsyPhoneFU::TestUnit0019L()
|
|
1524 |
{
|
|
1525 |
OpenEtelServerL(EUseExtendedError);
|
|
1526 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1527 |
OpenPhoneL();
|
|
1528 |
|
|
1529 |
RMmCustomAPI customApi;
|
|
1530 |
OpenCustomApiLC(customApi);
|
|
1531 |
|
|
1532 |
|
|
1533 |
RBuf8 data;
|
|
1534 |
CleanupClosePushL(data);
|
|
1535 |
|
|
1536 |
// Register Notification
|
|
1537 |
RMmCustomAPI::THSxPAStatus notifyHspaStatus;
|
|
1538 |
TRequestStatus notifyRequestStatus;
|
|
1539 |
customApi.NotifyHSxPAStatus(notifyRequestStatus, notifyHspaStatus);
|
|
1540 |
ASSERT_EQUALS(KRequestPending, notifyRequestStatus.Int());
|
|
1541 |
|
|
1542 |
// Expect for setter
|
|
1543 |
RMmCustomAPI::THSxPAStatus expSetHspaStatus = RMmCustomAPI::EHSxPAEnabled;
|
|
1544 |
TMockLtsyData1<RMmCustomAPI::THSxPAStatus> expSetData(expSetHspaStatus);
|
|
1545 |
data.Close();
|
|
1546 |
expSetData.SerialiseL(data);
|
|
1547 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetHspaStatus::KLtsyDispatchPhoneSetHspaStatusApiId, data, KErrNone);
|
|
1548 |
|
|
1549 |
// Set the data
|
|
1550 |
TRequestStatus setRequestStatus;
|
|
1551 |
RMmCustomAPI::THSxPAStatus setHspaStatus = expSetHspaStatus;
|
|
1552 |
customApi.WriteHSxPAStatus(setRequestStatus, setHspaStatus);
|
|
1553 |
ASSERT_EQUALS(KRequestPending, setRequestStatus.Int());
|
|
1554 |
|
|
1555 |
// Complete the set
|
|
1556 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetHspaStatus::KLtsyDispatchPhoneSetHspaStatusApiId, KErrNone);
|
|
1557 |
User::WaitForRequest(setRequestStatus);
|
|
1558 |
ASSERT_EQUALS(KErrNone, setRequestStatus.Int());
|
|
1559 |
|
|
1560 |
// Expect for getter
|
|
1561 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetHspaStatus::KLtsyDispatchPhoneGetHspaStatusApiId, KErrNone);
|
|
1562 |
|
|
1563 |
// get the data
|
|
1564 |
TRequestStatus getRequestStatus;
|
|
1565 |
RMmCustomAPI::THSxPAStatus getHspaStatus;
|
|
1566 |
customApi.ReadHSxPAStatus(getRequestStatus, getHspaStatus);
|
|
1567 |
ASSERT_EQUALS(KRequestPending, getRequestStatus.Int());
|
|
1568 |
|
|
1569 |
// Complete the get
|
|
1570 |
RMmCustomAPI::THSxPAStatus compGetHspaStatus = RMmCustomAPI::EHSxPAEnabled;
|
|
1571 |
TMockLtsyData1<RMmCustomAPI::THSxPAStatus> compGetData(compGetHspaStatus);
|
|
1572 |
data.Close();
|
|
1573 |
compGetData.SerialiseL(data);
|
|
1574 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetHspaStatus::KLtsyDispatchPhoneGetHspaStatusApiId, KErrNone, data);
|
|
1575 |
User::WaitForRequest(getRequestStatus);
|
|
1576 |
ASSERT_EQUALS(KErrNone, getRequestStatus.Int());
|
|
1577 |
ASSERT_EQUALS(compGetHspaStatus, getHspaStatus);
|
|
1578 |
|
|
1579 |
// notify a change
|
|
1580 |
RMmCustomAPI::THSxPAStatus compNotifyHspaStatus = RMmCustomAPI::EHSxPADisabled;
|
|
1581 |
TMockLtsyData1<RMmCustomAPI::THSxPAStatus> compNotiftData(compNotifyHspaStatus);
|
|
1582 |
data.Close();
|
|
1583 |
compNotiftData.SerialiseL(data);
|
|
1584 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyHspaStatusChangedIndId, KErrNone, data);
|
|
1585 |
User::WaitForRequest(notifyRequestStatus);
|
|
1586 |
ASSERT_EQUALS(KErrNone, notifyRequestStatus.Int());
|
|
1587 |
ASSERT_EQUALS(compNotifyHspaStatus, notifyHspaStatus);
|
|
1588 |
|
|
1589 |
|
|
1590 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1591 |
}
|
|
1592 |
|
|
1593 |
|
|
1594 |
/**
|
|
1595 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0020
|
|
1596 |
@SYMComponent telephony_ctsy
|
|
1597 |
@SYMTestCaseDesc Test RMmCustomAPI::GetNetworkProviderName
|
|
1598 |
@SYMTestPriority High
|
|
1599 |
@SYMTestActions Invokes RMmCustomAPI::GetNetworkProviderName
|
|
1600 |
@SYMTestExpectedResults Pass
|
|
1601 |
@SYMTestType UT
|
|
1602 |
*/
|
|
1603 |
void CCTsyPhoneFU::TestUnit0020L()
|
|
1604 |
{
|
|
1605 |
OpenEtelServerL(EUseExtendedError);
|
|
1606 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1607 |
OpenPhoneL();
|
|
1608 |
|
|
1609 |
RMmCustomAPI customApi;
|
|
1610 |
OpenCustomApiLC(customApi);
|
|
1611 |
|
|
1612 |
RBuf8 data;
|
|
1613 |
CleanupClosePushL(data);
|
|
1614 |
|
|
1615 |
// Checking the synch API version
|
|
1616 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetNetworkProviderName::KLtsyDispatchPhoneGetNetworkProviderNameApiId, KErrNone);
|
|
1617 |
_LIT(KNetworkProviderName, "Provider Name");
|
|
1618 |
RMobilePhone::TMobilePhoneNetworkLongName completeData(KNetworkProviderName);
|
|
1619 |
TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkLongName> nameData(completeData);
|
|
1620 |
data.Close();
|
|
1621 |
nameData.SerialiseL(data);
|
|
1622 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetNetworkProviderName::KLtsyDispatchPhoneGetNetworkProviderNameApiId, KErrNone, data);
|
|
1623 |
RMobilePhone::TMobilePhoneNetworkLongName name;
|
|
1624 |
ASSERT_EQUALS(KErrNone, customApi.GetNetworkProviderName(name));
|
|
1625 |
ASSERT_EQUALS(name, completeData);
|
|
1626 |
|
|
1627 |
// Checking the asynch API version
|
|
1628 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetNetworkProviderName::KLtsyDispatchPhoneGetNetworkProviderNameApiId, KErrNone);
|
|
1629 |
_LIT(KNetworkProviderName2, "Provider Name 2");
|
|
1630 |
RMobilePhone::TMobilePhoneNetworkLongName completeData2(KNetworkProviderName2);
|
|
1631 |
TMockLtsyData1<RMobilePhone::TMobilePhoneNetworkLongName> nameData2(completeData2);
|
|
1632 |
data.Close();
|
|
1633 |
nameData2.SerialiseL(data);
|
|
1634 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetNetworkProviderName::KLtsyDispatchPhoneGetNetworkProviderNameApiId, KErrNone, data);
|
|
1635 |
TRequestStatus status;
|
|
1636 |
customApi.GetNetworkProviderName(status, name);
|
|
1637 |
User::WaitForRequest(status);
|
|
1638 |
ASSERT_EQUALS(status.Int(), KErrNone);
|
|
1639 |
ASSERT_EQUALS(name, completeData2);
|
|
1640 |
|
|
1641 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1642 |
}
|
|
1643 |
|
|
1644 |
/**
|
|
1645 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0021
|
|
1646 |
@SYMComponent telephony_ctsy
|
|
1647 |
@SYMTestCaseDesc Test RMmCustomAPI::GetOperatorName
|
|
1648 |
@SYMTestPriority High
|
|
1649 |
@SYMTestActions Invokes RMmCustomAPI::GetOperatorName
|
|
1650 |
@SYMTestExpectedResults Pass
|
|
1651 |
@SYMTestType UT
|
|
1652 |
*/
|
|
1653 |
void CCTsyPhoneFU::TestUnit0021L()
|
|
1654 |
{
|
|
1655 |
OpenEtelServerL(EUseExtendedError);
|
|
1656 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1657 |
OpenPhoneL();
|
|
1658 |
|
|
1659 |
RMmCustomAPI customApi;
|
|
1660 |
OpenCustomApiLC(customApi);
|
|
1661 |
|
|
1662 |
RBuf8 data;
|
|
1663 |
CleanupClosePushL(data);
|
|
1664 |
|
|
1665 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetOperatorName::KLtsyDispatchPhoneGetOperatorNameApiId, KErrNone);
|
|
1666 |
|
|
1667 |
TRequestStatus getRequestStatus;
|
|
1668 |
RMmCustomAPI::TOperatorNameInfo getNameInfo;
|
|
1669 |
customApi.GetOperatorName(getRequestStatus, getNameInfo);
|
|
1670 |
ASSERT_EQUALS(KRequestPending, getRequestStatus.Int());
|
|
1671 |
|
|
1672 |
RMmCustomAPI::TOperatorNameType compType = RMmCustomAPI::EOperatorNameProgrammableLatin;
|
|
1673 |
_LIT(KNetworkOperatorName, "Network Operator Name");
|
|
1674 |
TBuf<KMaxOperatorNameLength> compName(KNetworkOperatorName);
|
|
1675 |
TMockLtsyData2<RMmCustomAPI::TOperatorNameType, TBuf<KMaxOperatorNameLength> > modesData(compType, compName);
|
|
1676 |
data.Close();
|
|
1677 |
modesData.SerialiseL(data);
|
|
1678 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetOperatorName::KLtsyDispatchPhoneGetOperatorNameApiId, KErrNone, data);
|
|
1679 |
|
|
1680 |
User::WaitForRequest(getRequestStatus);
|
|
1681 |
ASSERT_EQUALS(KErrNone, getRequestStatus.Int());
|
|
1682 |
ASSERT_EQUALS(compType, getNameInfo.iType);
|
|
1683 |
ASSERT_EQUALS(compName, getNameInfo.iName);
|
|
1684 |
|
|
1685 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1686 |
}
|
|
1687 |
|
|
1688 |
/**
|
|
1689 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0022
|
|
1690 |
@SYMComponent telephony_ctsy
|
|
1691 |
@SYMTestCaseDesc Test RMmCustomAPI::SetSystemNetworkMode
|
|
1692 |
@SYMTestPriority High
|
|
1693 |
@SYMTestActions Invokes RMmCustomAPI::SetSystemNetworkMode
|
|
1694 |
@SYMTestExpectedResults Pass
|
|
1695 |
@SYMTestType UT
|
|
1696 |
*/
|
|
1697 |
void CCTsyPhoneFU::TestUnit0022L()
|
|
1698 |
{
|
|
1699 |
OpenEtelServerL(EUseExtendedError);
|
|
1700 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1701 |
OpenPhoneL();
|
|
1702 |
|
|
1703 |
RMmCustomAPI customApi;
|
|
1704 |
OpenCustomApiLC(customApi);
|
|
1705 |
|
|
1706 |
|
|
1707 |
RBuf8 data;
|
|
1708 |
CleanupClosePushL(data);
|
|
1709 |
|
|
1710 |
// Check synch version of the API
|
|
1711 |
RMmCustomAPI::TNetworkModeCaps mode = RMmCustomAPI::KCapsNetworkModeUmts;
|
|
1712 |
TMockLtsyData1<RMmCustomAPI::TNetworkModeCaps> modeData(mode);
|
|
1713 |
data.Close();
|
|
1714 |
modeData.SerialiseL(data);
|
|
1715 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetSystemNetworkMode::KLtsyDispatchPhoneSetSystemNetworkModeApiId, data, KErrNone);
|
|
1716 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetSystemNetworkMode::KLtsyDispatchPhoneSetSystemNetworkModeApiId, KErrNone);
|
|
1717 |
ASSERT_EQUALS(KErrNone, customApi.SetSystemNetworkMode(mode));
|
|
1718 |
|
|
1719 |
// Check asynch version of the API
|
|
1720 |
TRequestStatus status;
|
|
1721 |
mode = RMmCustomAPI::KCapsNetworkModeDual;
|
|
1722 |
TMockLtsyData1<RMmCustomAPI::TNetworkModeCaps> modeData2(mode);
|
|
1723 |
data.Close();
|
|
1724 |
modeData2.SerialiseL(data);
|
|
1725 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetSystemNetworkMode::KLtsyDispatchPhoneSetSystemNetworkModeApiId, data, KErrNone);
|
|
1726 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetSystemNetworkMode::KLtsyDispatchPhoneSetSystemNetworkModeApiId, KErrNone);
|
|
1727 |
customApi.SetSystemNetworkMode(status, mode);
|
|
1728 |
User::WaitForRequest(status);
|
|
1729 |
ASSERT_EQUALS(KErrNone, status.Int());
|
|
1730 |
|
|
1731 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1732 |
}
|
|
1733 |
|
|
1734 |
/**
|
|
1735 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0023
|
|
1736 |
@SYMComponent telephony_ctsy
|
|
1737 |
@SYMTestCaseDesc Test RMmCustomAPI::GetCurrentSystemNetworkModes
|
|
1738 |
@SYMTestPriority High
|
|
1739 |
@SYMTestActions Invokes RMmCustomAPI::GetCurrentSystemNetworkModes
|
|
1740 |
@SYMTestExpectedResults Pass
|
|
1741 |
@SYMTestType UT
|
|
1742 |
*/
|
|
1743 |
void CCTsyPhoneFU::TestUnit0023L()
|
|
1744 |
{
|
|
1745 |
OpenEtelServerL(EUseExtendedError);
|
|
1746 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1747 |
OpenPhoneL();
|
|
1748 |
|
|
1749 |
RMmCustomAPI customApi;
|
|
1750 |
OpenCustomApiLC(customApi);
|
|
1751 |
|
|
1752 |
|
|
1753 |
RBuf8 data;
|
|
1754 |
CleanupClosePushL(data);
|
|
1755 |
|
|
1756 |
// Check the synch version of the API
|
|
1757 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCurrentSystemNetworkModes::KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId, KErrNone);
|
|
1758 |
TUint32 compModes = RMmCustomAPI::KCapsNetworkModeUmts | RMmCustomAPI::KCapsNetworkModeGsm;
|
|
1759 |
TMockLtsyData1<TUint32> modesData(compModes);
|
|
1760 |
data.Close();
|
|
1761 |
modesData.SerialiseL(data);
|
|
1762 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCurrentSystemNetworkModes::KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId, KErrNone, data);
|
|
1763 |
TUint32 modes;
|
|
1764 |
ASSERT_EQUALS(KErrNone, customApi.GetCurrentSystemNetworkModes(modes));
|
|
1765 |
ASSERT_EQUALS(modes, compModes);
|
|
1766 |
|
|
1767 |
// Check the asynch version of the API
|
|
1768 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCurrentSystemNetworkModes::KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId, KErrNone);
|
|
1769 |
compModes = RMmCustomAPI::KCapsNetworkModeUmts;
|
|
1770 |
TMockLtsyData1<TUint32> modesData2(compModes);
|
|
1771 |
data.Close();
|
|
1772 |
modesData2.SerialiseL(data);
|
|
1773 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCurrentSystemNetworkModes::KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId, KErrNone, data);
|
|
1774 |
TRequestStatus status;
|
|
1775 |
customApi.GetCurrentSystemNetworkModes(status, modes);
|
|
1776 |
User::WaitForRequest(status);
|
|
1777 |
ASSERT_EQUALS(KErrNone, status.Int());
|
|
1778 |
ASSERT_EQUALS(modes, compModes);
|
|
1779 |
|
|
1780 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1781 |
}
|
|
1782 |
|
|
1783 |
/**
|
|
1784 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0024
|
|
1785 |
@SYMComponent telephony_ctsy
|
|
1786 |
@SYMTestCaseDesc Test RMmCustomAPI::NotifyRauEvent
|
|
1787 |
@SYMTestPriority High
|
|
1788 |
@SYMTestActions Invokes RMmCustomAPI::NotifyRauEvent
|
|
1789 |
@SYMTestExpectedResults Pass
|
|
1790 |
@SYMTestType UT
|
|
1791 |
*/
|
|
1792 |
void CCTsyPhoneFU::TestUnit0024L()
|
|
1793 |
{
|
|
1794 |
OpenEtelServerL(EUseExtendedError);
|
|
1795 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1796 |
OpenPhoneL();
|
|
1797 |
|
|
1798 |
RMmCustomAPI customApi;
|
|
1799 |
OpenCustomApiLC(customApi);
|
|
1800 |
|
|
1801 |
RBuf8 data;
|
|
1802 |
CleanupClosePushL(data);
|
|
1803 |
|
|
1804 |
TRequestStatus requestStatus;
|
|
1805 |
RMmCustomAPI::TRauEventStatus event;
|
|
1806 |
customApi.NotifyRauEvent(requestStatus, event);
|
|
1807 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1808 |
|
|
1809 |
RMmCustomAPI::TRauEventStatus compEvent = RMmCustomAPI::ERauEventResumed;
|
|
1810 |
TMockLtsyData1<RMmCustomAPI::TRauEventStatus> modesData(compEvent);
|
|
1811 |
data.Close();
|
|
1812 |
modesData.SerialiseL(data);
|
|
1813 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyRauEventIndId, KErrNone, data);
|
|
1814 |
User::WaitForRequest(requestStatus);
|
|
1815 |
|
|
1816 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1817 |
ASSERT_EQUALS(compEvent, event);
|
|
1818 |
|
|
1819 |
CleanupStack::PopAndDestroy(3, this); // data, customApi, this
|
|
1820 |
}
|
|
1821 |
|
|
1822 |
/**
|
|
1823 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0025
|
|
1824 |
@SYMComponent telephony_ctsy
|
|
1825 |
@SYMTestCaseDesc Test RMmCustomAPI::NotifyCellInfoChange and RMmCustomAPI::GetCellInfo
|
|
1826 |
@SYMTestPriority High
|
|
1827 |
@SYMTestActions Invokes RMmCustomAPI::NotifyCellInfoChange and RMmCustomAPI::GetCellInfo
|
|
1828 |
@SYMTestExpectedResults Pass
|
|
1829 |
@SYMTestType UT
|
|
1830 |
*/
|
|
1831 |
void CCTsyPhoneFU::TestUnit0025L()
|
|
1832 |
{
|
|
1833 |
OpenEtelServerL(EUseExtendedError);
|
|
1834 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1835 |
OpenPhoneL();
|
|
1836 |
|
|
1837 |
RMmCustomAPI customApi;
|
|
1838 |
OpenCustomApiLC(customApi);
|
|
1839 |
|
|
1840 |
RBuf8 data;
|
|
1841 |
CleanupClosePushL(data);
|
|
1842 |
|
|
1843 |
TRequestStatus requestStatus;
|
|
1844 |
RMmCustomAPI::TMmCellInfo* completeInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
|
|
1845 |
CleanupStack::PushL(completeInfo);
|
|
1846 |
RMmCustomAPI::TMmCellInfo* notifyInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
|
|
1847 |
CleanupStack::PushL(notifyInfo);
|
|
1848 |
RMmCustomAPI::TMmCellInfoPckg *notifyInfoPckg = new(ELeave) RMmCustomAPI::TMmCellInfoPckg(*notifyInfo);
|
|
1849 |
CleanupStack::PushL(notifyInfoPckg);
|
|
1850 |
RMmCustomAPI::TMmCellInfo* getInfo = new(ELeave) RMmCustomAPI::TMmCellInfo;
|
|
1851 |
CleanupStack::PushL(getInfo);
|
|
1852 |
RMmCustomAPI::TMmCellInfoPckg *getInfoPckg = new(ELeave) RMmCustomAPI::TMmCellInfoPckg(*getInfo);
|
|
1853 |
CleanupStack::PushL(getInfoPckg);
|
|
1854 |
|
|
1855 |
// Register a notifier
|
|
1856 |
customApi.NotifyCellInfoChange(requestStatus, *notifyInfoPckg);
|
|
1857 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1858 |
|
|
1859 |
// Indicate cell changed to unknowd cell
|
|
1860 |
(*completeInfo).iMode = RMmCustomAPI::TMmCellInfo::EUnknown;
|
|
1861 |
TMockLtsyData1<RMmCustomAPI::TMmCellInfo *> modesData1(completeInfo);
|
|
1862 |
data.Close();
|
|
1863 |
modesData1.SerialiseL(data);
|
|
1864 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCellInfoChangedIndId, KErrNone, data);
|
|
1865 |
|
|
1866 |
// Check results
|
|
1867 |
User::WaitForRequest(requestStatus);
|
|
1868 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1869 |
ASSERT_EQUALS((*completeInfo).iMode, (*notifyInfo).iMode);
|
|
1870 |
|
|
1871 |
// Register a notifier
|
|
1872 |
customApi.NotifyCellInfoChange(requestStatus, *notifyInfoPckg);
|
|
1873 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1874 |
|
|
1875 |
// Indicate cell changed to GSM cell with some info
|
|
1876 |
(*completeInfo).iMode = RMmCustomAPI::TMmCellInfo::EGSM;
|
|
1877 |
(*completeInfo).iGsmCellInfo.iTA = 17;
|
|
1878 |
(*completeInfo).iGsmCellInfo.iNmr[13].iARFCN = 4;
|
|
1879 |
(*completeInfo).iGsmCellInfo.iNmr[8].iBSIC = 44;
|
|
1880 |
(*completeInfo).iGsmCellInfo.iNmr[11].iRxLEV = 100;
|
|
1881 |
TMockLtsyData1<RMmCustomAPI::TMmCellInfo> modesData2(*completeInfo);
|
|
1882 |
data.Close();
|
|
1883 |
modesData2.SerialiseL(data);
|
|
1884 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCellInfoChangedIndId, KErrNone, data);
|
|
1885 |
|
|
1886 |
// Check results
|
|
1887 |
User::WaitForRequest(requestStatus);
|
|
1888 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1889 |
ASSERT_EQUALS((*completeInfo).iMode, (*notifyInfo).iMode);
|
|
1890 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iTA, (*notifyInfo).iGsmCellInfo.iTA);
|
|
1891 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iNmr[13].iARFCN, (*notifyInfo).iGsmCellInfo.iNmr[13].iARFCN);
|
|
1892 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iNmr[8].iBSIC, (*notifyInfo).iGsmCellInfo.iNmr[8].iBSIC);
|
|
1893 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iNmr[11].iRxLEV, (*notifyInfo).iGsmCellInfo.iNmr[11].iRxLEV);
|
|
1894 |
|
|
1895 |
// Register a notifier
|
|
1896 |
customApi.NotifyCellInfoChange(requestStatus, *notifyInfoPckg);
|
|
1897 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1898 |
|
|
1899 |
// Indicate cell changed to WCDMA cell with some info
|
|
1900 |
(*completeInfo).iMode = RMmCustomAPI::TMmCellInfo::EWCDMA;
|
|
1901 |
(*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddUL = 33;
|
|
1902 |
(*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddDL = 42;
|
|
1903 |
(*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iTddNt = 18;
|
|
1904 |
(*completeInfo).iWcdmaCellInfo.iPrimaryScrambilingCode = 100;
|
|
1905 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[2].iFrequencyInfo.iFddUL = 311;
|
|
1906 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[4].iFrequencyInfo.iFddDL = 11;
|
|
1907 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[5].iCarrierRSSI = 25;
|
|
1908 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[7].iCellMeasuredResult[3].iCID = 25;
|
|
1909 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[7].iCellMeasuredResult[30].iTddInfo.iPrimaryCcpchRscp = 5;
|
|
1910 |
TMockLtsyData1<RMmCustomAPI::TMmCellInfo> modesData3(*completeInfo);
|
|
1911 |
data.Close();
|
|
1912 |
modesData3.SerialiseL(data);
|
|
1913 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCellInfoChangedIndId, KErrNone, data);
|
|
1914 |
|
|
1915 |
// Check results
|
|
1916 |
User::WaitForRequest(requestStatus);
|
|
1917 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1918 |
ASSERT_EQUALS((*completeInfo).iMode, (*notifyInfo).iMode );
|
|
1919 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddUL, (*notifyInfo).iWcdmaCellInfo.iFrequencyInfo.iFddUL );
|
|
1920 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddDL, (*notifyInfo).iWcdmaCellInfo.iFrequencyInfo.iFddDL );
|
|
1921 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iTddNt, (*notifyInfo).iWcdmaCellInfo.iFrequencyInfo.iTddNt );
|
|
1922 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iPrimaryScrambilingCode, (*notifyInfo).iWcdmaCellInfo.iPrimaryScrambilingCode );
|
|
1923 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[2].iFrequencyInfo.iFddUL, (*notifyInfo).iWcdmaCellInfo.iNwkMeasureReport[2].iFrequencyInfo.iFddUL );
|
|
1924 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[4].iFrequencyInfo.iFddDL, (*notifyInfo).iWcdmaCellInfo.iNwkMeasureReport[4].iFrequencyInfo.iFddDL );
|
|
1925 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[5].iCarrierRSSI, (*notifyInfo).iWcdmaCellInfo.iNwkMeasureReport[5].iCarrierRSSI );
|
|
1926 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[7].iCellMeasuredResult[3].iCID, (*notifyInfo).iWcdmaCellInfo.iNwkMeasureReport[7].iCellMeasuredResult[3].iCID );
|
|
1927 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[7].iCellMeasuredResult[30].iTddInfo.iPrimaryCcpchRscp, (*notifyInfo).iWcdmaCellInfo.iNwkMeasureReport[7].iCellMeasuredResult[30].iTddInfo.iPrimaryCcpchRscp );
|
|
1928 |
|
|
1929 |
// expect a GetCellInfo request
|
|
1930 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCellInfo::KLtsyDispatchPhoneGetCellInfoApiId, KErrNone);
|
|
1931 |
|
|
1932 |
// execute the GetCellInfo request
|
|
1933 |
customApi.GetCellInfo(requestStatus, *getInfoPckg);
|
|
1934 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1935 |
|
|
1936 |
// Complete with unknown cell info
|
|
1937 |
(*completeInfo).iMode = RMmCustomAPI::TMmCellInfo::EUnknown;
|
|
1938 |
TMockLtsyData1<RMmCustomAPI::TMmCellInfo> modesData4(*completeInfo);
|
|
1939 |
data.Close();
|
|
1940 |
modesData4.SerialiseL(data);
|
|
1941 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCellInfo::KLtsyDispatchPhoneGetCellInfoApiId, KErrNone, data);
|
|
1942 |
|
|
1943 |
// Check results
|
|
1944 |
User::WaitForRequest(requestStatus);
|
|
1945 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1946 |
ASSERT_EQUALS((*completeInfo).iMode, (*getInfo).iMode);
|
|
1947 |
|
|
1948 |
// expect a GetCellInfo request
|
|
1949 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCellInfo::KLtsyDispatchPhoneGetCellInfoApiId, KErrNone);
|
|
1950 |
|
|
1951 |
// execute the GetCellInfo request
|
|
1952 |
customApi.GetCellInfo(requestStatus, *getInfoPckg);
|
|
1953 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1954 |
|
|
1955 |
// Complete with an GSM cell info
|
|
1956 |
(*completeInfo).iMode = RMmCustomAPI::TMmCellInfo::EGSM;
|
|
1957 |
(*completeInfo).iGsmCellInfo.iTA = 1;
|
|
1958 |
(*completeInfo).iGsmCellInfo.iNmr[1].iARFCN = 2;
|
|
1959 |
(*completeInfo).iGsmCellInfo.iNmr[2].iBSIC = 3;
|
|
1960 |
(*completeInfo).iGsmCellInfo.iNmr[7].iRxLEV = 4;
|
|
1961 |
TMockLtsyData1<RMmCustomAPI::TMmCellInfo> modesData5(*completeInfo);
|
|
1962 |
data.Close();
|
|
1963 |
modesData1.SerialiseL(data);
|
|
1964 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCellInfo::KLtsyDispatchPhoneGetCellInfoApiId, KErrNone, data);
|
|
1965 |
|
|
1966 |
// Check results
|
|
1967 |
User::WaitForRequest(requestStatus);
|
|
1968 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1969 |
ASSERT_EQUALS((*completeInfo).iMode, (*getInfo).iMode);
|
|
1970 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iTA, (*getInfo).iGsmCellInfo.iTA);
|
|
1971 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iNmr[1].iARFCN, (*getInfo).iGsmCellInfo.iNmr[1].iARFCN);
|
|
1972 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iNmr[2].iBSIC, (*getInfo).iGsmCellInfo.iNmr[2].iBSIC);
|
|
1973 |
ASSERT_EQUALS((*completeInfo).iGsmCellInfo.iNmr[7].iRxLEV, (*getInfo).iGsmCellInfo.iNmr[7].iRxLEV);
|
|
1974 |
|
|
1975 |
// expect a GetCellInfo request
|
|
1976 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCellInfo::KLtsyDispatchPhoneGetCellInfoApiId, KErrNone);
|
|
1977 |
|
|
1978 |
// execute the GetCellInfo request
|
|
1979 |
customApi.GetCellInfo(requestStatus, *getInfoPckg);
|
|
1980 |
ASSERT_EQUALS(KRequestPending, requestStatus.Int());
|
|
1981 |
|
|
1982 |
// Complete with an WCDMA cell info
|
|
1983 |
(*completeInfo).iMode = RMmCustomAPI::TMmCellInfo::EWCDMA;
|
|
1984 |
(*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddUL = 11;
|
|
1985 |
(*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddDL = 12;
|
|
1986 |
(*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iTddNt = 13;
|
|
1987 |
(*completeInfo).iWcdmaCellInfo.iPrimaryScrambilingCode = 14;
|
|
1988 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[1].iFrequencyInfo.iFddUL = 1;
|
|
1989 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[2].iFrequencyInfo.iFddDL = 2;
|
|
1990 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[3].iCarrierRSSI = 3;
|
|
1991 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[4].iCellMeasuredResult[1].iCID = 6;
|
|
1992 |
(*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[5].iCellMeasuredResult[2].iTddInfo.iPrimaryCcpchRscp = 8;
|
|
1993 |
TMockLtsyData1<RMmCustomAPI::TMmCellInfo> modesData6(*completeInfo);
|
|
1994 |
data.Close();
|
|
1995 |
modesData1.SerialiseL(data);
|
|
1996 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCellInfo::KLtsyDispatchPhoneGetCellInfoApiId, KErrNone, data);
|
|
1997 |
|
|
1998 |
// Check results
|
|
1999 |
User::WaitForRequest(requestStatus);
|
|
2000 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
2001 |
ASSERT_EQUALS((*completeInfo).iMode, (*getInfo).iMode);
|
|
2002 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddUL, (*getInfo).iWcdmaCellInfo.iFrequencyInfo.iFddUL );
|
|
2003 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iFddDL, (*getInfo).iWcdmaCellInfo.iFrequencyInfo.iFddDL );
|
|
2004 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iFrequencyInfo.iTddNt, (*getInfo).iWcdmaCellInfo.iFrequencyInfo.iTddNt );
|
|
2005 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iPrimaryScrambilingCode, (*getInfo).iWcdmaCellInfo.iPrimaryScrambilingCode );
|
|
2006 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[1].iFrequencyInfo.iFddUL, (*getInfo).iWcdmaCellInfo.iNwkMeasureReport[1].iFrequencyInfo.iFddUL );
|
|
2007 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[2].iFrequencyInfo.iFddDL, (*getInfo).iWcdmaCellInfo.iNwkMeasureReport[2].iFrequencyInfo.iFddDL );
|
|
2008 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[3].iCarrierRSSI, (*getInfo).iWcdmaCellInfo.iNwkMeasureReport[3].iCarrierRSSI );
|
|
2009 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[4].iCellMeasuredResult[1].iCID, (*getInfo).iWcdmaCellInfo.iNwkMeasureReport[4].iCellMeasuredResult[1].iCID );
|
|
2010 |
ASSERT_EQUALS((*completeInfo).iWcdmaCellInfo.iNwkMeasureReport[5].iCellMeasuredResult[2].iTddInfo.iPrimaryCcpchRscp, (*getInfo).iWcdmaCellInfo.iNwkMeasureReport[5].iCellMeasuredResult[2].iTddInfo.iPrimaryCcpchRscp );
|
|
2011 |
|
|
2012 |
CleanupStack::PopAndDestroy(8, this); // getInfoPckg, getInfo, notifyInfoPckg, notifyInfo, completeInfo, data, customApi, this
|
|
2013 |
}
|
|
2014 |
|
|
2015 |
/**
|
|
2016 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0026
|
|
2017 |
@SYMComponent telephony_ctsy
|
|
2018 |
@SYMTestCaseDesc Test correct function of RMobilePhone::NotifyCellInfoChange() RMobilePhone::GetCellInfo()
|
|
2019 |
@SYMTestPriority High
|
|
2020 |
@SYMTestActions Invokes NotifyCellInfoChange, GetCellInfo
|
|
2021 |
@SYMTestExpectedResults Pass
|
|
2022 |
@SYMTestType UT
|
|
2023 |
*/
|
|
2024 |
void CCTsyPhoneFU::TestUnit0026L()
|
|
2025 |
{
|
|
2026 |
OpenEtelServerL(EUseExtendedError);
|
|
2027 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2028 |
|
|
2029 |
RBuf8 data;
|
|
2030 |
CleanupClosePushL(data);
|
|
2031 |
|
|
2032 |
OpenPhoneL();
|
|
2033 |
|
|
2034 |
RMobilePhone::TMobilePhoneCellInfoV9 returnCellInfo;
|
|
2035 |
TMockLtsyData1<RMobilePhone::TMobilePhoneCellInfoV9> cellInfoCompData(returnCellInfo);
|
|
2036 |
|
|
2037 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneRegisterCellInfoChangeNotification::KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId);
|
|
2038 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneRegisterCellInfoChangeNotification::KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId, KErrNone);
|
|
2039 |
|
|
2040 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetPhoneCellInfo::KLtsyDispatchPhoneGetPhoneCellInfoApiId);
|
|
2041 |
|
|
2042 |
returnCellInfo.iMode = RMobilePhone::ECellModeGsm;
|
|
2043 |
returnCellInfo.iCellId = 1;
|
|
2044 |
returnCellInfo.iTimingAdvance = 123;
|
|
2045 |
returnCellInfo.iStatus = RMobilePhone::ECellInfoStatusCurrent;
|
|
2046 |
cellInfoCompData.SerialiseL(data);
|
|
2047 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetPhoneCellInfo::KLtsyDispatchPhoneGetPhoneCellInfoApiId, KErrNone, data);
|
|
2048 |
data.Close();
|
|
2049 |
|
|
2050 |
//client side will be notified when a CellInfoChange has occurred, the first time called will result in
|
|
2051 |
//a NotifyCellInfo Request to inform the LTSY we are interested in these notifications
|
|
2052 |
TRequestStatus notifyCellInfoChangeReqStatus;
|
|
2053 |
RMobilePhone::TMobilePhoneCellInfoV9 cellInfo;
|
|
2054 |
RMobilePhone::TMobilePhoneCellInfoV9Pckg cellInfoPckg(cellInfo);
|
|
2055 |
iPhone.NotifyCellInfoChange(notifyCellInfoChangeReqStatus,cellInfoPckg);
|
|
2056 |
|
|
2057 |
TRequestStatus getCellInfoReqStatus;
|
|
2058 |
RMobilePhone::TMobilePhoneCellInfoV9 cellInfo2;
|
|
2059 |
RMobilePhone::TMobilePhoneCellInfoV9Pckg cellInfoPckg2(cellInfo2);
|
|
2060 |
iPhone.GetCellInfo(getCellInfoReqStatus,cellInfoPckg2);
|
|
2061 |
|
|
2062 |
User::WaitForRequest(notifyCellInfoChangeReqStatus);
|
|
2063 |
User::WaitForRequest(getCellInfoReqStatus);
|
|
2064 |
ASSERT_EQUALS(notifyCellInfoChangeReqStatus.Int(),KErrNone);
|
|
2065 |
ASSERT_EQUALS(getCellInfoReqStatus.Int(),KErrNone);
|
|
2066 |
|
|
2067 |
ASSERT_EQUALS(returnCellInfo.iMode, cellInfo.iMode);
|
|
2068 |
ASSERT_EQUALS(returnCellInfo.iCellId, cellInfo.iCellId);
|
|
2069 |
ASSERT_EQUALS(returnCellInfo.iTimingAdvance, cellInfo.iTimingAdvance);
|
|
2070 |
ASSERT_EQUALS(returnCellInfo.iStatus, cellInfo.iStatus);
|
|
2071 |
|
|
2072 |
ASSERT_EQUALS(returnCellInfo.iMode, cellInfo2.iMode);
|
|
2073 |
ASSERT_EQUALS(returnCellInfo.iCellId, cellInfo2.iCellId);
|
|
2074 |
ASSERT_EQUALS(returnCellInfo.iTimingAdvance, cellInfo2.iTimingAdvance);
|
|
2075 |
ASSERT_EQUALS(returnCellInfo.iStatus, cellInfo2.iStatus);
|
|
2076 |
|
|
2077 |
AssertMockLtsyStatusL();
|
|
2078 |
|
|
2079 |
//now a second get, the value is in the cach (rest cellInfo first)
|
|
2080 |
cellInfo.iMode = RMobilePhone::ECellModeUnknown;
|
|
2081 |
cellInfo.iCellId = 0;
|
|
2082 |
cellInfo.iTimingAdvance = 0;
|
|
2083 |
cellInfo.iStatus = RMobilePhone::ECellInfoStatusUnknown;
|
|
2084 |
iPhone.GetCellInfo(getCellInfoReqStatus,cellInfoPckg);
|
|
2085 |
User::WaitForRequest(getCellInfoReqStatus);
|
|
2086 |
ASSERT_EQUALS(getCellInfoReqStatus.Int(),KErrNone);
|
|
2087 |
ASSERT_EQUALS(returnCellInfo.iMode, cellInfo.iMode);
|
|
2088 |
ASSERT_EQUALS(returnCellInfo.iCellId, cellInfo.iCellId);
|
|
2089 |
ASSERT_EQUALS(returnCellInfo.iTimingAdvance, cellInfo.iTimingAdvance);
|
|
2090 |
ASSERT_EQUALS(returnCellInfo.iStatus, cellInfo.iStatus);
|
|
2091 |
|
|
2092 |
AssertMockLtsyStatusL();
|
|
2093 |
|
|
2094 |
// an unsolicited cellInfo change, with KErrNone
|
|
2095 |
returnCellInfo.iMode = RMobilePhone::ECellModeWcdma;
|
|
2096 |
returnCellInfo.iCellId = 2;
|
|
2097 |
returnCellInfo.iTimingAdvance = 124;
|
|
2098 |
returnCellInfo.iStatus = RMobilePhone::ECellInfoStatusNotCurrent;
|
|
2099 |
cellInfoCompData.SerialiseL(data);
|
|
2100 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCellInfoChangeIndId, KErrNone, data);
|
|
2101 |
data.Close();
|
|
2102 |
|
|
2103 |
//reset the return data
|
|
2104 |
cellInfo.iMode = RMobilePhone::ECellModeUnknown;
|
|
2105 |
cellInfo.iCellId = 0;
|
|
2106 |
cellInfo.iTimingAdvance = 0;
|
|
2107 |
cellInfo.iStatus = RMobilePhone::ECellInfoStatusUnknown;
|
|
2108 |
iPhone.NotifyCellInfoChange(notifyCellInfoChangeReqStatus,cellInfoPckg);
|
|
2109 |
User::WaitForRequest(notifyCellInfoChangeReqStatus);
|
|
2110 |
ASSERT_EQUALS(notifyCellInfoChangeReqStatus.Int(),KErrNone);
|
|
2111 |
ASSERT_EQUALS(returnCellInfo.iMode, cellInfo.iMode);
|
|
2112 |
ASSERT_EQUALS(returnCellInfo.iCellId, cellInfo.iCellId);
|
|
2113 |
ASSERT_EQUALS(returnCellInfo.iTimingAdvance, cellInfo.iTimingAdvance);
|
|
2114 |
ASSERT_EQUALS(returnCellInfo.iStatus, cellInfo.iStatus);
|
|
2115 |
|
|
2116 |
AssertMockLtsyStatusL();
|
|
2117 |
|
|
2118 |
//an unsolicited cellInfo change, with KErrGeneral, the cache is now marked as dirty
|
|
2119 |
cellInfoCompData.SerialiseL(data);
|
|
2120 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCellInfoChangeIndId, KErrGeneral, data);
|
|
2121 |
data.Close();
|
|
2122 |
|
|
2123 |
iPhone.NotifyCellInfoChange(notifyCellInfoChangeReqStatus,cellInfoPckg);
|
|
2124 |
User::WaitForRequest(notifyCellInfoChangeReqStatus);
|
|
2125 |
ASSERT_EQUALS(notifyCellInfoChangeReqStatus.Int(),KErrGeneral);
|
|
2126 |
|
|
2127 |
AssertMockLtsyStatusL();
|
|
2128 |
|
|
2129 |
//a client side GetCellInfo call (post the cache being marked dirty), KErrGeneral returned
|
|
2130 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetPhoneCellInfo::KLtsyDispatchPhoneGetPhoneCellInfoApiId);
|
|
2131 |
returnCellInfo.iMode = RMobilePhone::ECellModeGsm;
|
|
2132 |
returnCellInfo.iCellId = 1;
|
|
2133 |
returnCellInfo.iTimingAdvance = 123;
|
|
2134 |
returnCellInfo.iStatus = RMobilePhone::ECellInfoStatusCurrent;
|
|
2135 |
cellInfoCompData.SerialiseL(data);
|
|
2136 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetPhoneCellInfo::KLtsyDispatchPhoneGetPhoneCellInfoApiId, KErrGeneral, data);
|
|
2137 |
data.Close();
|
|
2138 |
|
|
2139 |
iPhone.GetCellInfo(getCellInfoReqStatus,cellInfoPckg);
|
|
2140 |
User::WaitForRequest(getCellInfoReqStatus);
|
|
2141 |
ASSERT_EQUALS(getCellInfoReqStatus.Int(),KErrGeneral);
|
|
2142 |
|
|
2143 |
AssertMockLtsyStatusL();
|
|
2144 |
|
|
2145 |
|
|
2146 |
//an unsolicited cellInfo change, with KErrNone, the cache is now marked as clean
|
|
2147 |
cellInfoCompData.SerialiseL(data);
|
|
2148 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyCellInfoChangeIndId, KErrNone, data);
|
|
2149 |
data.Close();
|
|
2150 |
|
|
2151 |
//reset the return data
|
|
2152 |
cellInfo.iMode = RMobilePhone::ECellModeUnknown;
|
|
2153 |
cellInfo.iCellId = 0;
|
|
2154 |
cellInfo.iTimingAdvance = 0;
|
|
2155 |
cellInfo.iStatus = RMobilePhone::ECellInfoStatusUnknown;
|
|
2156 |
iPhone.NotifyCellInfoChange(notifyCellInfoChangeReqStatus,cellInfoPckg);
|
|
2157 |
User::WaitForRequest(notifyCellInfoChangeReqStatus);
|
|
2158 |
ASSERT_EQUALS(notifyCellInfoChangeReqStatus.Int(),KErrNone);
|
|
2159 |
ASSERT_EQUALS(returnCellInfo.iMode, cellInfo.iMode);
|
|
2160 |
ASSERT_EQUALS(returnCellInfo.iCellId, cellInfo.iCellId);
|
|
2161 |
ASSERT_EQUALS(returnCellInfo.iTimingAdvance, cellInfo.iTimingAdvance);
|
|
2162 |
ASSERT_EQUALS(returnCellInfo.iStatus, cellInfo.iStatus);
|
|
2163 |
|
|
2164 |
AssertMockLtsyStatusL();
|
|
2165 |
|
|
2166 |
//finally a cached get.
|
|
2167 |
//reset the return data
|
|
2168 |
cellInfo.iMode = RMobilePhone::ECellModeUnknown;
|
|
2169 |
cellInfo.iCellId = 0;
|
|
2170 |
cellInfo.iTimingAdvance = 0;
|
|
2171 |
cellInfo.iStatus = RMobilePhone::ECellInfoStatusUnknown;
|
|
2172 |
iPhone.GetCellInfo(getCellInfoReqStatus,cellInfoPckg);
|
|
2173 |
User::WaitForRequest(getCellInfoReqStatus);
|
|
2174 |
ASSERT_EQUALS(getCellInfoReqStatus.Int(),KErrNone);
|
|
2175 |
ASSERT_EQUALS(returnCellInfo.iMode, cellInfo.iMode);
|
|
2176 |
ASSERT_EQUALS(returnCellInfo.iCellId, cellInfo.iCellId);
|
|
2177 |
ASSERT_EQUALS(returnCellInfo.iTimingAdvance, cellInfo.iTimingAdvance);
|
|
2178 |
ASSERT_EQUALS(returnCellInfo.iStatus, cellInfo.iStatus);
|
|
2179 |
|
|
2180 |
AssertMockLtsyStatusL();
|
|
2181 |
|
|
2182 |
|
|
2183 |
CleanupStack::PopAndDestroy(&data);
|
|
2184 |
CleanupStack::PopAndDestroy(this);
|
|
2185 |
|
|
2186 |
}
|
|
2187 |
|
|
2188 |
/**
|
|
2189 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0027
|
|
2190 |
@SYMComponent telephony_ctsy
|
|
2191 |
@SYMTestCaseDesc Test correct function of RMobilePhone::NotifyCellInfoChange()
|
|
2192 |
@SYMTestPriority High
|
|
2193 |
@SYMTestActions Invokes NotifyCellInfoChange,with a complete error case
|
|
2194 |
@SYMTestExpectedResults Pass
|
|
2195 |
@SYMTestType UT
|
|
2196 |
*/
|
|
2197 |
void CCTsyPhoneFU::TestUnit0027L()
|
|
2198 |
{
|
|
2199 |
OpenEtelServerL(EUseExtendedError);
|
|
2200 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2201 |
|
|
2202 |
RBuf8 data;
|
|
2203 |
CleanupClosePushL(data);
|
|
2204 |
|
|
2205 |
OpenPhoneL();
|
|
2206 |
|
|
2207 |
//test the complete of NotifyCellInfoChange with an error, this is in a differnet test case
|
|
2208 |
//as the IPC is only fired the first time a NotifyCellInfoChange is called as the
|
|
2209 |
//Cache Ability is set ECacheUnknown
|
|
2210 |
|
|
2211 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneRegisterCellInfoChangeNotification::KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId);
|
|
2212 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneRegisterCellInfoChangeNotification::KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId, KErrGeneral);
|
|
2213 |
|
|
2214 |
TRequestStatus notifyCellInfoChangeReqStatus;
|
|
2215 |
RMobilePhone::TMobilePhoneCellInfoV9 cellInfo;
|
|
2216 |
RMobilePhone::TMobilePhoneCellInfoV9Pckg cellInfoPckg(cellInfo);
|
|
2217 |
iPhone.NotifyCellInfoChange(notifyCellInfoChangeReqStatus,cellInfoPckg);
|
|
2218 |
User::WaitForRequest(notifyCellInfoChangeReqStatus);
|
|
2219 |
ASSERT_EQUALS(notifyCellInfoChangeReqStatus.Int(),KErrGeneral);
|
|
2220 |
|
|
2221 |
AssertMockLtsyStatusL();
|
|
2222 |
|
|
2223 |
CleanupStack::PopAndDestroy(&data);
|
|
2224 |
CleanupStack::PopAndDestroy(this);
|
|
2225 |
}
|
|
2226 |
|
|
2227 |
/**
|
|
2228 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0028
|
|
2229 |
@SYMComponent telephony_ctsy
|
|
2230 |
@SYMTestCaseDesc Test correct function of RMmCustomAPI::GetUSIMServiceSupport()
|
|
2231 |
@SYMTestPriority High
|
|
2232 |
@SYMTestActions Invokes GetUSIMServiceSupport, in KErrNone and KErrGeneral complete cases
|
|
2233 |
@SYMTestExpectedResults Pass
|
|
2234 |
@SYMTestType UT
|
|
2235 |
*/
|
|
2236 |
void CCTsyPhoneFU::TestUnit0028L()
|
|
2237 |
{
|
|
2238 |
OpenEtelServerL(EUseExtendedError);
|
|
2239 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2240 |
|
|
2241 |
TRequestStatus reqStatus;
|
|
2242 |
|
|
2243 |
RBuf8 data;
|
|
2244 |
CleanupClosePushL(data);
|
|
2245 |
|
|
2246 |
OpenPhoneL();
|
|
2247 |
|
|
2248 |
RMmCustomAPI customApi;
|
|
2249 |
OpenCustomApiLC(customApi);
|
|
2250 |
|
|
2251 |
//test a Get Usim Service Support with KErrNone completion
|
|
2252 |
|
|
2253 |
TInt applicationNumber = 101;
|
|
2254 |
TBool supported = ETrue;
|
|
2255 |
|
|
2256 |
TMockLtsyData1<TInt> getUsimServiceSupportExpData(applicationNumber);
|
|
2257 |
getUsimServiceSupportExpData.SerialiseL(data);
|
|
2258 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetUsimServiceSupport::KLtsyDispatchPhoneGetUsimServiceSupportApiId, data);
|
|
2259 |
data.Close();
|
|
2260 |
|
|
2261 |
TMockLtsyData2<TInt, TBool> getUsimServiceSupportCompData(applicationNumber, supported);
|
|
2262 |
getUsimServiceSupportCompData.SerialiseL(data);
|
|
2263 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetUsimServiceSupport::KLtsyDispatchPhoneGetUsimServiceSupportApiId, KErrNone, data);
|
|
2264 |
data.Close();
|
|
2265 |
|
|
2266 |
RMmCustomAPI::TAppSupport usimSupport;
|
|
2267 |
usimSupport.iAppNum = applicationNumber; //in
|
|
2268 |
usimSupport.iSupported = EFalse; //out
|
|
2269 |
customApi.GetUSIMServiceSupport(reqStatus, usimSupport);
|
|
2270 |
User::WaitForRequest(reqStatus);
|
|
2271 |
ASSERT_EQUALS(reqStatus.Int(),KErrNone);
|
|
2272 |
ASSERT_EQUALS(usimSupport.iAppNum,applicationNumber);
|
|
2273 |
ASSERT_EQUALS(usimSupport.iSupported,supported);
|
|
2274 |
|
|
2275 |
AssertMockLtsyStatusL();
|
|
2276 |
|
|
2277 |
//test a Get Usim Service Support with KErrGeneral completion
|
|
2278 |
|
|
2279 |
applicationNumber = 102;
|
|
2280 |
supported = EFalse;
|
|
2281 |
|
|
2282 |
getUsimServiceSupportExpData.SerialiseL(data);
|
|
2283 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetUsimServiceSupport::KLtsyDispatchPhoneGetUsimServiceSupportApiId, data);
|
|
2284 |
data.Close();
|
|
2285 |
|
|
2286 |
getUsimServiceSupportCompData.SerialiseL(data);
|
|
2287 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetUsimServiceSupport::KLtsyDispatchPhoneGetUsimServiceSupportApiId, KErrGeneral, data);
|
|
2288 |
data.Close();
|
|
2289 |
|
|
2290 |
|
|
2291 |
usimSupport.iAppNum = applicationNumber; //in
|
|
2292 |
usimSupport.iSupported = ETrue; //out
|
|
2293 |
customApi.GetUSIMServiceSupport(reqStatus, usimSupport);
|
|
2294 |
User::WaitForRequest(reqStatus);
|
|
2295 |
ASSERT_EQUALS(reqStatus.Int(),KErrGeneral);
|
|
2296 |
ASSERT_EQUALS(usimSupport.iAppNum,applicationNumber);
|
|
2297 |
ASSERT_EQUALS(usimSupport.iSupported, static_cast<TBool>(ETrue)); //i.e. not set to EFalse from the complete
|
|
2298 |
|
|
2299 |
AssertMockLtsyStatusL();
|
|
2300 |
|
|
2301 |
CleanupStack::PopAndDestroy(&customApi);
|
|
2302 |
CleanupStack::PopAndDestroy(&data);
|
|
2303 |
CleanupStack::PopAndDestroy(this);
|
|
2304 |
}
|
|
2305 |
|
|
2306 |
/**
|
|
2307 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0029
|
|
2308 |
@SYMComponent telephony_ctsy
|
|
2309 |
@SYMTestCaseDesc Test correct function of RMobilePhone::GetCurrentActiveUSimApplication()
|
|
2310 |
@SYMTestPriority High
|
|
2311 |
@SYMTestActions Invokes GetCurrentActiveUSimApplication, in KErrNone and KErrGeneral complete cases
|
|
2312 |
@SYMTestExpectedResults Pass
|
|
2313 |
@SYMTestType UT
|
|
2314 |
*/
|
|
2315 |
void CCTsyPhoneFU::TestUnit0029L()
|
|
2316 |
{
|
|
2317 |
OpenEtelServerL(EUseExtendedError);
|
|
2318 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2319 |
|
|
2320 |
TRequestStatus reqStatus;
|
|
2321 |
|
|
2322 |
RBuf8 data;
|
|
2323 |
CleanupClosePushL(data);
|
|
2324 |
|
|
2325 |
OpenPhoneL();
|
|
2326 |
|
|
2327 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCurrentActiveUsimApplication::KLtsyDispatchPhoneGetCurrentActiveUsimApplicationApiId);
|
|
2328 |
|
|
2329 |
RMobilePhone::TAID comopAid(_L8("AID_DATA"));
|
|
2330 |
|
|
2331 |
TDesC8* aidPtr = &comopAid;
|
|
2332 |
TMockLtsyData1<TDesC8*> getCurrentActiveUsimAppCompData(aidPtr);
|
|
2333 |
getCurrentActiveUsimAppCompData.SerialiseL(data);
|
|
2334 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCurrentActiveUsimApplication::KLtsyDispatchPhoneGetCurrentActiveUsimApplicationApiId, KErrNone, data);
|
|
2335 |
data.Close();
|
|
2336 |
|
|
2337 |
RMobilePhone::TAID aid;
|
|
2338 |
iPhone.GetCurrentActiveUSimApplication(reqStatus,aid);
|
|
2339 |
User::WaitForRequest(reqStatus);
|
|
2340 |
ASSERT_EQUALS(reqStatus.Int(), KErrNone);
|
|
2341 |
ASSERT_EQUALS(comopAid, aid);
|
|
2342 |
AssertMockLtsyStatusL();
|
|
2343 |
|
|
2344 |
|
|
2345 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetCurrentActiveUsimApplication::KLtsyDispatchPhoneGetCurrentActiveUsimApplicationApiId);
|
|
2346 |
|
|
2347 |
getCurrentActiveUsimAppCompData.SerialiseL(data);
|
|
2348 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetCurrentActiveUsimApplication::KLtsyDispatchPhoneGetCurrentActiveUsimApplicationApiId, KErrGeneral, data);
|
|
2349 |
data.Close();
|
|
2350 |
|
|
2351 |
aid.Zero();
|
|
2352 |
iPhone.GetCurrentActiveUSimApplication(reqStatus,aid);
|
|
2353 |
User::WaitForRequest(reqStatus);
|
|
2354 |
ASSERT_EQUALS(reqStatus.Int(), KErrGeneral);
|
|
2355 |
ASSERT_EQUALS(comopAid, aid); //aid still copied
|
|
2356 |
AssertMockLtsyStatusL();
|
|
2357 |
|
|
2358 |
CleanupStack::PopAndDestroy(&data);
|
|
2359 |
CleanupStack::PopAndDestroy(this);
|
|
2360 |
}
|
|
2361 |
|
|
2362 |
|
|
2363 |
/**
|
|
2364 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0030
|
|
2365 |
@SYMComponent telephony_ctsy
|
|
2366 |
@SYMTestCaseDesc Test correct function of RMobilePhone::TerminateAllCalls()
|
|
2367 |
@SYMTestPriority High
|
|
2368 |
@SYMTestActions Invokes RMobilePhone::TerminateAllCalls
|
|
2369 |
@SYMTestExpectedResults Pass
|
|
2370 |
@SYMTestType UT
|
|
2371 |
*/
|
|
2372 |
void CCTsyPhoneFU::TestUnit0030L()
|
|
2373 |
{
|
|
2374 |
OpenEtelServerL(EUseExtendedError);
|
|
2375 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2376 |
|
|
2377 |
TRequestStatus requestStatus;
|
|
2378 |
|
|
2379 |
RBuf8 data;
|
|
2380 |
CleanupClosePushL(data);
|
|
2381 |
|
|
2382 |
OpenPhoneL();
|
|
2383 |
|
|
2384 |
|
|
2385 |
TInt callId = 1;
|
|
2386 |
RMobilePhone::TMobileService mobileService = RMobilePhone::EVoiceService;
|
|
2387 |
DriverDialCallL(callId, mobileService);
|
|
2388 |
|
|
2389 |
TInt callIdHangUp = 0; //callId is provided if a call is in connecting state; else 0
|
|
2390 |
TMockLtsyData1<TInt> mockData(callIdHangUp);
|
|
2391 |
mockData.SerialiseL(data);
|
|
2392 |
|
|
2393 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneTerminateAllCalls::KLtsyDispatchPhoneTerminateAllCallsApiId, data);
|
|
2394 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneTerminateAllCalls::KLtsyDispatchPhoneTerminateAllCallsApiId, KErrNone);
|
|
2395 |
data.Close();
|
|
2396 |
|
|
2397 |
TInt hangUpCause = KErrGsmCCNormalCallClearing; // Hang up cause for normal hang up
|
|
2398 |
DriverHangUpCallL(callId, hangUpCause, ETrue);
|
|
2399 |
|
|
2400 |
|
|
2401 |
// Client Side Test
|
|
2402 |
|
|
2403 |
RMobileLine mobileLine;
|
|
2404 |
CleanupClosePushL(mobileLine);
|
|
2405 |
RMobileCall mobileCall;
|
|
2406 |
CleanupClosePushL(mobileCall);
|
|
2407 |
ClientDialCallL(mobileLine, mobileCall, mobileService);
|
|
2408 |
|
|
2409 |
|
|
2410 |
TRequestStatus reqStatusTerminated;
|
|
2411 |
iMockLTSY.NotifyTerminated(reqStatusTerminated);
|
|
2412 |
|
|
2413 |
iPhone.TerminateAllCalls(requestStatus);
|
|
2414 |
User::WaitForRequest(requestStatus);
|
|
2415 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
2416 |
|
|
2417 |
ClientHangUpCallL(mobileCall);
|
|
2418 |
|
|
2419 |
User::WaitForRequest(reqStatusTerminated);
|
|
2420 |
ASSERT_EQUALS(KErrNone, reqStatusTerminated.Int());
|
|
2421 |
|
|
2422 |
AssertMockLtsyStatusL();
|
|
2423 |
|
|
2424 |
mobileCall.Close();
|
|
2425 |
mobileLine.Close();
|
|
2426 |
|
|
2427 |
AssertMockLtsyStatusL();
|
|
2428 |
|
|
2429 |
CleanupStack::PopAndDestroy(&mobileCall);
|
|
2430 |
CleanupStack::PopAndDestroy(&mobileLine);
|
|
2431 |
CleanupStack::PopAndDestroy(&data);
|
|
2432 |
CleanupStack::PopAndDestroy(this);
|
|
2433 |
}
|
|
2434 |
|
|
2435 |
|
|
2436 |
/**
|
|
2437 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0031
|
|
2438 |
@SYMComponent telephony_ctsy
|
|
2439 |
@SYMTestCaseDesc Test correct function of RMmCustomAPI::GetSystemNetworkBand() and RMmCustomAPI::SetSystemNetworkBand()
|
|
2440 |
@SYMTestPriority High
|
|
2441 |
@SYMTestActions Invokes RMmCustomAPI::SetSystemNetworkBand(), RMmCustomAPI::GetSystemNetworkBand()
|
|
2442 |
@SYMTestExpectedResults Pass
|
|
2443 |
@SYMTestType UT
|
|
2444 |
*/
|
|
2445 |
void CCTsyPhoneFU::TestUnit0031L()
|
|
2446 |
{
|
|
2447 |
OpenEtelServerL(EUseExtendedError);
|
|
2448 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2449 |
|
|
2450 |
TRequestStatus requestStatus;
|
|
2451 |
|
|
2452 |
RBuf8 data;
|
|
2453 |
CleanupClosePushL(data);
|
|
2454 |
|
|
2455 |
OpenPhoneL();
|
|
2456 |
|
|
2457 |
RMmCustomAPI customApi;
|
|
2458 |
OpenCustomApiLC(customApi);
|
|
2459 |
|
|
2460 |
RMmCustomAPI::TBandSelection band=RMmCustomAPI::ENetworkBandAny;
|
|
2461 |
RMmCustomAPI::TNetworkModeCaps mode=RMmCustomAPI::KCapsNetworkModeUmts;
|
|
2462 |
|
|
2463 |
RMmCustomAPI::TBandSelection bandToGet=RMmCustomAPI::ENetworkBandUmts850;
|
|
2464 |
RMmCustomAPI::TNetworkModeCaps modeToGet=RMmCustomAPI::KCapsNetworkModeDual;
|
|
2465 |
|
|
2466 |
RMmCustomAPI::TBandSelection bandToSet=RMmCustomAPI::ENetworkBandUmts2100;
|
|
2467 |
RMmCustomAPI::TNetworkModeCaps modeToSet=RMmCustomAPI::KCapsNetworkModeGsm;
|
|
2468 |
|
|
2469 |
TRequestStatus req=0;
|
|
2470 |
|
|
2471 |
|
|
2472 |
//1. Test GetSystemNetworkBand
|
|
2473 |
|
|
2474 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneGetSystemNetworkBand::KLtsyDispatchPhoneGetSystemNetworkBandApiId);
|
|
2475 |
|
|
2476 |
TMockLtsyData2<RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> getData(bandToGet, modeToGet);
|
|
2477 |
getData.SerialiseL(data);
|
|
2478 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneGetSystemNetworkBand::KLtsyDispatchPhoneGetSystemNetworkBandApiId, KErrNone, data);
|
|
2479 |
data.Close();
|
|
2480 |
|
|
2481 |
|
|
2482 |
customApi.GetSystemNetworkBand( req, band, mode);
|
|
2483 |
User::WaitForRequest(req);
|
|
2484 |
|
|
2485 |
ASSERT_EQUALS(KErrNone, req.Int());
|
|
2486 |
ASSERT_EQUALS(bandToGet, band);
|
|
2487 |
ASSERT_EQUALS(modeToGet, mode);
|
|
2488 |
|
|
2489 |
AssertMockLtsyStatusL();
|
|
2490 |
|
|
2491 |
|
|
2492 |
//2. Test SetSystemNetworkBand
|
|
2493 |
|
|
2494 |
TMockLtsyData2<RMmCustomAPI::TBandSelection, RMmCustomAPI::TNetworkModeCaps> setData(bandToSet, modeToSet);
|
|
2495 |
setData.SerialiseL(data);
|
|
2496 |
|
|
2497 |
iMockLTSY.ExpectL(MLtsyDispatchPhoneSetSystemNetworkBand::KLtsyDispatchPhoneSetSystemNetworkBandApiId, data);
|
|
2498 |
|
|
2499 |
iMockLTSY.CompleteL(MLtsyDispatchPhoneSetSystemNetworkBand::KLtsyDispatchPhoneSetSystemNetworkBandApiId, KErrNone);
|
|
2500 |
data.Close();
|
|
2501 |
|
|
2502 |
|
|
2503 |
band = bandToSet;
|
|
2504 |
mode = modeToSet;
|
|
2505 |
customApi.SetSystemNetworkBand(req, band, mode);
|
|
2506 |
User::WaitForRequest(req);
|
|
2507 |
ASSERT_EQUALS(KErrNone, req.Int());
|
|
2508 |
|
|
2509 |
AssertMockLtsyStatusL();
|
|
2510 |
|
|
2511 |
CleanupStack::PopAndDestroy(&customApi);
|
|
2512 |
CleanupStack::PopAndDestroy(&data);
|
|
2513 |
CleanupStack::PopAndDestroy(this);
|
|
2514 |
}
|
|
2515 |
|
|
2516 |
/**
|
|
2517 |
@SYMTestCaseID BA-CTSYD-DIS-PHONE-UN0032
|
|
2518 |
@SYMComponent telephony_ctsy
|
|
2519 |
@SYMTestCaseDesc Test RPhone::NotifyDtmfEvent
|
|
2520 |
@SYMTestPriority High
|
|
2521 |
@SYMTestActions Invokes RPhone::NotifyDtmfEvent
|
|
2522 |
@SYMTestExpectedResults Pass
|
|
2523 |
@SYMTestType UT
|
|
2524 |
*/
|
|
2525 |
void CCTsyPhoneFU::TestUnit0032L()
|
|
2526 |
{
|
|
2527 |
OpenEtelServerL(EUseExtendedError);
|
|
2528 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
2529 |
OpenPhoneL();
|
|
2530 |
|
|
2531 |
RBuf8 data;
|
|
2532 |
CleanupClosePushL(data);
|
|
2533 |
|
|
2534 |
TRequestStatus requestStatus;
|
|
2535 |
|
|
2536 |
RMobilePhone::TMobilePhoneDTMFEvent event(RMobilePhone::EStopDtmfTone);
|
|
2537 |
RMobilePhone::TMobilePhoneDTMFEvent startEvent(RMobilePhone::EStartDtmfTone);
|
|
2538 |
TRequestStatus reqStatus;
|
|
2539 |
|
|
2540 |
TMockLtsyData1< RMobilePhone::TMobilePhoneDTMFEvent > toneEvent( startEvent );
|
|
2541 |
toneEvent.SerialiseL(data);
|
|
2542 |
|
|
2543 |
iPhone.NotifyDTMFEvent(reqStatus, event);
|
|
2544 |
iMockLTSY.CompleteL(KMockLtsyDispatchPhoneNotifyDtmfEventIndId, KErrNone, data);
|
|
2545 |
|
|
2546 |
User::WaitForRequest(reqStatus);
|
|
2547 |
ASSERT_EQUALS(KErrNone, reqStatus.Int());
|
|
2548 |
ASSERT_EQUALS(RMobilePhone::EStartDtmfTone, event);
|
|
2549 |
|
|
2550 |
|
|
2551 |
CleanupStack::PopAndDestroy(2, this); // call, line, data, this
|
|
2552 |
}
|