24
|
1 |
// Copyright (c) 2003-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 |
// Tests for ETL 3rd Party Phone APIs
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "TE_EtelIsvbase.h"
|
|
23 |
#include "TE_EtelIsvPhoneSettings.h"
|
|
24 |
#include "TE_EtelIsvCallFunc.h"
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
CTestGetPhoneId::CTestGetPhoneId()
|
|
29 |
/** Each test step initialises it's own name
|
|
30 |
*/
|
|
31 |
{
|
|
32 |
// store the name of this test case
|
|
33 |
// this is the name that is used by the script file
|
|
34 |
SetTestStepName(_L("TestGetPhoneId"));
|
|
35 |
}
|
|
36 |
|
|
37 |
/**
|
|
38 |
*
|
|
39 |
@SYMTestCaseID Etel3rdParty 1.1
|
|
40 |
@SYMTestCaseDesc Test GetPhoneId 3rd party API
|
|
41 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.1
|
|
42 |
*/
|
|
43 |
|
|
44 |
TVerdict CTestGetPhoneId::doTestStepL()
|
|
45 |
{
|
|
46 |
SetTestNumber(0);
|
|
47 |
|
|
48 |
//expected data
|
|
49 |
_LIT16(manufacturerid, "PSION");
|
|
50 |
_LIT16(modelid, "666");
|
|
51 |
_LIT16(serialid, "1234567890");
|
|
52 |
CTelephony::TPhoneIdV1 ExpectedPhoneId;
|
|
53 |
ExpectedPhoneId.iManufacturer=manufacturerid;
|
|
54 |
ExpectedPhoneId.iModel=modelid;
|
|
55 |
ExpectedPhoneId.iSerialNumber=serialid;
|
|
56 |
TRequestStatus expStat=KErrNone;
|
|
57 |
CTelephony::TPhoneIdV1Pckg ExpectedPhoneIdPckg(ExpectedPhoneId);
|
|
58 |
|
|
59 |
CTestGetPhoneIdAct* GetPhoneIdAct = CTestGetPhoneIdAct::NewLC(this, iTelephony);
|
|
60 |
|
|
61 |
#if defined(_DEBUG)
|
|
62 |
//Test OOM
|
|
63 |
INFO_PRINTF1(_L("Test OOM for GetPhoneId"));
|
|
64 |
expStat=KErrNoMemory;
|
|
65 |
__UHEAP_FAILNEXT(1);
|
|
66 |
GetPhoneIdAct->GetPhoneId(ExpectedPhoneIdPckg, expStat);
|
|
67 |
CActiveScheduler::Start();
|
|
68 |
__UHEAP_RESET;
|
|
69 |
#endif
|
|
70 |
|
|
71 |
//Start GetPhoneID AO
|
|
72 |
INFO_PRINTF1(_L("Test GetPhoneId"));
|
|
73 |
expStat=KErrNone;
|
|
74 |
GetPhoneIdAct->GetPhoneId(ExpectedPhoneIdPckg, expStat, ETrue);
|
|
75 |
CActiveScheduler::Start();
|
|
76 |
|
|
77 |
//Test cancel
|
|
78 |
INFO_PRINTF1(_L("Test Cancel for GetPhoneId"));
|
|
79 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
|
|
80 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
81 |
GetPhoneIdAct->GetPhoneId(ExpectedPhoneIdPckg, expStat);
|
|
82 |
CTestCanceller* canceller = GetPhoneIdAct->RetrieveCanceller();
|
|
83 |
canceller->Call();
|
|
84 |
CActiveScheduler::Start();
|
|
85 |
TEST1(GetPhoneIdAct->iStatus.Int() == KErrCancel || GetPhoneIdAct->iStatus.Int() == KErrNone, ETrue);
|
|
86 |
|
|
87 |
CleanupStack::PopAndDestroy(); //GetPhoneIdAct
|
|
88 |
|
|
89 |
return TestStepResult();
|
|
90 |
}
|
|
91 |
|
|
92 |
CTestGetPhoneIdError::CTestGetPhoneIdError()
|
|
93 |
/** Each test step initialises it's own name
|
|
94 |
*/
|
|
95 |
{
|
|
96 |
// store the name of this test case
|
|
97 |
// this is the name that is used by the script file
|
|
98 |
SetTestStepName(_L("TestGetPhoneIdError"));
|
|
99 |
}
|
|
100 |
|
|
101 |
/**
|
|
102 |
*
|
|
103 |
@SYMTestCaseID Etel3rdParty 1.2
|
|
104 |
@SYMTestCaseDesc Test GetPhoneId 3rd party API - Error scenario
|
|
105 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.1
|
|
106 |
*/
|
|
107 |
|
|
108 |
TVerdict CTestGetPhoneIdError::doTestStepL()
|
|
109 |
{
|
|
110 |
INFO_PRINTF1(_L("Test GetPhoneId with error"));
|
|
111 |
SetTestNumber(1);
|
|
112 |
CTelephony::TPhoneIdV1 ExpectedPhoneId;
|
|
113 |
CTelephony::TPhoneIdV1Pckg ExpectedPhoneIdPckg(ExpectedPhoneId);
|
|
114 |
TRequestStatus expStat=KErrNotFound;
|
|
115 |
|
|
116 |
//Start GetPhoneID AO
|
|
117 |
CTestGetPhoneIdAct* GetPhoneIdAct = CTestGetPhoneIdAct::NewLC(this, iTelephony);
|
|
118 |
GetPhoneIdAct->GetPhoneId(ExpectedPhoneIdPckg, expStat);
|
|
119 |
|
|
120 |
CActiveScheduler::Start();
|
|
121 |
|
|
122 |
CleanupStack::PopAndDestroy(); //GetPhoneIdAct
|
|
123 |
return TestStepResult();
|
|
124 |
}
|
|
125 |
|
|
126 |
//=====================================================
|
|
127 |
//
|
|
128 |
// Class to get phone ID active object
|
|
129 |
//
|
|
130 |
//=====================================================
|
|
131 |
|
|
132 |
CTestGetPhoneIdAct* CTestGetPhoneIdAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TBool aUseMacros)
|
|
133 |
//Factory constructor
|
|
134 |
{
|
|
135 |
CTestGetPhoneIdAct* obj = new(ELeave) CTestGetPhoneIdAct(aTestStep, aTelephony, aUseMacros);
|
|
136 |
CleanupStack::PushL(obj);
|
|
137 |
obj->ConstructL();
|
|
138 |
return obj;
|
|
139 |
}
|
|
140 |
CTestGetPhoneIdAct::CTestGetPhoneIdAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TBool aUseMacros = ETrue)
|
|
141 |
: CEtelIsvActBase(aTestStep, aTelephony),
|
|
142 |
iUseMacros(aUseMacros),
|
|
143 |
iPhoneIdBuff(iPhoneId),
|
|
144 |
iPhoneIdPckg(iPhoneId)
|
|
145 |
{
|
|
146 |
}
|
|
147 |
|
|
148 |
void CTestGetPhoneIdAct::ConstructL()
|
|
149 |
{
|
|
150 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
151 |
CActiveScheduler::Add(this);
|
|
152 |
}
|
|
153 |
|
|
154 |
CTestGetPhoneIdAct::~CTestGetPhoneIdAct()
|
|
155 |
{
|
|
156 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
157 |
delete iCanceller;
|
|
158 |
}
|
|
159 |
|
|
160 |
void CTestGetPhoneIdAct::DoCancel()
|
|
161 |
{
|
|
162 |
iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
|
|
163 |
}
|
|
164 |
|
|
165 |
void CTestGetPhoneIdAct::GetPhoneId(TDes8& aExpectedPhoneIdPckg, TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
166 |
{
|
|
167 |
iExpectedPhoneIdPckg=&aExpectedPhoneIdPckg;
|
|
168 |
iExpStat=aExpStat;
|
|
169 |
|
|
170 |
TDes8* data;
|
|
171 |
if (iTestStep->iBufferMode)
|
|
172 |
{
|
|
173 |
data = &iPhoneIdBuff;
|
|
174 |
}
|
|
175 |
else
|
|
176 |
{
|
|
177 |
data = &iPhoneIdPckg;
|
|
178 |
}
|
|
179 |
|
|
180 |
iTelephony->GetPhoneId(iStatus, *data);
|
|
181 |
|
|
182 |
if(aCheckConcurrency)
|
|
183 |
{
|
|
184 |
TRequestStatus tmpStatus;
|
|
185 |
iTelephony->GetPhoneId(tmpStatus, *data);
|
|
186 |
User::WaitForRequest(tmpStatus);
|
|
187 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
188 |
}
|
|
189 |
SetActive();
|
|
190 |
}
|
|
191 |
|
|
192 |
void CTestGetPhoneIdAct::RunL()
|
|
193 |
{
|
|
194 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
195 |
// calling this RunL().
|
|
196 |
CTelephony::TPhoneIdV1Pckg& GetPhoneIdV1Pckg = REINTERPRET_CAST(CTelephony::TPhoneIdV1Pckg&, *iExpectedPhoneIdPckg);
|
|
197 |
|
|
198 |
//only supports V1 at present
|
|
199 |
CTelephony::TPhoneIdV1& expectedPhoneId = (GetPhoneIdV1Pckg)();
|
|
200 |
|
|
201 |
if(iUseMacros)
|
|
202 |
{
|
|
203 |
iTestStep->TEST1(iStatus.Int() == iExpStat.Int(), ETrue);
|
|
204 |
}
|
|
205 |
|
|
206 |
if(iStatus.Int() == KErrNone)
|
|
207 |
{
|
|
208 |
if(iUseMacros)
|
|
209 |
{
|
|
210 |
const CTelephony::TPhoneIdV1* data;
|
|
211 |
if (iTestStep->iBufferMode)
|
|
212 |
{
|
|
213 |
data = reinterpret_cast<const CTelephony::TPhoneIdV1*> ( &iPhoneIdBuff() );
|
|
214 |
}
|
|
215 |
else
|
|
216 |
{
|
|
217 |
data = reinterpret_cast<const CTelephony::TPhoneIdV1*> ( &iPhoneIdPckg() );
|
|
218 |
}
|
|
219 |
|
|
220 |
iTestStep->TEST1(data->iManufacturer == expectedPhoneId.iManufacturer, ETrue);
|
|
221 |
iTestStep->TEST1(data->iModel == expectedPhoneId.iModel, ETrue);
|
|
222 |
iTestStep->TEST1(data->iSerialNumber == expectedPhoneId.iSerialNumber, ETrue);
|
|
223 |
|
|
224 |
iTestStep->INFO_PRINTF2(_L("Phone manufacturer: %S"), &(data->iManufacturer) );
|
|
225 |
iTestStep->INFO_PRINTF2(_L("Phone model: %S"), &(data->iModel) );
|
|
226 |
iTestStep->INFO_PRINTF2(_L("Phone serial number: %S"), &(data->iSerialNumber) );
|
|
227 |
}
|
|
228 |
}
|
|
229 |
else
|
|
230 |
{
|
|
231 |
if(iUseMacros)
|
|
232 |
{
|
|
233 |
iTestStep->INFO_PRINTF2(_L("Error for GetPhoneId: %d"), iStatus.Int() );
|
|
234 |
}
|
|
235 |
}
|
|
236 |
|
|
237 |
CActiveScheduler::Stop();
|
|
238 |
}
|
|
239 |
|
|
240 |
CTestGetSubscriberId::CTestGetSubscriberId()
|
|
241 |
/** Each test step initialises it's own name
|
|
242 |
*/
|
|
243 |
{
|
|
244 |
// store the name of this test case
|
|
245 |
// this is the name that is used by the script file
|
|
246 |
SetTestStepName(_L("TestGetSubscriberId"));
|
|
247 |
}
|
|
248 |
|
|
249 |
|
|
250 |
|
|
251 |
|
|
252 |
/**
|
|
253 |
*
|
|
254 |
@SYMTestCaseID Etel3rdParty 2.1
|
|
255 |
@SYMTestCaseDesc Test GetSubscriberId 3rd party API
|
|
256 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.2
|
|
257 |
*
|
|
258 |
*/
|
|
259 |
|
|
260 |
TVerdict CTestGetSubscriberId::doTestStepL()
|
|
261 |
{
|
|
262 |
//Set test number
|
|
263 |
SetTestNumber(2);
|
|
264 |
|
|
265 |
//Set expected IMSI value
|
|
266 |
_LIT16(SubscriberId, "56789012345678");
|
|
267 |
CTelephony::TSubscriberIdV1 ExpSubscriberId ;
|
|
268 |
ExpSubscriberId.iSubscriberId=SubscriberId;
|
|
269 |
CTelephony::TSubscriberIdV1Pckg expSubscriberIdPckg(ExpSubscriberId);
|
|
270 |
TRequestStatus expStat=KErrNone;
|
|
271 |
|
|
272 |
CTestGetSubscriberIdAct* GetSubscriberIdAct = CTestGetSubscriberIdAct::NewLC(this, iTelephony);
|
|
273 |
|
|
274 |
#if defined(_DEBUG)
|
|
275 |
//Test OOM
|
|
276 |
INFO_PRINTF1(_L("Test OOM for GetSubscriberId"));
|
|
277 |
expStat=KErrNoMemory;
|
|
278 |
__UHEAP_FAILNEXT(1);
|
|
279 |
GetSubscriberIdAct->GetSubscriberId(expSubscriberIdPckg, expStat);
|
|
280 |
CActiveScheduler::Start();
|
|
281 |
__UHEAP_RESET;
|
|
282 |
#endif
|
|
283 |
|
|
284 |
//Start GetSubscriberID AO
|
|
285 |
INFO_PRINTF1(_L("Test GetSubscriberId"));
|
|
286 |
expStat=KErrNone;
|
|
287 |
GetSubscriberIdAct->GetSubscriberId(expSubscriberIdPckg, expStat, ETrue);
|
|
288 |
CActiveScheduler::Start();
|
|
289 |
|
|
290 |
//Test cancel
|
|
291 |
INFO_PRINTF1(_L("Test Cancel for GetSubscriberId"));
|
|
292 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::EGetSubscriberIdCancel);
|
|
293 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
294 |
CTestCanceller* canceller = GetSubscriberIdAct->RetrieveCanceller();
|
|
295 |
GetSubscriberIdAct->GetSubscriberId(expSubscriberIdPckg, expStat);
|
|
296 |
canceller->Call();
|
|
297 |
CActiveScheduler::Start();
|
|
298 |
TEST1(GetSubscriberIdAct->iStatus.Int() == KErrCancel || GetSubscriberIdAct->iStatus.Int() == KErrNone, ETrue);
|
|
299 |
|
|
300 |
CleanupStack::PopAndDestroy(); //GetSubscriberIdAct
|
|
301 |
return TestStepResult();
|
|
302 |
}
|
|
303 |
|
|
304 |
CTestGetSubscriberIdError::CTestGetSubscriberIdError()
|
|
305 |
/** Each test step initialises it's own name
|
|
306 |
*/
|
|
307 |
{
|
|
308 |
// store the name of this test case
|
|
309 |
// this is the name that is used by the script file
|
|
310 |
SetTestStepName(_L("TestGetSubscriberIdError"));
|
|
311 |
}
|
|
312 |
|
|
313 |
/**
|
|
314 |
*
|
|
315 |
@SYMTestCaseID Etel3rdParty 2.2
|
|
316 |
@SYMTestCaseDesc Test GetSubscriberId 3rd party API - Error scenario
|
|
317 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.2
|
|
318 |
*
|
|
319 |
*/
|
|
320 |
|
|
321 |
TVerdict CTestGetSubscriberIdError::doTestStepL()
|
|
322 |
{
|
|
323 |
INFO_PRINTF1(_L("Test Cancel for GetSubscriberId with error."));
|
|
324 |
|
|
325 |
//Set test number
|
|
326 |
SetTestNumber(3);
|
|
327 |
|
|
328 |
//Set expected IMSI value
|
|
329 |
_LIT16(SubscriberId, "01234567890123");
|
|
330 |
CTelephony::TSubscriberIdV1 ExpSubscriberId ;
|
|
331 |
ExpSubscriberId.iSubscriberId=SubscriberId;
|
|
332 |
CTelephony::TSubscriberIdV1Pckg expSubscriberIdPckg(ExpSubscriberId);
|
|
333 |
|
|
334 |
//Start GetSubscriberID AO
|
|
335 |
TRequestStatus expStat=KErrNotSupported;
|
|
336 |
CTestGetSubscriberIdAct* GetSubscriberIdAct = CTestGetSubscriberIdAct::NewLC(this, iTelephony);
|
|
337 |
GetSubscriberIdAct->GetSubscriberId(expSubscriberIdPckg, expStat);
|
|
338 |
|
|
339 |
CActiveScheduler::Start();
|
|
340 |
|
|
341 |
CleanupStack::PopAndDestroy(); //GetSubscriberIdAct
|
|
342 |
return TestStepResult() ;
|
|
343 |
}
|
|
344 |
|
|
345 |
//=====================================================
|
|
346 |
//
|
|
347 |
// Class to get subscriber ID active object
|
|
348 |
//
|
|
349 |
//=====================================================
|
|
350 |
|
|
351 |
CTestGetSubscriberIdAct* CTestGetSubscriberIdAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
352 |
//Factory constructor
|
|
353 |
{
|
|
354 |
CTestGetSubscriberIdAct* obj = new(ELeave) CTestGetSubscriberIdAct(aTestStep, aTelephony);
|
|
355 |
CleanupStack::PushL(obj);
|
|
356 |
obj->ConstructL();
|
|
357 |
return obj;
|
|
358 |
}
|
|
359 |
|
|
360 |
CTestGetSubscriberIdAct::CTestGetSubscriberIdAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
361 |
: CEtelIsvActBase(aTestStep, aTelephony),
|
|
362 |
iSubscriberIdBuff(iSubscriberId),
|
|
363 |
iSubscriberIdPckg(iSubscriberId)
|
|
364 |
{
|
|
365 |
}
|
|
366 |
|
|
367 |
void CTestGetSubscriberIdAct::ConstructL()
|
|
368 |
{
|
|
369 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
370 |
CActiveScheduler::Add(this);
|
|
371 |
}
|
|
372 |
|
|
373 |
CTestGetSubscriberIdAct::~CTestGetSubscriberIdAct()
|
|
374 |
{
|
|
375 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
376 |
delete iCanceller;
|
|
377 |
}
|
|
378 |
|
|
379 |
void CTestGetSubscriberIdAct::DoCancel()
|
|
380 |
{
|
|
381 |
iTelephony->CancelAsync(CTelephony::EGetSubscriberIdCancel);
|
|
382 |
}
|
|
383 |
|
|
384 |
void CTestGetSubscriberIdAct::GetSubscriberId(TDes8& aExpSubscriberIdPckg, TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
385 |
{
|
|
386 |
iExpStat = aExpStat;
|
|
387 |
iExpSubscriberIdPckg=&aExpSubscriberIdPckg;
|
|
388 |
|
|
389 |
TDes8* data;
|
|
390 |
if (iTestStep->iBufferMode)
|
|
391 |
{
|
|
392 |
data = &iSubscriberIdBuff;
|
|
393 |
}
|
|
394 |
else
|
|
395 |
{
|
|
396 |
data = &iSubscriberIdPckg;
|
|
397 |
}
|
|
398 |
|
|
399 |
iTelephony->GetSubscriberId(iStatus, *data);
|
|
400 |
|
|
401 |
if(aCheckConcurrency)
|
|
402 |
{
|
|
403 |
TRequestStatus tmpStatus;
|
|
404 |
iTelephony->GetSubscriberId(tmpStatus, *data);
|
|
405 |
User::WaitForRequest(tmpStatus);
|
|
406 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
407 |
}
|
|
408 |
|
|
409 |
SetActive();
|
|
410 |
}
|
|
411 |
|
|
412 |
void CTestGetSubscriberIdAct::RunL()
|
|
413 |
{
|
|
414 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
415 |
// calling this RunL().
|
|
416 |
CTelephony::TSubscriberIdV1Pckg& expSubscriberIdPckg = REINTERPRET_CAST(CTelephony::TSubscriberIdV1Pckg&, *iExpSubscriberIdPckg);
|
|
417 |
|
|
418 |
//only supports V1 at present
|
|
419 |
CTelephony::TSubscriberIdV1& expSubscriberId = (expSubscriberIdPckg)();
|
|
420 |
|
|
421 |
iTestStep->TEST1(iStatus.Int() == iExpStat.Int(), ETrue);
|
|
422 |
|
|
423 |
if(iStatus.Int() == KErrNone)
|
|
424 |
{
|
|
425 |
CTelephony::TSubscriberIdV1* data;
|
|
426 |
if (iTestStep->iBufferMode)
|
|
427 |
{
|
|
428 |
data = reinterpret_cast<CTelephony::TSubscriberIdV1*> ( &iSubscriberIdBuff() );
|
|
429 |
}
|
|
430 |
else
|
|
431 |
{
|
|
432 |
data = reinterpret_cast<CTelephony::TSubscriberIdV1*> ( &iSubscriberIdPckg() );
|
|
433 |
}
|
|
434 |
|
|
435 |
iTestStep->TEST1(data->iSubscriberId == expSubscriberId.iSubscriberId, ETrue);
|
|
436 |
iTestStep->INFO_PRINTF2(_L("SubscriberId: %S"), &(data->iSubscriberId) );
|
|
437 |
}
|
|
438 |
else
|
|
439 |
{
|
|
440 |
iTestStep->INFO_PRINTF2(_L("Error for GeSubscriberId: %d"), iStatus.Int() );
|
|
441 |
}
|
|
442 |
|
|
443 |
CActiveScheduler::Stop();
|
|
444 |
}
|
|
445 |
|
|
446 |
CTestGetIndicator::CTestGetIndicator()
|
|
447 |
/** Each test step initialises it's own name
|
|
448 |
*/
|
|
449 |
{
|
|
450 |
// store the name of this test case
|
|
451 |
// this is the name that is used by the script file
|
|
452 |
SetTestStepName(_L("TestGetIndicator"));
|
|
453 |
}
|
|
454 |
|
|
455 |
/**
|
|
456 |
*
|
|
457 |
@SYMTestCaseID Etel3rdParty 4.1
|
|
458 |
@SYMTestCaseDesc Test GetIndicator 3rd party API
|
|
459 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.4
|
|
460 |
*
|
|
461 |
*/
|
|
462 |
|
|
463 |
TVerdict CTestGetIndicator::doTestStepL()
|
|
464 |
{
|
|
465 |
//Set test number
|
|
466 |
SetTestNumber(4);
|
|
467 |
|
|
468 |
//Set expected return values
|
|
469 |
TUint32 expIndCaps = CTelephony::KIndChargerConnected | CTelephony::KIndNetworkAvailable | CTelephony::KIndCallInProgress;
|
|
470 |
TUint32 expInd = CTelephony::KIndChargerConnected;
|
|
471 |
TRequestStatus expStat=KErrNone;
|
|
472 |
|
|
473 |
CTestGetIndicatorAct* GetIndicatorAct = CTestGetIndicatorAct::NewLC(this, iTelephony);
|
|
474 |
|
|
475 |
#if defined(_DEBUG)
|
|
476 |
//test OOM
|
|
477 |
INFO_PRINTF1(_L("Test OOM for GetIndicator"));
|
|
478 |
expStat = KErrNoMemory;
|
|
479 |
__UHEAP_FAILNEXT(1);
|
|
480 |
GetIndicatorAct->GetPhoneIndicator(expIndCaps, expInd, expStat);
|
|
481 |
CActiveScheduler::Start();
|
|
482 |
__UHEAP_RESET;
|
|
483 |
#endif
|
|
484 |
|
|
485 |
//Start GetIndicator AO
|
|
486 |
expStat=KErrNone;
|
|
487 |
INFO_PRINTF1(_L("Test GetIndicator"));
|
|
488 |
GetIndicatorAct->GetPhoneIndicator(expIndCaps, expInd, expStat, ETrue);
|
|
489 |
CActiveScheduler::Start();
|
|
490 |
|
|
491 |
//Test cancel
|
|
492 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::EGetIndicatorCancel);
|
|
493 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
494 |
GetIndicatorAct->GetPhoneIndicator(expIndCaps, expInd, expStat);
|
|
495 |
CTestCanceller* canceller = GetIndicatorAct->RetrieveCanceller();
|
|
496 |
canceller->Call();
|
|
497 |
CActiveScheduler::Start();
|
|
498 |
TEST1(GetIndicatorAct->iStatus.Int() == KErrCancel || GetIndicatorAct->iStatus.Int() == KErrNone, ETrue);
|
|
499 |
|
|
500 |
CleanupStack::PopAndDestroy(); //GetIndicatorAct
|
|
501 |
return TestStepResult() ;
|
|
502 |
}
|
|
503 |
|
|
504 |
//=====================================================
|
|
505 |
//
|
|
506 |
// Class to get phone indicator active object
|
|
507 |
//
|
|
508 |
//=====================================================
|
|
509 |
|
|
510 |
CTestGetIndicatorAct* CTestGetIndicatorAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
511 |
//Factory constructor
|
|
512 |
{
|
|
513 |
CTestGetIndicatorAct* obj = new(ELeave) CTestGetIndicatorAct(aTestStep, aTelephony);
|
|
514 |
CleanupStack::PushL(obj);
|
|
515 |
obj->ConstructL();
|
|
516 |
return obj;
|
|
517 |
}
|
|
518 |
|
|
519 |
CTestGetIndicatorAct::CTestGetIndicatorAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
520 |
: CEtelIsvActBase(aTestStep, aTelephony),
|
|
521 |
iIndicatorBuff(iIndicator),
|
|
522 |
iIndicatorPckg(iIndicator)
|
|
523 |
{
|
|
524 |
}
|
|
525 |
|
|
526 |
void CTestGetIndicatorAct::ConstructL()
|
|
527 |
{
|
|
528 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
529 |
CActiveScheduler::Add(this);
|
|
530 |
}
|
|
531 |
|
|
532 |
CTestGetIndicatorAct::~CTestGetIndicatorAct()
|
|
533 |
{
|
|
534 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
535 |
delete iCanceller;
|
|
536 |
}
|
|
537 |
|
|
538 |
void CTestGetIndicatorAct::DoCancel()
|
|
539 |
{
|
|
540 |
iTelephony->CancelAsync(CTelephony::EGetIndicatorCancel);
|
|
541 |
}
|
|
542 |
|
|
543 |
void CTestGetIndicatorAct::GetPhoneIndicator(TUint32 aExpIndCaps, TUint32 aExpInd,TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
544 |
{
|
|
545 |
iExpIndCaps = aExpIndCaps;
|
|
546 |
iExpInd = aExpInd;
|
|
547 |
iExpStat = aExpStat;
|
|
548 |
|
|
549 |
TDes8* data;
|
|
550 |
if (iTestStep->iBufferMode)
|
|
551 |
{
|
|
552 |
data = &iIndicatorBuff;
|
|
553 |
}
|
|
554 |
else
|
|
555 |
{
|
|
556 |
data = &iIndicatorPckg;
|
|
557 |
}
|
|
558 |
|
|
559 |
iTelephony->GetIndicator(iStatus, *data);
|
|
560 |
|
|
561 |
if(aCheckConcurrency)
|
|
562 |
{
|
|
563 |
TRequestStatus tmpStatus;
|
|
564 |
iTelephony->GetIndicator(tmpStatus, *data);
|
|
565 |
User::WaitForRequest(tmpStatus);
|
|
566 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
567 |
}
|
|
568 |
|
|
569 |
SetActive();
|
|
570 |
}
|
|
571 |
|
|
572 |
void CTestGetIndicatorAct::RunL()
|
|
573 |
{
|
|
574 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
575 |
// calling this RunL().
|
|
576 |
|
|
577 |
iTestStep->TEST1(iStatus.Int() == iExpStat.Int(), ETrue);
|
|
578 |
|
|
579 |
if(iStatus.Int() == KErrNone)
|
|
580 |
{
|
|
581 |
CTelephony::TIndicatorV1* data;
|
|
582 |
if (iTestStep->iBufferMode)
|
|
583 |
{
|
|
584 |
data = reinterpret_cast<CTelephony::TIndicatorV1*> ( &iIndicatorBuff() );
|
|
585 |
}
|
|
586 |
else
|
|
587 |
{
|
|
588 |
data = reinterpret_cast<CTelephony::TIndicatorV1*> ( &iIndicatorPckg() );
|
|
589 |
}
|
|
590 |
|
|
591 |
iTestStep->TEST1(iExpIndCaps == data->iCapabilities, ETrue);
|
|
592 |
iTestStep->TEST1(iExpInd == data->iIndicator, ETrue);
|
|
593 |
iTestStep->PrintIndicatorValues(data->iIndicator, data->iCapabilities);
|
|
594 |
}
|
|
595 |
else
|
|
596 |
{
|
|
597 |
iTestStep->INFO_PRINTF2(_L("Error for GetIndicators: %d"), iStatus.Int() );
|
|
598 |
}
|
|
599 |
|
|
600 |
CActiveScheduler::Stop();
|
|
601 |
}
|
|
602 |
|
|
603 |
CTestGetBatteryInfo::CTestGetBatteryInfo()
|
|
604 |
/** Each test step initialises it's own name
|
|
605 |
*/
|
|
606 |
{
|
|
607 |
// store the name of this test case
|
|
608 |
// this is the name that is used by the script file
|
|
609 |
SetTestStepName(_L("TestGetBatteryInfo"));
|
|
610 |
}
|
|
611 |
|
|
612 |
/**
|
|
613 |
*
|
|
614 |
@SYMTestCaseID Etel3rdParty 5.1
|
|
615 |
@SYMTestCaseDesc Test GetBatteryInfo 3rd party API
|
|
616 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.3
|
|
617 |
*
|
|
618 |
*/
|
|
619 |
|
|
620 |
TVerdict CTestGetBatteryInfo::doTestStepL()
|
|
621 |
{
|
|
622 |
INFO_PRINTF1(_L("Test retrieval of battery information status"));
|
|
623 |
|
|
624 |
//Set test number
|
|
625 |
SetTestNumber(5);
|
|
626 |
|
|
627 |
//Set expected result data
|
|
628 |
TRequestStatus expStat=KErrNone;
|
|
629 |
CTelephony::TBatteryInfoV1 BatteryExpInfo;
|
|
630 |
BatteryExpInfo.iStatus=CTelephony::EPowerStatusUnknown;
|
|
631 |
BatteryExpInfo.iChargeLevel=0;
|
|
632 |
CTelephony::TBatteryInfoV1Pckg batteryExpInfoPckg(BatteryExpInfo);
|
|
633 |
CTestGetBatteryInfoAct* GetBatteryInfoAct = CTestGetBatteryInfoAct::NewLC(this, iTelephony);
|
|
634 |
|
|
635 |
#if defined(_DEBUG)
|
|
636 |
//test OOM
|
|
637 |
INFO_PRINTF1(_L("Test OOM for GetBatteryInfo"));
|
|
638 |
expStat=KErrNoMemory;
|
|
639 |
__UHEAP_FAILNEXT(1);
|
|
640 |
GetBatteryInfoAct->GetBatteryInfo(batteryExpInfoPckg, expStat);
|
|
641 |
CActiveScheduler::Start();
|
|
642 |
__UHEAP_RESET;
|
|
643 |
#endif
|
|
644 |
|
|
645 |
//test GetBatteryInfo
|
|
646 |
INFO_PRINTF1(_L("Test GetBatteryInfo"));
|
|
647 |
expStat=KErrNone;
|
|
648 |
GetBatteryInfoAct->GetBatteryInfo(batteryExpInfoPckg, expStat, ETrue);
|
|
649 |
CActiveScheduler::Start();
|
|
650 |
|
|
651 |
//wait for 3 secs then re-test. State should have changed.
|
|
652 |
User::After(3000000);
|
|
653 |
|
|
654 |
expStat=KErrNone;
|
|
655 |
BatteryExpInfo.iStatus=CTelephony::EPoweredByBattery;
|
|
656 |
BatteryExpInfo.iChargeLevel=2;
|
|
657 |
GetBatteryInfoAct->GetBatteryInfo(batteryExpInfoPckg, expStat);
|
|
658 |
CActiveScheduler::Start();
|
|
659 |
|
|
660 |
//wait for 3 secs then re-test. State should have changed.
|
|
661 |
User::After(3000000);
|
|
662 |
|
|
663 |
expStat=KErrGeneral;
|
|
664 |
BatteryExpInfo.iStatus=CTelephony::EPoweredByBattery;
|
|
665 |
BatteryExpInfo.iChargeLevel=20;
|
|
666 |
GetBatteryInfoAct->GetBatteryInfo(batteryExpInfoPckg, expStat);
|
|
667 |
CActiveScheduler::Start();
|
|
668 |
|
|
669 |
//Test cancel
|
|
670 |
User::After(3000000);
|
|
671 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::EGetBatteryInfoCancel);
|
|
672 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
673 |
INFO_PRINTF1(_L("Test Cancel for GetBatteryInfo"));
|
|
674 |
GetBatteryInfoAct->GetBatteryInfo(batteryExpInfoPckg, expStat);
|
|
675 |
CTestCanceller* canceller = GetBatteryInfoAct->RetrieveCanceller();
|
|
676 |
canceller->Call();
|
|
677 |
CActiveScheduler::Start();
|
|
678 |
TEST1(GetBatteryInfoAct->iStatus.Int() == KErrCancel || GetBatteryInfoAct->iStatus.Int() == KErrNone, ETrue);
|
|
679 |
|
|
680 |
CleanupStack::PopAndDestroy(); // GetBatteryInfoAct
|
|
681 |
return TestStepResult() ;
|
|
682 |
}
|
|
683 |
|
|
684 |
//=====================================================
|
|
685 |
//
|
|
686 |
// Class to get battery info active object
|
|
687 |
//
|
|
688 |
//=====================================================
|
|
689 |
|
|
690 |
CTestGetBatteryInfoAct* CTestGetBatteryInfoAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
691 |
//Factory constructor
|
|
692 |
{
|
|
693 |
CTestGetBatteryInfoAct* obj = new(ELeave) CTestGetBatteryInfoAct(aTestStep, aTelephony);
|
|
694 |
CleanupStack::PushL(obj);
|
|
695 |
obj->ConstructL();
|
|
696 |
return obj;
|
|
697 |
}
|
|
698 |
|
|
699 |
CTestGetBatteryInfoAct::CTestGetBatteryInfoAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
700 |
: CEtelIsvActBase(aTestStep, aTelephony),
|
|
701 |
iBatteryInfoBuff(iBatteryInfo),
|
|
702 |
iBatteryInfoPckg(iBatteryInfo)
|
|
703 |
{
|
|
704 |
}
|
|
705 |
|
|
706 |
void CTestGetBatteryInfoAct::ConstructL()
|
|
707 |
{
|
|
708 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
709 |
CActiveScheduler::Add(this);
|
|
710 |
}
|
|
711 |
|
|
712 |
CTestGetBatteryInfoAct::~CTestGetBatteryInfoAct()
|
|
713 |
{
|
|
714 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
715 |
delete iCanceller;
|
|
716 |
}
|
|
717 |
|
|
718 |
void CTestGetBatteryInfoAct::DoCancel()
|
|
719 |
{
|
|
720 |
iTelephony->CancelAsync(CTelephony::EGetBatteryInfoCancel);
|
|
721 |
}
|
|
722 |
|
|
723 |
void CTestGetBatteryInfoAct::GetBatteryInfo(TDes8& aBatteryExpInfoPckg, TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
724 |
{
|
|
725 |
iBatteryExpInfoPckg=&aBatteryExpInfoPckg;
|
|
726 |
iExpStat = aExpStat;
|
|
727 |
|
|
728 |
TDes8* data;
|
|
729 |
if (iTestStep->iBufferMode)
|
|
730 |
{
|
|
731 |
data = &iBatteryInfoBuff;
|
|
732 |
}
|
|
733 |
else
|
|
734 |
{
|
|
735 |
data = &iBatteryInfoPckg;
|
|
736 |
}
|
|
737 |
|
|
738 |
iTelephony->GetBatteryInfo(iStatus, *data);
|
|
739 |
|
|
740 |
if(aCheckConcurrency)
|
|
741 |
{
|
|
742 |
TRequestStatus tmpStatus;
|
|
743 |
iTelephony->GetBatteryInfo(tmpStatus, *data);
|
|
744 |
User::WaitForRequest(tmpStatus);
|
|
745 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
746 |
}
|
|
747 |
|
|
748 |
SetActive();
|
|
749 |
}
|
|
750 |
|
|
751 |
void CTestGetBatteryInfoAct::RunL()
|
|
752 |
{
|
|
753 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
754 |
// calling this RunL().
|
|
755 |
CTelephony::TBatteryInfoV1Pckg& batteryExpInfoPckg = REINTERPRET_CAST(CTelephony::TBatteryInfoV1Pckg&, *iBatteryExpInfoPckg);
|
|
756 |
|
|
757 |
//only supports V1 at present
|
|
758 |
CTelephony::TBatteryInfoV1& batteryExpInfo = (batteryExpInfoPckg)();
|
|
759 |
|
|
760 |
iTestStep->TEST1(iStatus.Int()==iExpStat.Int(), ETrue);
|
|
761 |
|
|
762 |
if(iStatus.Int() == KErrNone)
|
|
763 |
{
|
|
764 |
CTelephony::TBatteryInfoV1* data;
|
|
765 |
if (iTestStep->iBufferMode)
|
|
766 |
{
|
|
767 |
data = reinterpret_cast<CTelephony::TBatteryInfoV1*> ( &iBatteryInfoBuff() );
|
|
768 |
}
|
|
769 |
else
|
|
770 |
{
|
|
771 |
data = reinterpret_cast<CTelephony::TBatteryInfoV1*> ( &iBatteryInfoPckg() );
|
|
772 |
}
|
|
773 |
|
|
774 |
iTestStep->TEST1(data->iStatus==batteryExpInfo.iStatus, ETrue);
|
|
775 |
iTestStep->TEST1(data->iChargeLevel==batteryExpInfo.iChargeLevel, ETrue);
|
|
776 |
iTestStep->PrintBatteryInfo(*data);
|
|
777 |
}
|
|
778 |
else
|
|
779 |
{
|
|
780 |
iTestStep->INFO_PRINTF2(_L("Error for GetBatteryInfo: %d"), iStatus.Int() );
|
|
781 |
}
|
|
782 |
|
|
783 |
iTestStep->INFO_PRINTF1(_L(""));
|
|
784 |
CActiveScheduler::Stop();
|
|
785 |
}
|
|
786 |
|
|
787 |
CTestGetSignalStrength::CTestGetSignalStrength()
|
|
788 |
/** Each test step initialises it's own name
|
|
789 |
*/
|
|
790 |
{
|
|
791 |
// store the name of this test case
|
|
792 |
// this is the name that is used by the script file
|
|
793 |
SetTestStepName(_L("TestGetSignalStrength"));
|
|
794 |
}
|
|
795 |
|
|
796 |
/**
|
|
797 |
*
|
|
798 |
@SYMTestCaseID Etel3rdParty 6.1
|
|
799 |
@SYMTestCaseDesc Test GetSignalStrength 3rd party API
|
|
800 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.??
|
|
801 |
*
|
|
802 |
*/
|
|
803 |
|
|
804 |
TVerdict CTestGetSignalStrength::doTestStepL()
|
|
805 |
{
|
|
806 |
INFO_PRINTF1(_L("Test retrieval of Signal Strength information "));
|
|
807 |
|
|
808 |
//Set test number
|
|
809 |
SetTestNumber(6);
|
|
810 |
//Set expected result values
|
|
811 |
TRequestStatus expStat=KErrNone;
|
|
812 |
CTelephony::TSignalStrengthV1 ExpSignalStrength;
|
|
813 |
ExpSignalStrength.iBar=3;
|
|
814 |
ExpSignalStrength.iSignalStrength=-51;
|
|
815 |
CTelephony::TSignalStrengthV1Pckg expSignalStrengthPckg(ExpSignalStrength);
|
|
816 |
CTestGetSignalStrengthAct* GetSignalStrengthAct = CTestGetSignalStrengthAct::NewLC(this, iTelephony);
|
|
817 |
|
|
818 |
#if defined(_DEBUG)
|
|
819 |
//test OOM
|
|
820 |
INFO_PRINTF1(_L("Test OOM for GetSignalStrength"));
|
|
821 |
expStat=KErrNoMemory;
|
|
822 |
__UHEAP_FAILNEXT(1);
|
|
823 |
GetSignalStrengthAct->GetSignalStrength(expSignalStrengthPckg, expStat);
|
|
824 |
CActiveScheduler::Start();
|
|
825 |
__UHEAP_RESET;
|
|
826 |
#endif
|
|
827 |
|
|
828 |
//Start GetSignalStrength AO
|
|
829 |
INFO_PRINTF1(_L("Test GetSignalStrength"));
|
|
830 |
expStat=KErrNone;
|
|
831 |
GetSignalStrengthAct->GetSignalStrength(expSignalStrengthPckg, expStat, ETrue);
|
|
832 |
CActiveScheduler::Start();
|
|
833 |
|
|
834 |
User::After(3000000);
|
|
835 |
//wait for 3 secs and re-test
|
|
836 |
expStat=KErrNotSupported;
|
|
837 |
GetSignalStrengthAct->GetSignalStrength(expSignalStrengthPckg, expStat);
|
|
838 |
CActiveScheduler::Start();
|
|
839 |
|
|
840 |
//Test cancel
|
|
841 |
User::After(3000000);
|
|
842 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::EGetSignalStrengthCancel);
|
|
843 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
844 |
INFO_PRINTF1(_L("Test Cancel for GetSignalStrength"));
|
|
845 |
GetSignalStrengthAct->GetSignalStrength(expSignalStrengthPckg, expStat);
|
|
846 |
CTestCanceller* canceller = GetSignalStrengthAct->RetrieveCanceller();
|
|
847 |
canceller->Call();
|
|
848 |
CActiveScheduler::Start();
|
|
849 |
TEST1(GetSignalStrengthAct->iStatus.Int() == KErrCancel || GetSignalStrengthAct->iStatus.Int() == KErrNone, ETrue);
|
|
850 |
|
|
851 |
CleanupStack::PopAndDestroy(); //GetSignalStrengthAct
|
|
852 |
return TestStepResult() ;
|
|
853 |
}
|
|
854 |
|
|
855 |
//=====================================================
|
|
856 |
//
|
|
857 |
// Class to get signal strength active object
|
|
858 |
//
|
|
859 |
//=====================================================
|
|
860 |
CTestGetSignalStrengthAct* CTestGetSignalStrengthAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TBool aUseMacros)
|
|
861 |
//Factory constructor
|
|
862 |
{
|
|
863 |
CTestGetSignalStrengthAct* obj = new(ELeave) CTestGetSignalStrengthAct(aTestStep, aTelephony, aUseMacros);
|
|
864 |
CleanupStack::PushL(obj);
|
|
865 |
obj->ConstructL();
|
|
866 |
return obj;
|
|
867 |
}
|
|
868 |
|
|
869 |
CTestGetSignalStrengthAct::CTestGetSignalStrengthAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony, TBool aUseMacros)
|
|
870 |
: CEtelIsvActBase(aTestStep, aTelephony),
|
|
871 |
iUseMacros(aUseMacros),
|
|
872 |
iSignalStrengthBuff(iSignalStrength),
|
|
873 |
iSignalStrengthPckg(iSignalStrength)
|
|
874 |
{
|
|
875 |
}
|
|
876 |
|
|
877 |
void CTestGetSignalStrengthAct::ConstructL()
|
|
878 |
{
|
|
879 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
880 |
CActiveScheduler::Add(this);
|
|
881 |
}
|
|
882 |
|
|
883 |
CTestGetSignalStrengthAct::~CTestGetSignalStrengthAct()
|
|
884 |
{
|
|
885 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
886 |
delete iCanceller;
|
|
887 |
}
|
|
888 |
|
|
889 |
void CTestGetSignalStrengthAct::DoCancel()
|
|
890 |
{
|
|
891 |
iTelephony->CancelAsync(CTelephony::EGetSignalStrengthCancel);
|
|
892 |
}
|
|
893 |
|
|
894 |
void CTestGetSignalStrengthAct::GetSignalStrength(TDes8& aExpSignalStrengthPckg, TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
895 |
{
|
|
896 |
iExpStat = aExpStat;
|
|
897 |
iExpSignalStrengthPckg=&aExpSignalStrengthPckg;
|
|
898 |
|
|
899 |
TDes8* data;
|
|
900 |
if (iTestStep->iBufferMode)
|
|
901 |
{
|
|
902 |
data = &iSignalStrengthBuff;
|
|
903 |
}
|
|
904 |
else
|
|
905 |
{
|
|
906 |
data = &iSignalStrengthPckg;
|
|
907 |
}
|
|
908 |
|
|
909 |
iTelephony->GetSignalStrength(iStatus, *data);
|
|
910 |
|
|
911 |
if(aCheckConcurrency)
|
|
912 |
{
|
|
913 |
TRequestStatus tmpStatus;
|
|
914 |
iTelephony->GetSignalStrength(tmpStatus, *data);
|
|
915 |
User::WaitForRequest(tmpStatus);
|
|
916 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
917 |
}
|
|
918 |
|
|
919 |
SetActive();
|
|
920 |
}
|
|
921 |
|
|
922 |
void CTestGetSignalStrengthAct::RunL()
|
|
923 |
{
|
|
924 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
925 |
// calling this RunL().
|
|
926 |
CTelephony::TSignalStrengthV1Pckg& expSignalStrengthPckg = REINTERPRET_CAST(CTelephony::TSignalStrengthV1Pckg&, *iExpSignalStrengthPckg);
|
|
927 |
|
|
928 |
//only supports V1 at present
|
|
929 |
CTelephony::TSignalStrengthV1& expSignalStrength = (expSignalStrengthPckg)();
|
|
930 |
|
|
931 |
if(iUseMacros)
|
|
932 |
{
|
|
933 |
iTestStep->TEST1(iStatus.Int()==iExpStat.Int(), ETrue);
|
|
934 |
}
|
|
935 |
|
|
936 |
if(iStatus.Int() == KErrNone)
|
|
937 |
{
|
|
938 |
if(iUseMacros)
|
|
939 |
{
|
|
940 |
CTelephony::TSignalStrengthV1* data;
|
|
941 |
if (iTestStep->iBufferMode)
|
|
942 |
{
|
|
943 |
data = reinterpret_cast<CTelephony::TSignalStrengthV1*> ( &iSignalStrengthBuff() );
|
|
944 |
}
|
|
945 |
else
|
|
946 |
{
|
|
947 |
data = reinterpret_cast<CTelephony::TSignalStrengthV1*> ( &iSignalStrengthPckg() );
|
|
948 |
}
|
|
949 |
|
|
950 |
iTestStep->TEST1(data->iBar==expSignalStrength.iBar, ETrue);
|
|
951 |
iTestStep->TEST1(data->iSignalStrength==expSignalStrength.iSignalStrength, ETrue);
|
|
952 |
iTestStep->INFO_PRINTF2(_L("Signal strength (in display bars) : %d"), expSignalStrength.iBar);
|
|
953 |
iTestStep->INFO_PRINTF2(_L("Signal strength (in dBm) : %d"), expSignalStrength.iSignalStrength);
|
|
954 |
}
|
|
955 |
}
|
|
956 |
else
|
|
957 |
{
|
|
958 |
if(iUseMacros)
|
|
959 |
{
|
|
960 |
iTestStep->INFO_PRINTF2(_L("Error for GetSignalStrength: %d"), iStatus.Int() );
|
|
961 |
}
|
|
962 |
}
|
|
963 |
|
|
964 |
CActiveScheduler::Stop();
|
|
965 |
if(iUseMacros)
|
|
966 |
{
|
|
967 |
iTestStep->INFO_PRINTF1(_L(""));
|
|
968 |
}
|
|
969 |
}
|
|
970 |
|
|
971 |
CTestGetLockInfo::CTestGetLockInfo()
|
|
972 |
/** Each test step initialises it's own name
|
|
973 |
*/
|
|
974 |
{
|
|
975 |
// store the name of this test case
|
|
976 |
// this is the name that is used by the script file
|
|
977 |
SetTestStepName(_L("TestGetLockInfo"));
|
|
978 |
}
|
|
979 |
|
|
980 |
/**
|
|
981 |
*
|
|
982 |
@SYMTestCaseID Etel3rdParty 7.1
|
|
983 |
@SYMTestCaseDesc Test GetLockInfo 3rd party API
|
|
984 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.8
|
|
985 |
*
|
|
986 |
*/
|
|
987 |
|
|
988 |
TVerdict CTestGetLockInfo::doTestStepL()
|
|
989 |
{
|
|
990 |
INFO_PRINTF1(_L("Test retrieval of current status of PIN1/PIN2 "));
|
|
991 |
//Set test number
|
|
992 |
SetTestNumber(7);
|
|
993 |
|
|
994 |
//Set expected result values
|
|
995 |
TRequestStatus expStat=KErrNone;
|
|
996 |
CTelephony::TIccLockInfoV1 ExpLockInfo;
|
|
997 |
ExpLockInfo.iSetting = CTelephony::ELockSetDisabled;
|
|
998 |
ExpLockInfo.iStatus = CTelephony::EStatusUnlocked;
|
|
999 |
CTelephony::TIccLockInfoV1Pckg expLockInfoPckg(ExpLockInfo);
|
|
1000 |
CTestGetLockInfoAct* GetLockInfoAct = CTestGetLockInfoAct::NewLC(this, iTelephony);
|
|
1001 |
|
|
1002 |
CTelephony::TIccLock Lock;
|
|
1003 |
#if defined(_DEBUG)
|
|
1004 |
//test OOM
|
|
1005 |
INFO_PRINTF1(_L("Test OOM for GetLockInfo"));
|
|
1006 |
expStat=KErrNoMemory;
|
|
1007 |
Lock=CTelephony::ELockPin1;
|
|
1008 |
__UHEAP_FAILNEXT(1);
|
|
1009 |
GetLockInfoAct->GetLockInfo(Lock, expLockInfoPckg, expStat);
|
|
1010 |
CActiveScheduler::Start();
|
|
1011 |
__UHEAP_RESET;
|
|
1012 |
#endif
|
|
1013 |
|
|
1014 |
//Start GetLockinfo AO for pin1
|
|
1015 |
expStat=KErrNone;
|
|
1016 |
INFO_PRINTF1(_L("Test GetLockInfo"));
|
|
1017 |
Lock=CTelephony::ELockPin1;
|
|
1018 |
INFO_PRINTF1(_L("current status of PIN1 "));
|
|
1019 |
GetLockInfoAct->GetLockInfo(Lock, expLockInfoPckg, expStat, ETrue);
|
|
1020 |
CActiveScheduler::Start();
|
|
1021 |
|
|
1022 |
//Start GetLockinfo AO for pin2
|
|
1023 |
Lock=CTelephony::ELockPin2;
|
|
1024 |
INFO_PRINTF1(_L("current status of PIN2 "));
|
|
1025 |
ExpLockInfo.iSetting = CTelephony::ELockSetEnabled;
|
|
1026 |
ExpLockInfo.iStatus = CTelephony::EStatusLocked;
|
|
1027 |
GetLockInfoAct->GetLockInfo(Lock, expLockInfoPckg, expStat);
|
|
1028 |
CActiveScheduler::Start();
|
|
1029 |
|
|
1030 |
//Test cancel
|
|
1031 |
INFO_PRINTF1(_L("Test Cancel for GetLockInfo"));
|
|
1032 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::EGetLockInfoCancel);
|
|
1033 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
1034 |
GetLockInfoAct->GetLockInfo(Lock, expLockInfoPckg, expStat);
|
|
1035 |
CTestCanceller* canceller = GetLockInfoAct->RetrieveCanceller();
|
|
1036 |
canceller->Call();
|
|
1037 |
CActiveScheduler::Start();
|
|
1038 |
TEST1(GetLockInfoAct->iStatus.Int() == KErrCancel || GetLockInfoAct->iStatus.Int() == KErrNone, ETrue);
|
|
1039 |
|
|
1040 |
CleanupStack::PopAndDestroy(); //GetLockInfoAct
|
|
1041 |
return TestStepResult() ;
|
|
1042 |
}
|
|
1043 |
|
|
1044 |
//=====================================================
|
|
1045 |
//
|
|
1046 |
// Class to get lock info active object
|
|
1047 |
//
|
|
1048 |
//=====================================================
|
|
1049 |
CTestGetLockInfoAct* CTestGetLockInfoAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
1050 |
//Factory constructor
|
|
1051 |
{
|
|
1052 |
CTestGetLockInfoAct* obj = new(ELeave) CTestGetLockInfoAct(aTestStep, aTelephony);
|
|
1053 |
CleanupStack::PushL(obj);
|
|
1054 |
obj->ConstructL();
|
|
1055 |
return obj;
|
|
1056 |
}
|
|
1057 |
|
|
1058 |
CTestGetLockInfoAct::CTestGetLockInfoAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
1059 |
: CEtelIsvActBase(aTestStep, aTelephony),
|
|
1060 |
iLockInfoBuff(iLockInfo),
|
|
1061 |
iLockInfoPckg(iLockInfo)
|
|
1062 |
{
|
|
1063 |
}
|
|
1064 |
|
|
1065 |
void CTestGetLockInfoAct::ConstructL()
|
|
1066 |
{
|
|
1067 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
1068 |
CActiveScheduler::Add(this);
|
|
1069 |
}
|
|
1070 |
|
|
1071 |
CTestGetLockInfoAct::~CTestGetLockInfoAct()
|
|
1072 |
{
|
|
1073 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
1074 |
delete iCanceller;
|
|
1075 |
}
|
|
1076 |
|
|
1077 |
void CTestGetLockInfoAct::DoCancel()
|
|
1078 |
{
|
|
1079 |
iTelephony->CancelAsync(CTelephony::EGetLockInfoCancel);
|
|
1080 |
}
|
|
1081 |
|
|
1082 |
void CTestGetLockInfoAct::GetLockInfo(CTelephony::TIccLock aLock, TDes8& aExpLockInfoPckg, TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
1083 |
{
|
|
1084 |
iExpStat = aExpStat;
|
|
1085 |
iExpLockInfoPckg=&aExpLockInfoPckg;
|
|
1086 |
iLock = aLock;
|
|
1087 |
|
|
1088 |
TDes8* data;
|
|
1089 |
if (iTestStep->iBufferMode)
|
|
1090 |
{
|
|
1091 |
data = &iLockInfoBuff;
|
|
1092 |
}
|
|
1093 |
else
|
|
1094 |
{
|
|
1095 |
data = &iLockInfoPckg;
|
|
1096 |
}
|
|
1097 |
|
|
1098 |
iTelephony->GetLockInfo(iStatus ,aLock ,*data);
|
|
1099 |
|
|
1100 |
if(aCheckConcurrency)
|
|
1101 |
{
|
|
1102 |
TRequestStatus tmpStatus;
|
|
1103 |
iTelephony->GetLockInfo(tmpStatus ,aLock ,*data);
|
|
1104 |
User::WaitForRequest(tmpStatus);
|
|
1105 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
1106 |
}
|
|
1107 |
|
|
1108 |
SetActive();
|
|
1109 |
}
|
|
1110 |
|
|
1111 |
void CTestGetLockInfoAct::RunL()
|
|
1112 |
{
|
|
1113 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
1114 |
// calling this RunL().
|
|
1115 |
CTelephony::TIccLockInfoV1Pckg& expLockInfoPckg = REINTERPRET_CAST(CTelephony::TIccLockInfoV1Pckg&, *iExpLockInfoPckg);
|
|
1116 |
|
|
1117 |
//only supports V1 at present
|
|
1118 |
CTelephony::TIccLockInfoV1& expLockInfo = (expLockInfoPckg)();
|
|
1119 |
|
|
1120 |
iTestStep->TEST1(iStatus.Int()==iExpStat.Int(),1);
|
|
1121 |
|
|
1122 |
if(iStatus.Int() == KErrNone)
|
|
1123 |
{
|
|
1124 |
CTelephony::TIccLockInfoV1* data;
|
|
1125 |
if (iTestStep->iBufferMode)
|
|
1126 |
{
|
|
1127 |
data = reinterpret_cast<CTelephony::TIccLockInfoV1*> ( &iLockInfoBuff() );
|
|
1128 |
}
|
|
1129 |
else
|
|
1130 |
{
|
|
1131 |
data = reinterpret_cast<CTelephony::TIccLockInfoV1*> ( &iLockInfoPckg() );
|
|
1132 |
}
|
|
1133 |
|
|
1134 |
iTestStep->TEST1(data->iSetting==expLockInfo.iSetting,1);
|
|
1135 |
iTestStep->TEST1(data->iStatus==expLockInfo.iStatus,1);
|
|
1136 |
iTestStep->PrintLockInfo(iLock, data->iSetting, data->iStatus);
|
|
1137 |
}
|
|
1138 |
else
|
|
1139 |
{
|
|
1140 |
iTestStep->INFO_PRINTF2(_L("Error for GetLockInfo: %d"), iStatus.Int() );
|
|
1141 |
}
|
|
1142 |
|
|
1143 |
CActiveScheduler::Stop();
|
|
1144 |
iTestStep->INFO_PRINTF1(_L(""));
|
|
1145 |
}
|
|
1146 |
|
|
1147 |
CTestSendDTMFTones::CTestSendDTMFTones()
|
|
1148 |
/** Each test step initialises it's own name
|
|
1149 |
*/
|
|
1150 |
{
|
|
1151 |
// store the name of this test case
|
|
1152 |
// this is the name that is used by the script file
|
|
1153 |
SetTestStepName(_L("TestSendDTMFTones"));
|
|
1154 |
}
|
|
1155 |
|
|
1156 |
/**
|
|
1157 |
*
|
|
1158 |
@SYMTestCaseID Etel3rdParty 8.1
|
|
1159 |
@SYMTestCaseDesc Test SendDTMFTones 3rd party API
|
|
1160 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.9
|
|
1161 |
*
|
|
1162 |
*/
|
|
1163 |
|
|
1164 |
|
|
1165 |
TVerdict CTestSendDTMFTones::doTestStepL()
|
|
1166 |
{
|
|
1167 |
SetTestNumber(8);
|
|
1168 |
|
|
1169 |
INFO_PRINTF1(_L("Test sending of DTMF tones "));
|
|
1170 |
|
|
1171 |
//set test data to transmit
|
|
1172 |
_LIT(KDtmfString0,"45p6789A");
|
|
1173 |
|
|
1174 |
//make a call to send the DTMF through
|
|
1175 |
|
|
1176 |
_LIT(KGoodNumber,"1789");
|
|
1177 |
//Set the call parameters for call
|
|
1178 |
CTelephony::TCallParamsV1 callParams1;
|
|
1179 |
callParams1.iIdRestrict = CTelephony::ESendMyId;
|
|
1180 |
CTelephony::TCallParamsV1Pckg callParamsPckg1(callParams1);
|
|
1181 |
|
|
1182 |
TTestCallParams testCallParams;
|
|
1183 |
testCallParams.iLine = CTelephony::EVoiceLine;
|
|
1184 |
testCallParams.iCallParamsV1Pckg = &callParamsPckg1;
|
|
1185 |
testCallParams.iTelAddress.iTelNumber = KGoodNumber;
|
|
1186 |
testCallParams.iExpStat = KErrNone;
|
|
1187 |
|
|
1188 |
//make the call
|
|
1189 |
CTestDialNewCallAct* testDialNewCallAct = CTestDialNewCallAct::NewLC(this, iTelephony);
|
|
1190 |
testCallParams.iCallId = CTelephony::EISVMaxNumOfCalls;
|
|
1191 |
testDialNewCallAct->TestDialNewCall(testCallParams);
|
|
1192 |
CActiveScheduler::Start();
|
|
1193 |
CleanupStack::PopAndDestroy(testDialNewCallAct);
|
|
1194 |
|
|
1195 |
//wait for call status to be connected
|
|
1196 |
CTelephony::TCallStatusV1 CallStatusV1;
|
|
1197 |
CTelephony::TCallStatusV1Pckg CallStatusPckg(CallStatusV1);
|
|
1198 |
iTelephony->GetCallStatus(testCallParams.iCallId, CallStatusPckg);
|
|
1199 |
TEST1(CallStatusV1.iStatus == CTelephony::EStatusConnected,1);
|
|
1200 |
|
|
1201 |
TRequestStatus expStat=KErrNone;
|
|
1202 |
CTestSendDTMFTonesAct*SendDTMFAct = CTestSendDTMFTonesAct::NewLC(this, iTelephony);
|
|
1203 |
|
|
1204 |
#if defined(_DEBUG)
|
|
1205 |
//test OOM
|
|
1206 |
INFO_PRINTF1(_L("Test OOM for SendDTMFTones"));
|
|
1207 |
expStat=KErrNoMemory;
|
|
1208 |
__UHEAP_FAILNEXT(1);
|
|
1209 |
SendDTMFAct->SendDTMFTone(KDtmfString0, expStat);
|
|
1210 |
CActiveScheduler::Start();
|
|
1211 |
__UHEAP_RESET;
|
|
1212 |
#endif
|
|
1213 |
|
|
1214 |
//set expected result values for DTMF
|
|
1215 |
expStat=KErrNone;
|
|
1216 |
SendDTMFAct->SendDTMFTone(KDtmfString0, expStat, ETrue);
|
|
1217 |
CActiveScheduler::Start();
|
|
1218 |
|
|
1219 |
//Test cancel
|
|
1220 |
INFO_PRINTF1(_L("Test Cancel for SendDTMFTones"));
|
|
1221 |
TInt cancelerr = iTelephony->CancelAsync(CTelephony::ESendDTMFTonesCancel);
|
|
1222 |
TEST1(cancelerr == KErrNotFound, ETrue);
|
|
1223 |
SendDTMFAct->SendDTMFTone(KDtmfString0, expStat);
|
|
1224 |
CTestCanceller* canceller = SendDTMFAct->RetrieveCanceller();
|
|
1225 |
canceller->Call();
|
|
1226 |
CActiveScheduler::Start();
|
|
1227 |
TEST1(SendDTMFAct->iStatus.Int() == KErrCancel, ETrue);
|
|
1228 |
|
|
1229 |
CTestHangupAct* testHangupAct = CTestHangupAct::NewLC(this, iTelephony);
|
|
1230 |
//Hangup call
|
|
1231 |
testHangupAct->TestHangup(testCallParams);
|
|
1232 |
CActiveScheduler::Start();
|
|
1233 |
CleanupStack::PopAndDestroy(testHangupAct);
|
|
1234 |
|
|
1235 |
|
|
1236 |
CleanupStack::PopAndDestroy(SendDTMFAct); //SendDTMFAct
|
|
1237 |
return TestStepResult() ;
|
|
1238 |
}
|
|
1239 |
|
|
1240 |
CTestSendDTMFTonesAct* CTestSendDTMFTonesAct::NewLC(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
1241 |
//Factory constructor
|
|
1242 |
{
|
|
1243 |
CTestSendDTMFTonesAct* obj = new(ELeave) CTestSendDTMFTonesAct(aTestStep, aTelephony);
|
|
1244 |
CleanupStack::PushL(obj);
|
|
1245 |
obj->ConstructL();
|
|
1246 |
return obj;
|
|
1247 |
}
|
|
1248 |
|
|
1249 |
CTestSendDTMFTonesAct::CTestSendDTMFTonesAct(CEtelIsvTestStep* aTestStep, CTelephony* aTelephony)
|
|
1250 |
: CEtelIsvActBase(aTestStep, aTelephony)
|
|
1251 |
{
|
|
1252 |
}
|
|
1253 |
|
|
1254 |
void CTestSendDTMFTonesAct::ConstructL()
|
|
1255 |
{
|
|
1256 |
iCanceller = new(ELeave) CTestCanceller(this);
|
|
1257 |
CActiveScheduler::Add(this);
|
|
1258 |
}
|
|
1259 |
|
|
1260 |
CTestSendDTMFTonesAct::~CTestSendDTMFTonesAct()
|
|
1261 |
{
|
|
1262 |
Cancel(); // if any Req outstanding, calls DoCancel() to cleanup.
|
|
1263 |
delete iCanceller;
|
|
1264 |
}
|
|
1265 |
|
|
1266 |
void CTestSendDTMFTonesAct::DoCancel()
|
|
1267 |
{
|
|
1268 |
iTelephony->CancelAsync(CTelephony::ESendDTMFTonesCancel);
|
|
1269 |
}
|
|
1270 |
|
|
1271 |
void CTestSendDTMFTonesAct::SendDTMFTone(const TDesC& aTones, TRequestStatus aExpStat, TBool aCheckConcurrency)
|
|
1272 |
{
|
|
1273 |
iExpStat = aExpStat;
|
|
1274 |
|
|
1275 |
iTelephony->SendDTMFTones(iStatus, aTones);
|
|
1276 |
|
|
1277 |
if(aCheckConcurrency)
|
|
1278 |
{
|
|
1279 |
TRequestStatus tmpStatus;
|
|
1280 |
iTelephony->SendDTMFTones(tmpStatus, aTones);
|
|
1281 |
User::WaitForRequest(tmpStatus);
|
|
1282 |
iTestStep->TEST1(tmpStatus.Int() == KErrInUse, ETrue);
|
|
1283 |
}
|
|
1284 |
|
|
1285 |
SetActive();
|
|
1286 |
}
|
|
1287 |
|
|
1288 |
void CTestSendDTMFTonesAct::RunL()
|
|
1289 |
{
|
|
1290 |
// ActiveScheduler will have set status to KRequestComplete, just before
|
|
1291 |
// calling this RunL().
|
|
1292 |
|
|
1293 |
iTestStep->TEST1(iStatus.Int()==iExpStat.Int(), 1);
|
|
1294 |
|
|
1295 |
CActiveScheduler::Stop();
|
|
1296 |
iTestStep->INFO_PRINTF1(_L(""));
|
|
1297 |
}
|
|
1298 |
|
|
1299 |
CTestFlightModeWithPublishSubscribe::CTestFlightModeWithPublishSubscribe()
|
|
1300 |
/** Each test step initialises it's own name
|
|
1301 |
*/
|
|
1302 |
{
|
|
1303 |
// store the name of this test case
|
|
1304 |
// this is the name that is used by the script file
|
|
1305 |
SetTestStepName(_L("TestFlightModeWithPublishSubscribe"));
|
|
1306 |
}
|
|
1307 |
|
|
1308 |
/**
|
|
1309 |
*
|
|
1310 |
@SYMTestCaseID Etel3rdParty 3.1
|
|
1311 |
@SYMTestCaseDesc Test GetFlightMode 3rd party API
|
|
1312 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.4.3
|
|
1313 |
*
|
|
1314 |
*/
|
|
1315 |
|
|
1316 |
|
|
1317 |
TVerdict CTestFlightModeWithPublishSubscribe::doTestStepL()
|
|
1318 |
{
|
|
1319 |
INFO_PRINTF1(_L("Test retrieval of flight mode with publish and subscribe"));
|
|
1320 |
|
|
1321 |
RProperty phonePowerProperty;
|
|
1322 |
User::LeaveIfError(phonePowerProperty.Attach(KUidSystemCategory, KUidPhonePwr.iUid));
|
|
1323 |
CleanupClosePushL(phonePowerProperty);
|
|
1324 |
|
|
1325 |
TRequestStatus status;
|
|
1326 |
phonePowerProperty.Subscribe(status);
|
|
1327 |
User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOn));
|
|
1328 |
User::WaitForRequest(status);
|
|
1329 |
TEST(status.Int() == KErrNone);
|
|
1330 |
|
|
1331 |
//Set up the data
|
|
1332 |
CTelephony::TFlightModeV1 FlightMode;
|
|
1333 |
CTelephony::TFlightModeV1Pckg FlightModePckg(FlightMode);
|
|
1334 |
TPckgBuf<CTelephony::TFlightModeV1> FlightModeBuff(FlightMode);
|
|
1335 |
TDes8* FlightModeData;
|
|
1336 |
if (iBufferMode)
|
|
1337 |
{
|
|
1338 |
FlightModeData = &FlightModeBuff;
|
|
1339 |
}
|
|
1340 |
else
|
|
1341 |
{
|
|
1342 |
FlightModeData = &FlightModePckg;
|
|
1343 |
}
|
|
1344 |
CTelephony::TFlightModeV1& FlightModeResult =
|
|
1345 |
reinterpret_cast<CTelephony::TFlightModeV1&> ( const_cast<TUint8&> ( *FlightModeData->Ptr() ) );
|
|
1346 |
|
|
1347 |
//Get current flight mode
|
|
1348 |
TRequestStatus reqStat=KErrNone;
|
|
1349 |
iTelephony->GetFlightMode(reqStat, *FlightModeData);
|
|
1350 |
User::WaitForRequest(reqStat);
|
|
1351 |
|
|
1352 |
//check results
|
|
1353 |
TEST1(reqStat.Int() == KErrNone, ETrue);
|
|
1354 |
TEST1(FlightModeResult.iFlightModeStatus == CTelephony::EFlightModeOff, ETrue);
|
|
1355 |
if (FlightModeResult.iFlightModeStatus == CTelephony::EFlightModeOff)
|
|
1356 |
INFO_PRINTF1(_L("The mobile radio interface and bluetooth is currently on"));
|
|
1357 |
|
|
1358 |
phonePowerProperty.Subscribe(status);
|
|
1359 |
User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOff));
|
|
1360 |
User::WaitForRequest(status);
|
|
1361 |
TEST(status.Int() == KErrNone);
|
|
1362 |
|
|
1363 |
//Get current flight mode
|
|
1364 |
iTelephony->GetFlightMode(reqStat, *FlightModeData);
|
|
1365 |
User::WaitForRequest(reqStat);
|
|
1366 |
|
|
1367 |
//check results
|
|
1368 |
TEST1(reqStat.Int() == KErrNone, ETrue);
|
|
1369 |
TEST1(FlightModeResult.iFlightModeStatus == CTelephony::EFlightModeOn, ETrue);
|
|
1370 |
if (FlightModeResult.iFlightModeStatus == CTelephony::EFlightModeOn)
|
|
1371 |
INFO_PRINTF1(_L("The mobile radio interface and bluetooth is currently off"));
|
|
1372 |
CleanupStack::PopAndDestroy(&phonePowerProperty);
|
|
1373 |
return TestStepResult() ;
|
|
1374 |
}
|
|
1375 |
|
|
1376 |
CTestPhoneFuncFlightModeOnWithPublishSubscribe::CTestPhoneFuncFlightModeOnWithPublishSubscribe()
|
|
1377 |
/** Each test step initialises it's own name
|
|
1378 |
*/
|
|
1379 |
{
|
|
1380 |
// store the name of this test case
|
|
1381 |
// this is the name that is used by the script file
|
|
1382 |
SetTestStepName(_L("TestPhoneFuncFlightModeOnWithPublishSubscribe"));
|
|
1383 |
}
|
|
1384 |
|
|
1385 |
/**
|
|
1386 |
@SYMTestCaseID Etel3rdParty 8.2, TestPhoneFuncFlightModeOn
|
|
1387 |
@SYMTestCaseDesc Test GetSignalStrength and SendDTMFTone 3rd party APIs
|
|
1388 |
@SYMFssID SGL.GT0166.054 v1.3 A2_Telephony_Functional_Specification.doc, REQ 2116.1.?/9
|
|
1389 |
*/
|
|
1390 |
|
|
1391 |
enum TVerdict CTestPhoneFuncFlightModeOnWithPublishSubscribe::doTestStepL()
|
|
1392 |
{
|
|
1393 |
INFO_PRINTF1(_L("START TEST 8.2"));
|
|
1394 |
|
|
1395 |
INFO_PRINTF1(_L(" TEST: Signal Strength information not retrievable when flight mode on with publish and subscribe "));
|
|
1396 |
|
|
1397 |
//Set test number
|
|
1398 |
SetTestNumber(34);
|
|
1399 |
|
|
1400 |
// Set expected status to KErrAccessDenied as this should be returned in
|
|
1401 |
// the case where flight mode is on.
|
|
1402 |
TRequestStatus expStat=KErrAccessDenied;
|
|
1403 |
CTelephony::TSignalStrengthV1 ExpSignalStrength;
|
|
1404 |
ExpSignalStrength.iBar=3;
|
|
1405 |
ExpSignalStrength.iSignalStrength=-51;
|
|
1406 |
CTelephony::TSignalStrengthV1Pckg expSignalStrengthPckg(ExpSignalStrength);
|
|
1407 |
CTestGetSignalStrengthAct* GetSignalStrengthAct = CTestGetSignalStrengthAct::NewLC(this, iTelephony);
|
|
1408 |
|
|
1409 |
// Set up phonePowerProperty variable so that flight mode can be manipulated.
|
|
1410 |
RProperty phonePowerProperty;
|
|
1411 |
User::LeaveIfError(phonePowerProperty.Attach(KUidSystemCategory, KUidPhonePwr.iUid));
|
|
1412 |
CleanupClosePushL(phonePowerProperty);
|
|
1413 |
|
|
1414 |
//Switch flight mode on (ie radio mode off)
|
|
1415 |
TRequestStatus status;
|
|
1416 |
phonePowerProperty.Subscribe(status);
|
|
1417 |
User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOff));
|
|
1418 |
User::WaitForRequest(status);
|
|
1419 |
TEST(status.Int() == KErrNone);
|
|
1420 |
|
|
1421 |
// Make a call to the 3rd Party API.
|
|
1422 |
GetSignalStrengthAct->GetSignalStrength(expSignalStrengthPckg, expStat);
|
|
1423 |
CActiveScheduler::Start();
|
|
1424 |
|
|
1425 |
|
|
1426 |
INFO_PRINTF1(_L("Test sending of DTMF tones disallowed when flight mode on "));
|
|
1427 |
|
|
1428 |
//set test data to transmit
|
|
1429 |
_LIT(KDtmfString0,"45p6789A");
|
|
1430 |
|
|
1431 |
// Switch flight mode off so that a call can be set up.
|
|
1432 |
phonePowerProperty.Subscribe(status);
|
|
1433 |
User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOn));
|
|
1434 |
User::WaitForRequest(status);
|
|
1435 |
TEST(status.Int() == KErrNone);
|
|
1436 |
|
|
1437 |
//Get current flight mode
|
|
1438 |
TRequestStatus reqStat=KErrNone;
|
|
1439 |
CTelephony::TFlightModeV1 FlightMode;
|
|
1440 |
CTelephony::TFlightModeV1Pckg FlightModePckg(FlightMode);
|
|
1441 |
iTelephony->GetFlightMode(reqStat, FlightModePckg);
|
|
1442 |
User::WaitForRequest(reqStat);
|
|
1443 |
|
|
1444 |
//check results
|
|
1445 |
TEST1(reqStat.Int() == KErrNone, ETrue);
|
|
1446 |
TEST1(FlightMode.iFlightModeStatus == CTelephony::EFlightModeOff, ETrue);
|
|
1447 |
if (FlightMode.iFlightModeStatus == CTelephony::EFlightModeOff)
|
|
1448 |
INFO_PRINTF1(_L("The mobile radio interface and bluetooth is currently on"));
|
|
1449 |
|
|
1450 |
// Switch flight mode on (ie radio mode off) to test that
|
|
1451 |
// DTMF Tone sending fails is disallowed in flight mode.
|
|
1452 |
phonePowerProperty.Subscribe(status);
|
|
1453 |
User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOff));
|
|
1454 |
User::WaitForRequest(status);
|
|
1455 |
TEST(status.Int() == KErrNone);
|
|
1456 |
|
|
1457 |
|
|
1458 |
//set expected result values for DTMF
|
|
1459 |
CTestSendDTMFTonesAct*SendDTMFAct = CTestSendDTMFTonesAct::NewLC(this, iTelephony);
|
|
1460 |
expStat=KErrAccessDenied;
|
|
1461 |
SendDTMFAct->SendDTMFTone(KDtmfString0, expStat);
|
|
1462 |
CActiveScheduler::Start();
|
|
1463 |
|
|
1464 |
// Switch flight mode off (ie radio mode on)
|
|
1465 |
// so that the call can be hung up.
|
|
1466 |
phonePowerProperty.Subscribe(status);
|
|
1467 |
User::LeaveIfError(phonePowerProperty.Set(KUidSystemCategory,KUidPhonePwr.iUid,ESAPhoneOn));
|
|
1468 |
User::WaitForRequest(status);
|
|
1469 |
TEST(status.Int() == KErrNone);
|
|
1470 |
|
|
1471 |
|
|
1472 |
INFO_PRINTF1(_L("END TEST 8.2"));
|
|
1473 |
|
|
1474 |
|
|
1475 |
//CleanupStack::PopAndDestroy(testHangupAct);
|
|
1476 |
CleanupStack::PopAndDestroy(SendDTMFAct); //SendDTMFAct
|
|
1477 |
//CleanupStack::PopAndDestroy(testDialNewCallAct);
|
|
1478 |
CleanupStack::PopAndDestroy(&phonePowerProperty);
|
|
1479 |
CleanupStack::PopAndDestroy(GetSignalStrengthAct);
|
|
1480 |
return TestStepResult() ;
|
|
1481 |
|
|
1482 |
}
|
|
1483 |
|