|
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 LaunchBrowser in the SAT. |
|
20 */ |
|
21 |
|
22 #include <satcs.h> |
|
23 #include <ctsy/ltsy/sat_defs.h> |
|
24 |
|
25 #include <ctsy/ltsy/mltsydispatchsatinterface.h> |
|
26 #include <test/mockltsyindicatorids.h> |
|
27 #include <test/tmockltsydata.h> |
|
28 |
|
29 #include "ccsatlaunchbrowserfu.h" |
|
30 |
|
31 static const TUint8 KCommandNumber = 1; |
|
32 static const TUint8 KCommandType = KLaunchBrowser; |
|
33 static const TUint8 KSourceDevice = KSim; |
|
34 static const TUint8 KDestinationDevice = KMe; |
|
35 static const TUint8 KCodingScheme = K8BitDCS; |
|
36 |
|
37 static const TInt KDelay = 10; |
|
38 |
|
39 _LIT8(KURL, "www.symbian.ru"); |
|
40 _LIT8(KBearerList, "\x01\x03\x01\x03"); |
|
41 _LIT8(KText, "Gateway/Proxy"); |
|
42 _LIT8(KAlphaId, "phase"); |
|
43 _LIT8(KNULL, "\x00"); |
|
44 _LIT8(KFileRef, "1234567890"); |
|
45 |
|
46 CTestSuite* CCSatLaunchBrowserFU::CreateSuiteL(const TDesC& aName) |
|
47 { |
|
48 SUB_SUITE; |
|
49 |
|
50 ADD_TEST_STEP_ISO_CPP(CCSatLaunchBrowserFU, TestNotifyLaunchBrowserPCmd0001L); |
|
51 ADD_TEST_STEP_ISO_CPP(CCSatLaunchBrowserFU, TestNotifyLaunchBrowserPCmd0002L); |
|
52 ADD_TEST_STEP_ISO_CPP(CCSatLaunchBrowserFU, TestNotifyLaunchBrowserPCmd0004L); |
|
53 |
|
54 END_SUITE; |
|
55 } |
|
56 |
|
57 void CCSatLaunchBrowserFU::PrepareTlvData ( TTlv& aTlvData ) |
|
58 { |
|
59 aTlvData.Begin(KBerTlvProactiveSimCommandTag); |
|
60 |
|
61 aTlvData.AddTag(KTlvCommandDetailsTag); // Command details |
|
62 aTlvData.AddByte(KCommandNumber); // Command number |
|
63 aTlvData.AddByte(KCommandType); // Command type |
|
64 aTlvData.AddByte(iData.iCommandQualifier); // Command qualifier |
|
65 |
|
66 aTlvData.AddTag(KTlvDeviceIdentityTag); // Device identities |
|
67 aTlvData.AddByte(KSourceDevice); // Source device |
|
68 aTlvData.AddByte(KDestinationDevice); // Destination device |
|
69 |
|
70 if ( iData.iUrl.Length() > 0 ) |
|
71 { |
|
72 aTlvData.AddTag(KTlvUrlTag); |
|
73 aTlvData.AddData(iData.iUrl); |
|
74 } |
|
75 |
|
76 if ( iData.iBearerList.Length() > 0 ) |
|
77 { |
|
78 aTlvData.AddTag(KTlvBearerTag); |
|
79 aTlvData.AddData(iData.iBearerList); |
|
80 } |
|
81 |
|
82 if ( iData.iText.Length() > 0 ) |
|
83 { |
|
84 aTlvData.AddTag(KTlvTextStringTag); |
|
85 aTlvData.AddByte(KCodingScheme); |
|
86 aTlvData.AddData(iData.iText); |
|
87 } |
|
88 |
|
89 if ( iData.iAlphaId.Length() > 0 || iData.iIfAlphaId ) |
|
90 { |
|
91 aTlvData.AddTag(KTlvAlphaIdentifierTag); |
|
92 aTlvData.AddData(iData.iAlphaId); |
|
93 } |
|
94 |
|
95 if ( iData.iIfUsedBrowserId ) |
|
96 { |
|
97 aTlvData.AddTag(KTlvBrowserIdentityTag); |
|
98 aTlvData.AddByte(iData.iBrowserId); |
|
99 } |
|
100 |
|
101 if ( iData.iFileRef.Length() > 0 ) |
|
102 { |
|
103 aTlvData.AddTag(KTlvProvisioningReferenceFileTag); |
|
104 aTlvData.AddData(iData.iFileRef); |
|
105 aTlvData.AddTag(KTwoByteLengthCoding); |
|
106 } |
|
107 } |
|
108 |
|
109 void CCSatLaunchBrowserFU::PrepareExpectDataL () |
|
110 { |
|
111 RBuf8 data; |
|
112 CleanupClosePushL(data); |
|
113 |
|
114 TUint8 commandType = KLaunchBrowser; |
|
115 TMockLtsyData1<TUint8> expLtsyData(commandType); |
|
116 expLtsyData.SerialiseL(data); |
|
117 iMockLTSY.ExpectL(MLtsyDispatchSatPCmdNotification::KLtsyDispatchSatPCmdNotificationApiId, data); |
|
118 |
|
119 CleanupStack::PopAndDestroy(1); // data |
|
120 } |
|
121 |
|
122 void CCSatLaunchBrowserFU::PrepareCompleteDataL ( TInt aResultCode ) |
|
123 { |
|
124 RBuf8 data; |
|
125 CleanupClosePushL(data); |
|
126 |
|
127 TTlv tlv; |
|
128 PrepareTlvData( tlv ); |
|
129 |
|
130 TPtrC8 tlvDsc = tlv.End(); |
|
131 TDesC8* tlvDscPtr = &tlvDsc; |
|
132 TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr); |
|
133 tlvDscPack.SerialiseL(data); |
|
134 iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, aResultCode, data, KDelay); |
|
135 |
|
136 CleanupStack::PopAndDestroy(1); // data |
|
137 } |
|
138 |
|
139 void CCSatLaunchBrowserFU::ProactiveCommandCallL( |
|
140 RSat::TLaunchBrowserV2& aLaunchBrowserData, |
|
141 TInt aCompleteErrorCode, |
|
142 TInt aResultCode, |
|
143 TBool aIfCreateTerminal, |
|
144 RSat::TPCmdResult aGeneralResult, |
|
145 TUint8 aCommandQualifier, |
|
146 const TDesC& aAdditionalInfo |
|
147 ) |
|
148 { |
|
149 TRequestStatus requestStatus; |
|
150 |
|
151 PrepareExpectDataL (); |
|
152 |
|
153 RSat::TLaunchBrowserV2Pckg setpPck(aLaunchBrowserData); |
|
154 iSat.NotifyLaunchBrowserPCmd(requestStatus, setpPck); |
|
155 |
|
156 PrepareCompleteDataL ( aCompleteErrorCode ); |
|
157 |
|
158 if ( aIfCreateTerminal ) |
|
159 { |
|
160 PrepareTerminalResponseMockDataL( |
|
161 KCommandNumber, |
|
162 KCommandType, |
|
163 aCommandQualifier, |
|
164 aAdditionalInfo, |
|
165 aGeneralResult, |
|
166 KNullDesC8); |
|
167 } |
|
168 |
|
169 User::WaitForRequest(requestStatus); |
|
170 ASSERT_EQUALS(aResultCode, requestStatus.Int()); |
|
171 AssertMockLtsyStatusL(); |
|
172 } |
|
173 |
|
174 void CCSatLaunchBrowserFU::DataInitialization( |
|
175 TUint8 aCommandQualifier, |
|
176 const TDesC8& aUrl, |
|
177 const TDesC8& aBearerList, |
|
178 const TDesC8& aText, |
|
179 const TDesC8& aAlphaId, |
|
180 const TDesC8& aFileRef, |
|
181 TBool aIfUsedBrowserId, |
|
182 TUint aBrowserId, |
|
183 TBool aIfAlphaId |
|
184 ) |
|
185 { |
|
186 iData.iUrl.Copy(aUrl); |
|
187 iData.iBearerList.Copy(aBearerList); |
|
188 iData.iText.Copy(aText); |
|
189 iData.iAlphaId.Copy(aAlphaId); |
|
190 iData.iFileRef.Copy(aFileRef); |
|
191 iData.iCommandQualifier = aCommandQualifier; |
|
192 iData.iBrowserId = aBrowserId; |
|
193 iData.iIfUsedBrowserId = aIfUsedBrowserId; |
|
194 iData.iIfAlphaId = aIfAlphaId; |
|
195 } |
|
196 |
|
197 void CCSatLaunchBrowserFU::TerminalResponseCallL( |
|
198 const RSat& aSat, |
|
199 RSat::TPCmdResult aGeneralResult, |
|
200 const TDesC& aAdditionalInfo, |
|
201 TInt aResultCode, |
|
202 TUint aInfoType |
|
203 ) |
|
204 { |
|
205 RSat::TLaunchBrowserRspV2 launchBrowser; |
|
206 RSat::TLaunchBrowserRspV2Pckg launchBrowserPckg(launchBrowser); |
|
207 TRequestStatus requestStatus; |
|
208 |
|
209 launchBrowser.iGeneralResult = aGeneralResult; |
|
210 launchBrowser.SetPCmdNumber(KCommandNumber); |
|
211 launchBrowser.iInfoType = aInfoType; |
|
212 |
|
213 PrepareTerminalResponseMockDataL( |
|
214 KCommandNumber, |
|
215 KCommandType, |
|
216 iData.iCommandQualifier, |
|
217 aAdditionalInfo, |
|
218 launchBrowser.iGeneralResult, |
|
219 KNullDesC8); |
|
220 |
|
221 aSat.TerminalRsp(requestStatus, RSat::ELaunchBrowser, launchBrowserPckg); |
|
222 User::WaitForRequest(requestStatus); |
|
223 ASSERT_EQUALS(aResultCode, requestStatus.Int()); |
|
224 } |
|
225 |
|
226 void CCSatLaunchBrowserFU::DataCompareL( const RSat::TLaunchBrowserV2& aLaunchBrowser ) |
|
227 { |
|
228 |
|
229 RSat::TBrowserSelection browserSel; |
|
230 switch( iData.iCommandQualifier ) |
|
231 { |
|
232 case KLaunchBrowserIfNotYetLaunched: |
|
233 browserSel = RSat::ELaunchBrowserIfNotAlreadyLaunched; |
|
234 break; |
|
235 case KUseExistingBrowser: |
|
236 browserSel = RSat::EUseExistingBrowser; |
|
237 break; |
|
238 case KCloseAndLaunchNewBrowser: |
|
239 browserSel = RSat::ECloseExistingLaunchNewBrowserSession; |
|
240 break; |
|
241 case KLaunchBrowserCmdQualifierNotUsed: |
|
242 case KLaunchBrowserCmdQualifierReserved: |
|
243 default: |
|
244 browserSel = RSat::EBrowserSelectionNotSet; |
|
245 } |
|
246 |
|
247 ASSERT_EQUALS( browserSel, aLaunchBrowser.iBrowserSel ); |
|
248 |
|
249 RSat::TAlphaIdBuf alphaId; |
|
250 alphaId.Copy(iData.iAlphaId); |
|
251 ASSERT_EQUALS( 0, alphaId.Compare( aLaunchBrowser.iAlphaId.iAlphaId ) ); |
|
252 |
|
253 RSat::TTextString text; |
|
254 text.Copy( iData.iText ); |
|
255 ASSERT_EQUALS( 0, text.Compare( aLaunchBrowser.iText ) ); |
|
256 |
|
257 ASSERT_EQUALS( 0, iData.iBearerList.Compare( aLaunchBrowser.iBearerList ) ); |
|
258 ASSERT_EQUALS( 0, iData.iUrl.Compare( aLaunchBrowser.iUrl ) ); |
|
259 |
|
260 } |
|
261 |
|
262 void CCSatLaunchBrowserFU::ClearData( RSat::TLaunchBrowserV2& aLaunchBrowser ) |
|
263 { |
|
264 aLaunchBrowser.ResetFileRef(); |
|
265 aLaunchBrowser.iBrowserSel = RSat::EBrowserSelectionNotSet; |
|
266 aLaunchBrowser.iBrowserId = RSat::EBrowserIdNotSet; |
|
267 aLaunchBrowser.iUrl.Zero(); |
|
268 aLaunchBrowser.iBearerList.Zero(); |
|
269 aLaunchBrowser.iText.Zero(); |
|
270 aLaunchBrowser.iAlphaId.iAlphaId.Zero(); |
|
271 } |
|
272 |
|
273 |
|
274 // |
|
275 // Actual test cases |
|
276 // |
|
277 |
|
278 |
|
279 /** |
|
280 @SYMTestCaseID BA-CSAT-LB-SNLBPC-0001 |
|
281 @SYMPREQ 1780 |
|
282 @SYMComponent telephony_csat |
|
283 @SYMTestCaseDesc Test support in CSAT for RSat::NotifyLaunchBrowserPCmd |
|
284 @SYMTestPriority High |
|
285 @SYMTestActions Invokes RSat::NotifyLaunchBrowserPCmd |
|
286 @SYMTestExpectedResults Pass |
|
287 @SYMTestType CT |
|
288 */ |
|
289 void CCSatLaunchBrowserFU::TestNotifyLaunchBrowserPCmd0001L() |
|
290 { |
|
291 |
|
292 static const TUint8 KCmdQualifierArray[] = { |
|
293 KLaunchBrowserCmdQualifierNotUsed, |
|
294 KUseExistingBrowser, |
|
295 KCloseAndLaunchNewBrowser, |
|
296 KLaunchBrowserCmdQualifierReserved, |
|
297 KLaunchBrowserCmdQualifierReserved + 1 }; |
|
298 |
|
299 static const RSat::TPCmdResult KGenResultArray[] = { |
|
300 RSat::KPSessionTerminatedByUser, |
|
301 RSat::KBackwardModeRequestedByUser, |
|
302 RSat::KNoResponseFromUser, |
|
303 RSat::KMeUnableToProcessCmd, |
|
304 RSat::KCmdBeyondMeCapabilities, |
|
305 RSat::KCmdDataNotUnderstood, |
|
306 RSat::KLaunchBrowserError, |
|
307 RSat::KPCmdNotAcceptedByUser, |
|
308 RSat::KCmdTypeNotUnderstood, |
|
309 RSat::KMissingInformation, |
|
310 RSat::KPartialComprehension, |
|
311 RSat::KNetworkUnableToProcessCmd, |
|
312 RSat::KCmdNumberNotKnown }; |
|
313 |
|
314 static const TUint KArrayInfoType[] = { |
|
315 RSat::KMeProblem, |
|
316 RSat::KBearerUnvailable, |
|
317 RSat::KBrowserUnavailable, |
|
318 RSat::KMeUnableToReadProvisioningData, |
|
319 RSat::KNoSpecificBrowserError, |
|
320 RSat::KServiceError }; |
|
321 |
|
322 const TInt KSize = sizeof(KCmdQualifierArray)/sizeof(KCmdQualifierArray[0]); |
|
323 const TInt KArraySize = sizeof(KGenResultArray)/sizeof(KGenResultArray[0]); |
|
324 const TInt KArrayITSize = sizeof(KArrayInfoType)/sizeof(KArrayInfoType[0]); |
|
325 const TUint8 KCommandQualifier = KLaunchBrowserIfNotYetLaunched; |
|
326 |
|
327 OpenEtelServerL(EUseExtendedError); |
|
328 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
329 OpenPhoneL(); |
|
330 OpenSatL(); |
|
331 |
|
332 RSat::TLaunchBrowserV2 launchBrowser; |
|
333 TRequestStatus requestStatus; |
|
334 DataInitialization(KCommandQualifier, KURL, KBearerList, KText, KAlphaId, KFileRef); |
|
335 |
|
336 //------------------------------------------------------------------------- |
|
337 // TEST C: Successful completion request of |
|
338 // RSat::NotifyLaunchBrowserPCmd |
|
339 //------------------------------------------------------------------------- |
|
340 |
|
341 ProactiveCommandCallL(launchBrowser); |
|
342 TerminalResponseCallL(iSat); |
|
343 DataCompareL( launchBrowser ); |
|
344 AssertMockLtsyStatusL(); |
|
345 |
|
346 //------------------------------------------------------------------------- |
|
347 // TEST E: Coverage test(s) for RSat::NotifyLaunchBrowserPCmd |
|
348 //------------------------------------------------------------------------- |
|
349 |
|
350 iMockLTSY.NotifyTerminated(requestStatus); |
|
351 |
|
352 PrepareCompleteDataL (); |
|
353 |
|
354 RSat::TAdditionalInfo additionalInfo; |
|
355 additionalInfo.Append(RSat::KNoSpecificMeProblem); |
|
356 |
|
357 PrepareTerminalResponseMockDataL( |
|
358 KCommandNumber, |
|
359 KCommandType, |
|
360 KCommandQualifier, |
|
361 additionalInfo, |
|
362 RSat::KMeUnableToProcessCmd, |
|
363 KNullDesC8); |
|
364 |
|
365 User::WaitForRequest(requestStatus); |
|
366 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
367 AssertMockLtsyStatusL(); |
|
368 |
|
369 //------------------------------------------------------------------------- |
|
370 // to increase CSatNotifyLaunchBrowser::CompleteNotifyL coverage |
|
371 // in case of "switch ( cmdQualifier )" |
|
372 //------------------------------------------------------------------------- |
|
373 |
|
374 TBool prepareMockData = EFalse; |
|
375 TUint8 element = 0; |
|
376 |
|
377 for ( TInt i = 0; i < KSize; i++ ) |
|
378 { |
|
379 element = KCmdQualifierArray[i]; |
|
380 prepareMockData = |
|
381 element == KLaunchBrowserCmdQualifierNotUsed || |
|
382 element == KLaunchBrowserCmdQualifierReserved; |
|
383 |
|
384 DataInitialization(element, KURL, KBearerList, KText, KAlphaId, KFileRef); |
|
385 |
|
386 ClearData(launchBrowser); |
|
387 if ( prepareMockData ) |
|
388 { |
|
389 ProactiveCommandCallL( |
|
390 launchBrowser, |
|
391 KErrNone, |
|
392 KErrCorrupt, |
|
393 ETrue, |
|
394 RSat::KCmdTypeNotUnderstood, |
|
395 element); |
|
396 } |
|
397 else |
|
398 { |
|
399 ProactiveCommandCallL(launchBrowser); |
|
400 } |
|
401 |
|
402 if ( !prepareMockData ) |
|
403 { |
|
404 TerminalResponseCallL(iSat); |
|
405 DataCompareL( launchBrowser ); |
|
406 } |
|
407 |
|
408 AssertMockLtsyStatusL(); |
|
409 } |
|
410 |
|
411 //------------------------------------------------------------------------- |
|
412 // to increase CSatNotifyLaunchBrowser::TerminalResponseL coverage |
|
413 // in case of general result value isn't valid |
|
414 //------------------------------------------------------------------------- |
|
415 |
|
416 RSat::TPCmdResult elementResult; |
|
417 TInt resultCode = KErrNone; |
|
418 for (TInt i = 0; i < KArraySize; i++) |
|
419 { |
|
420 elementResult = KGenResultArray[i]; |
|
421 additionalInfo.Zero(); |
|
422 |
|
423 switch( elementResult ) |
|
424 { |
|
425 case RSat::KCmdDataNotUnderstood: |
|
426 case RSat::KCmdTypeNotUnderstood: |
|
427 case RSat::KMissingInformation: |
|
428 case RSat::KPartialComprehension: |
|
429 { |
|
430 break; |
|
431 } |
|
432 default: |
|
433 { |
|
434 additionalInfo.Append(RSat::KNoSpecificMeProblem); |
|
435 } |
|
436 } |
|
437 |
|
438 TerminalResponseCallL(iSat, elementResult, additionalInfo, resultCode); |
|
439 AssertMockLtsyStatusL(); |
|
440 } |
|
441 |
|
442 //------------------------------------------------------------------------- |
|
443 // to increase CSatNotifyLaunchBrowser::TerminalResponseL coverage |
|
444 // in case of infotype isn't valid |
|
445 //------------------------------------------------------------------------- |
|
446 |
|
447 TUint elementIT; |
|
448 for (TInt i = 0; i < KArrayITSize; i++) |
|
449 { |
|
450 elementIT = KArrayInfoType[i]; |
|
451 |
|
452 if ( RSat::KMeProblem == elementIT || |
|
453 RSat::KServiceError == elementIT ) |
|
454 { |
|
455 resultCode = KErrCorrupt; |
|
456 } |
|
457 else |
|
458 { |
|
459 resultCode = KErrNone; |
|
460 } |
|
461 |
|
462 TerminalResponseCallL(iSat, RSat::KSuccess, KNullDesC, resultCode, elementIT); |
|
463 AssertMockLtsyStatusL(); |
|
464 } |
|
465 |
|
466 //------------------------------------------------------------------------- |
|
467 // to increase CSatNotifyLaunchBrowser::ParseBrowserIdL coverage |
|
468 // in case of "if ( 0x00 == aLaunchBrowserV2.iBearerList.Length() )" |
|
469 //------------------------------------------------------------------------- |
|
470 |
|
471 DataInitialization(KCommandQualifier, KURL, KBearerList, KText, KAlphaId, KFileRef, ETrue); |
|
472 ClearData(launchBrowser); |
|
473 ProactiveCommandCallL(launchBrowser); |
|
474 AssertMockLtsyStatusL(); |
|
475 |
|
476 //------------------------------------------------------------------------- |
|
477 // to increase CSatNotifyLaunchBrowser::ParseBrowserIdL coverage |
|
478 // in case of "if ( 0x00 != browserId.GetShortInfo( ETLV_BrowserIdentity ) )" |
|
479 //------------------------------------------------------------------------- |
|
480 |
|
481 TUint browserId = RSat::EBrowserIdNotPresent; |
|
482 DataInitialization(KCommandQualifier, KURL, KBearerList, KText, KAlphaId, KFileRef, ETrue, browserId); |
|
483 ClearData(launchBrowser); |
|
484 ProactiveCommandCallL( |
|
485 launchBrowser, |
|
486 KErrNone, |
|
487 KErrCorrupt, |
|
488 ETrue, |
|
489 RSat::KCmdDataNotUnderstood); |
|
490 |
|
491 //------------------------------------------------------------------------- |
|
492 // to increase CSatNotifyLaunchBrowser::ParseUrlL coverage |
|
493 // in case of KTlvUrlTag isn't found. |
|
494 //------------------------------------------------------------------------- |
|
495 |
|
496 DataInitialization(KCommandQualifier, KNullDesC8, KBearerList, KText, KAlphaId, KFileRef); |
|
497 ClearData(launchBrowser); |
|
498 ProactiveCommandCallL( |
|
499 launchBrowser, |
|
500 KErrNone, |
|
501 KErrCorrupt, |
|
502 ETrue, |
|
503 RSat::KErrorRequiredValuesMissing); |
|
504 |
|
505 //------------------------------------------------------------------------- |
|
506 // to increase CSatNotifyLaunchBrowser::ParseBearerListL coverage |
|
507 // in case of KTlvBearerTag isn't found. |
|
508 //------------------------------------------------------------------------- |
|
509 |
|
510 DataInitialization(KCommandQualifier, KURL, KNullDesC8, KText, KAlphaId, KFileRef); |
|
511 ClearData(launchBrowser); |
|
512 ProactiveCommandCallL(launchBrowser); |
|
513 |
|
514 //------------------------------------------------------------------------- |
|
515 // to increase CSatNotifyLaunchBrowser::ParseBearerListL coverage |
|
516 // in case of "if ( 0x00 == aLaunchBrowserV2.iBearerList.Length() )" |
|
517 //------------------------------------------------------------------------- |
|
518 |
|
519 additionalInfo.Zero(); |
|
520 additionalInfo.Append(RSat::KBearerUnvailable); |
|
521 |
|
522 DataInitialization(KCommandQualifier, KURL, KNULL, KText, KAlphaId, KFileRef); |
|
523 ClearData(launchBrowser); |
|
524 ProactiveCommandCallL( |
|
525 launchBrowser, |
|
526 KErrNone, |
|
527 KErrCorrupt, |
|
528 ETrue, |
|
529 RSat::KLaunchBrowserError, |
|
530 KCommandQualifier, |
|
531 additionalInfo); |
|
532 |
|
533 //------------------------------------------------------------------------- |
|
534 // to increase CSatNotifyLaunchBrowser::CompleteNotifyL coverage |
|
535 // in case of KTlvTextStringTag isn't found. |
|
536 //------------------------------------------------------------------------- |
|
537 |
|
538 DataInitialization(KCommandQualifier, KURL, KBearerList, KNullDesC8, KAlphaId, KFileRef); |
|
539 ClearData(launchBrowser); |
|
540 ProactiveCommandCallL(launchBrowser); |
|
541 |
|
542 //------------------------------------------------------------------------- |
|
543 // to increase CSatNotifyLaunchBrowser::CompleteNotifyL coverage |
|
544 // in case of KTlvAlphaIdentifierTag isn't found. |
|
545 //------------------------------------------------------------------------- |
|
546 |
|
547 DataInitialization(KCommandQualifier, KURL, KBearerList, KText, KNullDesC8, KFileRef); |
|
548 ClearData(launchBrowser); |
|
549 ProactiveCommandCallL(launchBrowser); |
|
550 |
|
551 //------------------------------------------------------------------------- |
|
552 // to increase CSatNotifyLaunchBrowser::ParseProvisioningFileListL coverage |
|
553 // in case of "if ( ( RSat::KFileRefMaxSize < stringLength ) || |
|
554 // ( 4 > stringLength ) )" |
|
555 //------------------------------------------------------------------------- |
|
556 |
|
557 additionalInfo.Zero(); |
|
558 additionalInfo.Append(RSat::KMeUnableToReadProvisioningData); |
|
559 |
|
560 DataInitialization(KCommandQualifier, KURL, KBearerList, KText, KAlphaId, KNULL); |
|
561 ClearData(launchBrowser); |
|
562 ProactiveCommandCallL( |
|
563 launchBrowser, |
|
564 KErrNone, |
|
565 KErrCorrupt, |
|
566 ETrue, |
|
567 RSat::KLaunchBrowserError, |
|
568 KCommandQualifier, |
|
569 additionalInfo); |
|
570 |
|
571 //------------------------------------------------------------------------- |
|
572 // to increase CSatNotifyLaunchBrowser::ParseBrowserIdL coverage |
|
573 // in case of "if ( KErrNotFound == returnValue )" |
|
574 //------------------------------------------------------------------------- |
|
575 |
|
576 DataInitialization( |
|
577 KCommandQualifier, |
|
578 KURL, KBearerList, |
|
579 KText, |
|
580 KNullDesC8, |
|
581 KFileRef, |
|
582 EFalse, |
|
583 RSat::EBrowserIdNotSet, |
|
584 ETrue); |
|
585 ClearData(launchBrowser); |
|
586 ProactiveCommandCallL(launchBrowser); |
|
587 |
|
588 //------------------------------------------------------------------------- |
|
589 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
590 //------------------------------------------------------------------------- |
|
591 |
|
592 ClearData(launchBrowser); |
|
593 ProactiveCommandCallL(launchBrowser, KErrUnknown, KErrUnknown); |
|
594 |
|
595 AssertMockLtsyStatusL(); |
|
596 CleanupStack::PopAndDestroy(this); // this |
|
597 |
|
598 } |
|
599 |
|
600 |
|
601 /** |
|
602 @SYMTestCaseID BA-CSAT-LB-SNLBPC-0002 |
|
603 @SYMPREQ 1780 |
|
604 @SYMComponent telephony_csat |
|
605 @SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifyLaunchBrowserPCmd |
|
606 @SYMTestPriority High |
|
607 @SYMTestActions Invokes cancelling of RSat::NotifyLaunchBrowserPCmd |
|
608 @SYMTestExpectedResults Pass |
|
609 @SYMTestType CT |
|
610 */ |
|
611 void CCSatLaunchBrowserFU::TestNotifyLaunchBrowserPCmd0002L() |
|
612 { |
|
613 |
|
614 OpenEtelServerL(EUseExtendedError); |
|
615 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
616 OpenPhoneL(); |
|
617 OpenSatL(); |
|
618 |
|
619 TRequestStatus requestStatus; |
|
620 |
|
621 RSat::TLaunchBrowserV2 launchBrowser; |
|
622 RSat::TLaunchBrowserV2Pckg launchBrowserPck(launchBrowser); |
|
623 |
|
624 DataInitialization(KCommandQualifier, KURL, KBearerList, KText, KAlphaId, KFileRef); |
|
625 |
|
626 //------------------------------------------------------------------------- |
|
627 // Test cancelling of RSat::NotifyLaunchBrowserPCmd |
|
628 //------------------------------------------------------------------------- |
|
629 |
|
630 PrepareExpectDataL(); |
|
631 |
|
632 iSat.NotifyLaunchBrowserPCmd(requestStatus, launchBrowserPck); |
|
633 |
|
634 iSat.CancelAsyncRequest(ESatNotifyLaunchBrowserPCmd); |
|
635 |
|
636 User::WaitForRequest(requestStatus); |
|
637 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
|
638 AssertMockLtsyStatusL(); |
|
639 |
|
640 CleanupStack::PopAndDestroy(1); // this |
|
641 |
|
642 } |
|
643 |
|
644 /** |
|
645 @SYMTestCaseID BA-CSAT-LB-SNLBPC-0004 |
|
646 @SYMPREQ 1780 |
|
647 @SYMComponent telephony_csat |
|
648 @SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifyLaunchBrowserPCmd |
|
649 @SYMTestPriority High |
|
650 @SYMTestActions Invokes multiple client requests to RSat::NotifyLaunchBrowserPCmd |
|
651 @SYMTestExpectedResults Pass |
|
652 @SYMTestType CT |
|
653 */ |
|
654 void CCSatLaunchBrowserFU::TestNotifyLaunchBrowserPCmd0004L() |
|
655 { |
|
656 |
|
657 OpenEtelServerL(EUseExtendedError); |
|
658 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
659 OpenPhoneL(); |
|
660 OpenSatL(); |
|
661 |
|
662 // Open second client |
|
663 RTelServer telServer2; |
|
664 TInt ret = telServer2.Connect(); |
|
665 ASSERT_EQUALS(KErrNone, ret); |
|
666 CleanupClosePushL(telServer2); |
|
667 |
|
668 RMobilePhone phone2; |
|
669 ret = phone2.Open(telServer2,KMmTsyPhoneName); |
|
670 ASSERT_EQUALS(KErrNone, ret); |
|
671 CleanupClosePushL(phone2); |
|
672 |
|
673 RSat sat2; |
|
674 ret = sat2.Open(phone2); |
|
675 ASSERT_EQUALS(KErrNone, ret); |
|
676 CleanupClosePushL(sat2); |
|
677 |
|
678 TRequestStatus requestStatus1; |
|
679 TRequestStatus requestStatus2; |
|
680 TUint8 commandQualifier = KLaunchBrowserIfNotYetLaunched; |
|
681 |
|
682 DataInitialization(commandQualifier, KURL, KBearerList, KText, KAlphaId, KFileRef); |
|
683 |
|
684 //------------------------------------------------------------------------- |
|
685 // Test A: Test multiple clients requesting RSat::NotifyLaunchBrowserPCmd |
|
686 // when they both pass the same T-class version |
|
687 //------------------------------------------------------------------------- |
|
688 |
|
689 PrepareExpectDataL(); |
|
690 |
|
691 RSat::TLaunchBrowserV2 launchBrowser1; |
|
692 RSat::TLaunchBrowserV2Pckg launchBrowserPck1(launchBrowser1); |
|
693 iSat.NotifyLaunchBrowserPCmd(requestStatus1, launchBrowserPck1); |
|
694 |
|
695 RSat::TLaunchBrowserV2 launchBrowser2; |
|
696 RSat::TLaunchBrowserV2Pckg launchBrowserPck2(launchBrowser2); |
|
697 sat2.NotifyLaunchBrowserPCmd(requestStatus2, launchBrowserPck2); |
|
698 |
|
699 PrepareCompleteDataL(); |
|
700 |
|
701 User::WaitForRequest(requestStatus1); |
|
702 User::WaitForRequest(requestStatus2); |
|
703 |
|
704 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
705 //probably «KErrServerBusy?is more appropriate result here |
|
706 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
707 |
|
708 TerminalResponseCallL(iSat); |
|
709 TerminalResponseCallL(sat2); |
|
710 |
|
711 DataCompareL( launchBrowser1 ); |
|
712 DataCompareL( launchBrowser2 ); |
|
713 |
|
714 AssertMockLtsyStatusL(); |
|
715 CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this |
|
716 |
|
717 } |
|
718 |
|
719 |