24
|
1 |
// Copyright (c) 2007-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 |
// Test step definitions for the Indicator functional unit.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@internalTechnology
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "cctsyintegrationtestindicator.h"
|
|
23 |
|
|
24 |
#include "cctsyinidata.h"
|
|
25 |
|
|
26 |
#include "listretrievalhelpers.h"
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
CCTSYIntegrationTestIndicatorBase::CCTSYIntegrationTestIndicatorBase(CEtelSessionMgr& aEtelSessionMgr)
|
|
32 |
: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iNetworkTestHelper(*this), iCallForwardingControlHelper(*this)
|
|
33 |
/**
|
|
34 |
* Constructor
|
|
35 |
*/
|
|
36 |
{
|
|
37 |
}
|
|
38 |
|
|
39 |
CCTSYIntegrationTestIndicatorBase::~CCTSYIntegrationTestIndicatorBase()
|
|
40 |
/*
|
|
41 |
* Destructor
|
|
42 |
*/
|
|
43 |
{
|
|
44 |
}
|
|
45 |
|
|
46 |
|
|
47 |
CCTSYIntegrationTestIndicator0001::CCTSYIntegrationTestIndicator0001(CEtelSessionMgr& aEtelSessionMgr)
|
|
48 |
: CCTSYIntegrationTestIndicatorBase(aEtelSessionMgr)
|
|
49 |
/**
|
|
50 |
* Constructor.
|
|
51 |
*/
|
|
52 |
{
|
|
53 |
SetTestStepName(CCTSYIntegrationTestIndicator0001::GetTestStepName());
|
|
54 |
}
|
|
55 |
|
|
56 |
CCTSYIntegrationTestIndicator0001::~CCTSYIntegrationTestIndicator0001()
|
|
57 |
/**
|
|
58 |
* Destructor.
|
|
59 |
*/
|
|
60 |
{
|
|
61 |
}
|
|
62 |
|
|
63 |
TVerdict CCTSYIntegrationTestIndicator0001::doTestStepL()
|
|
64 |
/**
|
|
65 |
* @SYMTestCaseID BA-CTSY-INT-IND-0001
|
|
66 |
* @SYMFssID BA/CTSY/IND-0001
|
|
67 |
* @SYMTestCaseDesc Get the indicator caps.
|
|
68 |
* @SYMTestPriority High
|
|
69 |
* @SYMTestActions
|
|
70 |
* @SYMTestExpectedResults Pass - Correct caps returned.
|
|
71 |
* @SYMTestType CIT
|
|
72 |
* @SYMTestCaseDependencies live/automatic
|
|
73 |
*
|
|
74 |
* Reason for test: Verify caps returned are correct.
|
|
75 |
*
|
|
76 |
* @return - TVerdict code
|
|
77 |
*/
|
|
78 |
{
|
|
79 |
|
|
80 |
//
|
|
81 |
// SET UP
|
|
82 |
//
|
|
83 |
|
|
84 |
RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
|
|
85 |
|
|
86 |
CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
|
|
87 |
|
|
88 |
//
|
|
89 |
// SET UP END
|
|
90 |
//
|
|
91 |
|
|
92 |
StartTest();
|
|
93 |
|
|
94 |
//
|
|
95 |
// TEST START
|
|
96 |
//
|
|
97 |
|
|
98 |
// Check RMobilePhone::GetIndicatorCaps returns aActionCaps in set
|
|
99 |
// of RMobilePhone::KCapsGetIndicator | RMobilePhone::KCapsNotifyIndicatorChange
|
|
100 |
// and indicator caps in set of RMobilePhone::KIndChargerConnected | RMobilePhone::KIndNetworkAvailable |
|
|
101 |
// RMobilePhone::KIndCallInProgress
|
|
102 |
|
|
103 |
TUint32 actionCaps=0;
|
|
104 |
TUint32 indCaps=0;
|
|
105 |
ASSERT_EQUALS(mobilePhone.GetIndicatorCaps(actionCaps, indCaps), KErrNone, _L("RMobilePhone::GetIndicatorCaps returned an error"));
|
|
106 |
|
|
107 |
TUint32 expectedServiceCaps = RMobilePhone::KCapsGetIndicator | RMobilePhone::KCapsNotifyIndicatorChange;
|
|
108 |
ASSERT_BITS_SET(actionCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicatorCaps returned wrong caps"));
|
|
109 |
|
|
110 |
expectedServiceCaps = RMobilePhone::KIndChargerConnected | RMobilePhone::KIndNetworkAvailable | RMobilePhone::KIndCallInProgress;
|
|
111 |
ASSERT_BITS_SET(indCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicatorCaps returned wrong caps"));
|
|
112 |
|
|
113 |
//
|
|
114 |
// TEST END
|
|
115 |
//
|
|
116 |
|
|
117 |
StartCleanup();
|
|
118 |
|
|
119 |
return TestStepResult();
|
|
120 |
}
|
|
121 |
|
|
122 |
TPtrC CCTSYIntegrationTestIndicator0001::GetTestStepName()
|
|
123 |
/**
|
|
124 |
* @return The test step name.
|
|
125 |
*/
|
|
126 |
{
|
|
127 |
return _L("CCTSYIntegrationTestIndicator0001");
|
|
128 |
}
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
CCTSYIntegrationTestIndicator0002::CCTSYIntegrationTestIndicator0002(CEtelSessionMgr& aEtelSessionMgr)
|
|
133 |
: CCTSYIntegrationTestIndicatorBase(aEtelSessionMgr)
|
|
134 |
/**
|
|
135 |
* Constructor.
|
|
136 |
*/
|
|
137 |
{
|
|
138 |
SetTestStepName(CCTSYIntegrationTestIndicator0002::GetTestStepName());
|
|
139 |
}
|
|
140 |
|
|
141 |
CCTSYIntegrationTestIndicator0002::~CCTSYIntegrationTestIndicator0002()
|
|
142 |
/**
|
|
143 |
* Destructor.
|
|
144 |
*/
|
|
145 |
{
|
|
146 |
}
|
|
147 |
|
|
148 |
TVerdict CCTSYIntegrationTestIndicator0002::doTestStepL()
|
|
149 |
/**
|
|
150 |
* @SYMTestCaseID BA-CTSY-INT-IND-0002
|
|
151 |
* @SYMFssID BA/CTSY/IND-0002
|
|
152 |
* @SYMTestCaseDesc Get indicator when network is available and call is in progress
|
|
153 |
* @SYMTestPriority High
|
|
154 |
* @SYMTestActions RMobileCall::NotifyMobileCallStatusChange, RMobilePhone::GetIndicator, RMobilePhone::NotifyIndicatorChange, RCall::HangUp, RCall::Dial
|
|
155 |
* @SYMTestExpectedResults Pass - Call indicator notification completes when call is made
|
|
156 |
* @SYMTestType CIT
|
|
157 |
* @SYMTestCaseDependencies live/automatic
|
|
158 |
*
|
|
159 |
* Reason for test: Verify correct indicator is returned and indicator notification completes.
|
|
160 |
*
|
|
161 |
* @return - TVerdict code
|
|
162 |
*/
|
|
163 |
{
|
|
164 |
|
|
165 |
//
|
|
166 |
// SET UP
|
|
167 |
//
|
|
168 |
|
|
169 |
RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
|
|
170 |
|
|
171 |
// Ensure RMobilePhone::GetIndicatorCaps returns aActionCaps in set of RMobilePhone::KCapsGetIndicator | RMobilePhone::KCapsNotifyIndicatorChange
|
|
172 |
CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
|
|
173 |
|
|
174 |
TUint32 actionCaps = 0;
|
|
175 |
TUint32 indCaps = 0;
|
|
176 |
CHECK_EQUALS_L(mobilePhone.GetIndicatorCaps(actionCaps, indCaps), KErrNone, _L("RMobilePhone::GetIndicatorCaps return value is not KErrNone"));
|
|
177 |
TUint32 expectedServiceCaps = RMobilePhone::KCapsGetIndicator | RMobilePhone::KCapsNotifyIndicatorChange;
|
|
178 |
CHECK_BITS_SET_L(actionCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicatorCaps returned wrong caps"));
|
|
179 |
|
|
180 |
// Ensure RMobilePhone::GetIndicatorCaps returns aIndCaps in set of RMobilePhone::KIndCallInProgress | RMobilePhone::KIndNetworkAvailable
|
|
181 |
expectedServiceCaps = RMobilePhone::KIndCallInProgress | RMobilePhone::KIndNetworkAvailable;
|
|
182 |
CHECK_BITS_SET_L(indCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicatorCaps returned wrong caps"));
|
|
183 |
|
|
184 |
// Ensure RMobilePhone::GetNetworkRegistrationStatus returns aStatus=ERegisteredOnHomeNetwork
|
|
185 |
RMobilePhone::TMobilePhoneRegistrationStatus registrationStatus;
|
|
186 |
TExtEtelRequestStatus getNetworkRegistraionStatusStatus(mobilePhone,EMobilePhoneGetNetworkRegistrationStatus);
|
|
187 |
CleanupStack::PushL(getNetworkRegistraionStatusStatus);
|
|
188 |
mobilePhone.GetNetworkRegistrationStatus(getNetworkRegistraionStatusStatus, registrationStatus);
|
|
189 |
CHECK_EQUALS_L(WaitForRequestWithTimeOut(getNetworkRegistraionStatusStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetNetworkRegistrationStatus timed out"));
|
|
190 |
CHECK_EQUALS_L(getNetworkRegistraionStatusStatus.Int(), KErrNone, _L("RMobilePhone::GetNetworkRegistrationStatus returned an error"));
|
|
191 |
CHECK_EQUALS_L(registrationStatus, RMobilePhone::ERegisteredOnHomeNetwork,_L("RMobilePhone::GetNetworkRegistrationStatus did not set the registration status to ERegisteredOnHomeNetwork"));
|
|
192 |
|
|
193 |
// Get voice line 1.
|
|
194 |
RMobileLine& mobileLine= iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
|
|
195 |
|
|
196 |
// Get call 1.
|
|
197 |
RMobileCall& mobileCall= iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);
|
|
198 |
|
|
199 |
//
|
|
200 |
// SET UP END
|
|
201 |
//
|
|
202 |
|
|
203 |
StartTest();
|
|
204 |
|
|
205 |
//
|
|
206 |
// TEST START
|
|
207 |
//
|
|
208 |
|
|
209 |
// Check RMobilePhone::GetIndicator returns aIndicator with flags in set of KIndNetworkAvailable
|
|
210 |
// Check RMobilePhone::GetIndicator returns aIndicator with flags NOT in set of KIndCallInProgress
|
|
211 |
TUint32 indicator=0;
|
|
212 |
TExtEtelRequestStatus getIndicatorStatus(mobilePhone,EMobilePhoneGetIndicator);
|
|
213 |
CleanupStack::PushL(getIndicatorStatus);
|
|
214 |
|
|
215 |
mobilePhone.GetIndicator(getIndicatorStatus, indicator);
|
|
216 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(getIndicatorStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetIndicator timed out"));
|
|
217 |
ASSERT_EQUALS(getIndicatorStatus.Int(), KErrNone, _L("RMobilePhone::GetIndicator returned an error"));
|
|
218 |
|
|
219 |
expectedServiceCaps = RMobilePhone::KIndNetworkAvailable;
|
|
220 |
TUint32 unexpectServiceCaps = RMobilePhone::KIndCallInProgress;
|
|
221 |
ASSERT_BITS_SET(indicator, expectedServiceCaps, unexpectServiceCaps, _L("RMobilePhone::GetIndicator returned wrong caps"));
|
|
222 |
|
|
223 |
// Post notifier for RMobileCall::NotifyMobileCallStatusChange
|
|
224 |
TExtEtelRequestStatus notifyMobileCallStatus(mobileCall, EMobileCallNotifyMobileCallStatusChange);
|
|
225 |
CleanupStack::PushL(notifyMobileCallStatus);
|
|
226 |
RMobileCall::TMobileCallStatus mobileCallStatus;
|
|
227 |
mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
|
|
228 |
|
|
229 |
// Post notifier for RMobileCall::NotifyIndicatorChange
|
|
230 |
TExtEtelRequestStatus notifyIndicatorChangeStatus(mobilePhone, EMobilePhoneNotifyIndicatorChange);
|
|
231 |
CleanupStack::PushL(notifyIndicatorChangeStatus);
|
|
232 |
TUint32 notifyIndicatorChangeIndicator=0;
|
|
233 |
mobilePhone.NotifyIndicatorChange(notifyIndicatorChangeStatus, notifyIndicatorChangeIndicator);
|
|
234 |
|
|
235 |
// === Dial a call ===
|
|
236 |
|
|
237 |
// Dial a number that answers using RCall::Dial
|
|
238 |
TPtrC outgoingnumber;
|
|
239 |
ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, outgoingnumber) != EFalse, _L("GetStringFromConfig did not complete as expected"));
|
|
240 |
DEBUG_PRINTF2(_L("Board Now Dialling: %S"), &outgoingnumber);
|
|
241 |
TCoreEtelRequestStatus<RMobileCall> dialStatus(mobileCall, &RCall::DialCancel);
|
|
242 |
CleanupStack::PushL(dialStatus);
|
|
243 |
mobileCall.Dial(dialStatus, outgoingnumber);
|
|
244 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RCall::Dial timed out"));
|
|
245 |
ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RCall::Dial returned an error"));
|
|
246 |
|
|
247 |
// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
|
|
248 |
RMobileCall::TMobileCallStatus expectedMobileCallStatus=RMobileCall::EStatusDialling;
|
|
249 |
iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
|
|
250 |
notifyMobileCallStatus,
|
|
251 |
mobileCallStatus,
|
|
252 |
expectedMobileCallStatus,
|
|
253 |
KErrNone);
|
|
254 |
|
|
255 |
mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
|
|
256 |
|
|
257 |
expectedMobileCallStatus=RMobileCall::EStatusConnecting;
|
|
258 |
iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
|
|
259 |
notifyMobileCallStatus,
|
|
260 |
mobileCallStatus,
|
|
261 |
expectedMobileCallStatus,
|
|
262 |
KErrNone);
|
|
263 |
|
|
264 |
mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
|
|
265 |
|
|
266 |
expectedMobileCallStatus=RMobileCall::EStatusConnected;
|
|
267 |
iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
|
|
268 |
notifyMobileCallStatus,
|
|
269 |
mobileCallStatus,
|
|
270 |
expectedMobileCallStatus,
|
|
271 |
KErrNone);
|
|
272 |
|
|
273 |
// Check RMobilePhone::NotifyIndicatorChange completes with aIndicator with flags in set of KIndCallInProgress | KIndNetworkAvailable
|
|
274 |
TUint32 expectedIndicator = RMobilePhone::KIndCallInProgress | RMobilePhone::KIndNetworkAvailable;
|
|
275 |
iCallForwardingControlHelper.WaitForMobilePhoneNotifyIndicatorChange(mobilePhone,
|
|
276 |
notifyIndicatorChangeStatus,
|
|
277 |
notifyIndicatorChangeIndicator,
|
|
278 |
expectedIndicator,
|
|
279 |
KErrNone);
|
|
280 |
|
|
281 |
mobilePhone.NotifyIndicatorChange(notifyIndicatorChangeStatus, notifyIndicatorChangeIndicator);
|
|
282 |
|
|
283 |
// Check RMobilePhone::GetIndicator returns aIndicator with flags in set of KIndCallInProgress | KIndNetworkAvailable
|
|
284 |
mobilePhone.GetIndicator(getIndicatorStatus, indicator);
|
|
285 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(getIndicatorStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetIndicator timed out"));
|
|
286 |
ASSERT_EQUALS(getIndicatorStatus.Int(), KErrNone, _L("RMobilePhone::GetIndicator returned an error"));
|
|
287 |
|
|
288 |
expectedServiceCaps = RMobilePhone::KIndCallInProgress | RMobilePhone::KIndNetworkAvailable;
|
|
289 |
CHECK_BITS_SET_L(indicator, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicator returned wrong caps"));
|
|
290 |
|
|
291 |
mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
|
|
292 |
|
|
293 |
// Hang up call with RCall::HangUp
|
|
294 |
DEBUG_PRINTF1(_L("Hangup call"));
|
|
295 |
ASSERT_EQUALS(mobileCall.HangUp(), KErrNone, _L("RCall::HangUp return value not KErrNone"));
|
|
296 |
|
|
297 |
// Check RCall::NotifyStatusChange completes with EStatusDisconnecting -> EStatusIdle
|
|
298 |
expectedMobileCallStatus=RMobileCall::EStatusDisconnecting;
|
|
299 |
iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
|
|
300 |
notifyMobileCallStatus,
|
|
301 |
mobileCallStatus,
|
|
302 |
expectedMobileCallStatus,
|
|
303 |
KErrNone);
|
|
304 |
|
|
305 |
mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
|
|
306 |
|
|
307 |
expectedMobileCallStatus=RMobileCall::EStatusIdle;
|
|
308 |
iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
|
|
309 |
notifyMobileCallStatus,
|
|
310 |
mobileCallStatus,
|
|
311 |
expectedMobileCallStatus,
|
|
312 |
KErrNone);
|
|
313 |
|
|
314 |
// Check RMobilePhone::NotifyIndicatorChange completes with aIndicator with flags in set of KIndNetworkAvailable
|
|
315 |
expectedIndicator = RMobilePhone::KIndNetworkAvailable;
|
|
316 |
iCallForwardingControlHelper.WaitForMobilePhoneNotifyIndicatorChange(mobilePhone,
|
|
317 |
notifyIndicatorChangeStatus,
|
|
318 |
notifyIndicatorChangeIndicator,
|
|
319 |
expectedIndicator,
|
|
320 |
KErrNone);
|
|
321 |
|
|
322 |
// Check RMobilePhone::GetIndicator returns aIndicator with flags NOT in set of KIndCallInProgress
|
|
323 |
mobilePhone.GetIndicator(getIndicatorStatus, indicator);
|
|
324 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(getIndicatorStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetIndicator timed out"));
|
|
325 |
ASSERT_EQUALS(getIndicatorStatus.Int(), KErrNone, _L("RMobilePhone::GetIndicator returned an error"));
|
|
326 |
|
|
327 |
unexpectServiceCaps = RMobilePhone::KIndCallInProgress;
|
|
328 |
CHECK_BITS_SET_L(indicator, KNoUnwantedBits, unexpectServiceCaps, _L("RMobilePhone::GetIndicator returned wrong caps"));
|
|
329 |
|
|
330 |
//
|
|
331 |
// TEST END
|
|
332 |
//
|
|
333 |
|
|
334 |
StartCleanup();
|
|
335 |
|
|
336 |
CleanupStack::PopAndDestroy(&dialStatus);
|
|
337 |
CleanupStack::PopAndDestroy(¬ifyIndicatorChangeStatus);
|
|
338 |
CleanupStack::PopAndDestroy(¬ifyMobileCallStatus);
|
|
339 |
CleanupStack::PopAndDestroy(&getIndicatorStatus);
|
|
340 |
CleanupStack::PopAndDestroy(&getNetworkRegistraionStatusStatus);
|
|
341 |
|
|
342 |
return TestStepResult();
|
|
343 |
}
|
|
344 |
|
|
345 |
TPtrC CCTSYIntegrationTestIndicator0002::GetTestStepName()
|
|
346 |
/**
|
|
347 |
* @return The test step name.
|
|
348 |
*/
|
|
349 |
{
|
|
350 |
return _L("CCTSYIntegrationTestIndicator0002");
|
|
351 |
}
|
|
352 |
|
|
353 |
|
|
354 |
|
|
355 |
CCTSYIntegrationTestIndicator0003::CCTSYIntegrationTestIndicator0003(CEtelSessionMgr& aEtelSessionMgr)
|
|
356 |
: CCTSYIntegrationTestIndicatorBase(aEtelSessionMgr)
|
|
357 |
/**
|
|
358 |
* Constructor.
|
|
359 |
*/
|
|
360 |
{
|
|
361 |
SetTestStepName(CCTSYIntegrationTestIndicator0003::GetTestStepName());
|
|
362 |
}
|
|
363 |
|
|
364 |
CCTSYIntegrationTestIndicator0003::~CCTSYIntegrationTestIndicator0003()
|
|
365 |
/**
|
|
366 |
* Destructor.
|
|
367 |
*/
|
|
368 |
{
|
|
369 |
}
|
|
370 |
|
|
371 |
TVerdict CCTSYIntegrationTestIndicator0003::doTestStepL()
|
|
372 |
/**
|
|
373 |
* @SYMTestCaseID BA-CTSY-INT-IND-0003
|
|
374 |
* @SYMFssID BA/CTSY/IND-0003
|
|
375 |
* @SYMTestCaseDesc Connect the phone charger
|
|
376 |
* @SYMTestPriority High
|
|
377 |
* @SYMTestActions RMobilePhone::NotifyIndicatorChange
|
|
378 |
* @SYMTestExpectedResults Pass - Indicator notification completes when charger is connected.
|
|
379 |
* @SYMTestType CIT
|
|
380 |
* @SYMTestCaseDependencies live/manual
|
|
381 |
*
|
|
382 |
* Reason for test: Verify indicator notification completes
|
|
383 |
*
|
|
384 |
* @return - TVerdict code
|
|
385 |
*/
|
|
386 |
{
|
|
387 |
|
|
388 |
//
|
|
389 |
// SET UP
|
|
390 |
//
|
|
391 |
|
|
392 |
RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
|
|
393 |
|
|
394 |
CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
|
|
395 |
|
|
396 |
// Check RMobilePhone::GetIndicatorCaps returns aActionCaps in set of RMobilePhone::KCapsGetIndicator | RMobilePhone::KCapsNotifyIndicatorChange
|
|
397 |
TUint32 actionCaps=0;
|
|
398 |
TUint32 indCaps=0;
|
|
399 |
ASSERT_EQUALS(mobilePhone.GetIndicatorCaps(actionCaps, indCaps), KErrNone, _L("RMobilePhone::GetIndicatorCaps returned an error"));
|
|
400 |
|
|
401 |
TUint32 expectedServiceCaps = RMobilePhone::KCapsGetIndicator | RMobilePhone::KCapsNotifyIndicatorChange;
|
|
402 |
CHECK_BITS_SET_L(actionCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicatorCaps returned wrong caps"));
|
|
403 |
|
|
404 |
// Check RMobilePhone::GetIndicatorCaps returns aIndCaps in set of RMobilePhone::KIndChargerConnected
|
|
405 |
expectedServiceCaps = RMobilePhone::KIndChargerConnected;
|
|
406 |
CHECK_BITS_SET_L(indCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicatorCaps returned wrong caps"));
|
|
407 |
|
|
408 |
//
|
|
409 |
// SET UP END
|
|
410 |
//
|
|
411 |
|
|
412 |
StartTest();
|
|
413 |
|
|
414 |
//
|
|
415 |
// TEST START
|
|
416 |
//
|
|
417 |
|
|
418 |
// Check RMobilePhone::GetIndicator returns aIndicator with flags NOT in set of RMobilePhone::KIndChargerConnected
|
|
419 |
TUint32 indicator=0;
|
|
420 |
TExtEtelRequestStatus getIndicatorStatus(mobilePhone,EMobilePhoneGetIndicator);
|
|
421 |
CleanupStack::PushL(getIndicatorStatus);
|
|
422 |
|
|
423 |
mobilePhone.GetIndicator(getIndicatorStatus, indicator);
|
|
424 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(getIndicatorStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetIndicator timed out"));
|
|
425 |
ASSERT_EQUALS(getIndicatorStatus.Int(), KErrNone, _L("RMobilePhone::GetIndicator returned an error"));
|
|
426 |
|
|
427 |
TUint32 unexpectedIndicatorCaps = RMobilePhone::KIndChargerConnected;
|
|
428 |
ASSERT_BITS_SET(indicator, KNoUnwantedBits, unexpectedIndicatorCaps, _L("RMobilePhone::GetIndicator returned wrong caps"));
|
|
429 |
|
|
430 |
// Post notifier for RMobileCall::NotifyIndicatorChange
|
|
431 |
TExtEtelRequestStatus notifyIndicatorChangeStatus(mobilePhone, EMobilePhoneNotifyIndicatorChange);
|
|
432 |
CleanupStack::PushL(notifyIndicatorChangeStatus);
|
|
433 |
TUint32 notifyIndicatorChangeIndicator=0;
|
|
434 |
mobilePhone.NotifyIndicatorChange(notifyIndicatorChangeStatus, notifyIndicatorChangeIndicator);
|
|
435 |
|
|
436 |
// Connect the charger to the phone
|
|
437 |
TBuf<50> prompt(_L("Connect the charger to the phone"));
|
|
438 |
DisplayUserInteractionPromptL(prompt); // 30 seconds
|
|
439 |
|
|
440 |
// Check RMobilePhone::NotifyIndicatorChange completes with aIndicator with flags in set of RMobilePhone::KIndChargerConnected and RMobilePhone::KIndNetworkAvailable
|
|
441 |
TUint32 expectedIndicator = RMobilePhone::KIndChargerConnected | RMobilePhone::KIndNetworkAvailable;
|
|
442 |
iCallForwardingControlHelper.WaitForMobilePhoneNotifyIndicatorChange(mobilePhone,
|
|
443 |
notifyIndicatorChangeStatus,
|
|
444 |
notifyIndicatorChangeIndicator,
|
|
445 |
expectedIndicator,
|
|
446 |
KErrNone);
|
|
447 |
|
|
448 |
// Check RMobilePhone::GetIndicator returns aIndicator with flags in set of RMobilePhone::KIndChargerConnected
|
|
449 |
mobilePhone.GetIndicator(getIndicatorStatus, indicator);
|
|
450 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(getIndicatorStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetIndicator timed out"));
|
|
451 |
ASSERT_EQUALS(getIndicatorStatus.Int(), KErrNone, _L("RMobilePhone::GetIndicator returned an error"));
|
|
452 |
|
|
453 |
TUint32 expectedIndicatorCaps = RMobilePhone::KIndChargerConnected;
|
|
454 |
ASSERT_BITS_SET(indicator, expectedIndicatorCaps, KNoUnwantedBits, _L("RMobilePhone::GetIndicator returned wrong caps"));
|
|
455 |
|
|
456 |
//
|
|
457 |
// TEST END
|
|
458 |
//
|
|
459 |
|
|
460 |
StartCleanup();
|
|
461 |
|
|
462 |
CleanupStack::PopAndDestroy(¬ifyIndicatorChangeStatus);
|
|
463 |
CleanupStack::PopAndDestroy(&getIndicatorStatus);
|
|
464 |
|
|
465 |
return TestStepResult();
|
|
466 |
}
|
|
467 |
|
|
468 |
TPtrC CCTSYIntegrationTestIndicator0003::GetTestStepName()
|
|
469 |
/**
|
|
470 |
* @return The test step name.
|
|
471 |
*/
|
|
472 |
{
|
|
473 |
return _L("CCTSYIntegrationTestIndicator0003");
|
|
474 |
}
|
|
475 |
|