|
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 DisplayText in the SAT. |
|
20 */ |
|
21 |
|
22 #include "ccsatdisplaytextfu.h" |
|
23 #include <etel.h> |
|
24 #include <etelmm.h> |
|
25 #include <satcs.h> |
|
26 #include <test/tmockltsydata.h> |
|
27 |
|
28 CTestSuite* CCSatDisplayTextFU::CreateSuiteL(const TDesC& aName) |
|
29 { |
|
30 SUB_SUITE; |
|
31 |
|
32 ADD_TEST_STEP_ISO_CPP(CCSatDisplayTextFU, TestNotifyDisplayTextPCmd0001L); |
|
33 ADD_TEST_STEP_ISO_CPP(CCSatDisplayTextFU, TestNotifyDisplayTextPCmd0001bL); |
|
34 ADD_TEST_STEP_ISO_CPP(CCSatDisplayTextFU, TestNotifyDisplayTextPCmd0002L); |
|
35 ADD_TEST_STEP_ISO_CPP(CCSatDisplayTextFU, TestNotifyDisplayTextPCmd0004L); |
|
36 |
|
37 END_SUITE; |
|
38 } |
|
39 |
|
40 |
|
41 /** |
|
42 Fills in a Tlv with command details and device identities for DisplayText proactive command |
|
43 @param aTlv Tlv to fill in |
|
44 @param aPCmdNumber proactive command number |
|
45 @param aCommandQualifier DisplayText proactive command qualifier |
|
46 */ |
|
47 void CCSatDisplayTextFU::DisplayTextPCmdTlvBegin( |
|
48 TTlv& aTlv, |
|
49 TUint8 aPCmdNumber, |
|
50 TUint8 aCommandQualifier) |
|
51 { |
|
52 ProactiveCmdTlvBegin( aTlv, aPCmdNumber, KDisplayText, aCommandQualifier, KDisplay ); |
|
53 } |
|
54 |
|
55 |
|
56 /** |
|
57 Resets RSat::DisplayTextVx data fields |
|
58 @param aDspTxtData data to be reset |
|
59 */ |
|
60 void ResetDisplayTextData(RSat::TDisplayTextV1& aDspTxtData) |
|
61 { |
|
62 // reset public members |
|
63 switch( aDspTxtData.ExtensionId() ) |
|
64 { |
|
65 default: |
|
66 case RSat::KSatV2: |
|
67 (static_cast<RSat::TDisplayTextV2*>(&aDspTxtData))->iDuration.iNumOfUnits = 0; |
|
68 (static_cast<RSat::TDisplayTextV2*>(&aDspTxtData))->iDuration.iTimeUnit = RSat::ETimeUnitNotSet; |
|
69 case RSat::KSatV1: |
|
70 { |
|
71 RSat::TDisplayTextV1& dspTxtDataV1( *static_cast<RSat::TDisplayTextV1*>(&aDspTxtData) ); |
|
72 |
|
73 dspTxtDataV1.iClearScreenTrigger = RSat::EClearScreenTriggerNotSet; |
|
74 dspTxtDataV1.iIconId.iIdentifier = 0; |
|
75 dspTxtDataV1.iIconId.iQualifier = RSat::EIconQualifierNotSet; |
|
76 dspTxtDataV1.iImmediateRsp = RSat::EImmediateRspNotSet; |
|
77 dspTxtDataV1.iPriority = RSat::EDisplayPriorityNotSet; |
|
78 dspTxtDataV1.iText.SetLength(0); |
|
79 } |
|
80 break; |
|
81 } |
|
82 |
|
83 // reset protected members; |
|
84 aDspTxtData.SetPCmdNumber(0); |
|
85 } |
|
86 |
|
87 |
|
88 /** |
|
89 Test support in CSATTSY for successful RSat::NotifyDisplayTextPCmd with specified terminal response |
|
90 @param aCommandQualifier display text proactive command qualifier |
|
91 @param aTextToDisplay text for the Terminal to display |
|
92 @param aResp terminal response data |
|
93 @param aExpResult expected result of TerminalRsp() execution |
|
94 */ |
|
95 void CCSatDisplayTextFU::TestNotifyDisplayTextSuccessfulL( |
|
96 TUint8 aCommandQualifier, |
|
97 const TDesC8& aTextToDisplay, |
|
98 const RSat::TDisplayTextRspV1& aResp, |
|
99 const TInt aExpResult) |
|
100 { |
|
101 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
102 |
|
103 RSat::TDisplayTextV2 dspTxtData; |
|
104 ResetDisplayTextData(dspTxtData); |
|
105 RSat::TDisplayTextV2Pckg dspTxtDataPckg(dspTxtData); |
|
106 TRequestStatus stat; |
|
107 iSat.NotifyDisplayTextPCmd(stat, dspTxtDataPckg); |
|
108 |
|
109 TTlv dspTxtTlv; |
|
110 TUint8 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
111 DisplayTextPCmdTlvBegin( dspTxtTlv, aResp.PCmdNumber(), dispTextMask ); |
|
112 |
|
113 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
114 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
115 dspTxtTlv.AddData(aTextToDisplay); |
|
116 |
|
117 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
118 |
|
119 |
|
120 User::WaitForRequest(stat); |
|
121 ASSERT_EQUALS(KErrNone, stat.Int()); |
|
122 |
|
123 // check result |
|
124 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(aTextToDisplay, dspTxtData.iText)); |
|
125 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
126 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
127 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
128 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
129 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
130 ASSERT_EQUALS(aResp.PCmdNumber(), dspTxtData.PCmdNumber()); |
|
131 |
|
132 GenerateTerminalResponseL(aCommandQualifier, aResp, aExpResult); |
|
133 |
|
134 AssertMockLtsyStatusL(); |
|
135 } |
|
136 |
|
137 |
|
138 /** |
|
139 Handles sending a terminal response |
|
140 @param aCommandQualifier display text proactive command qualifier |
|
141 @param aResp terminal response data |
|
142 @param aExpResult expected result of TerminalRsp() execution |
|
143 */ |
|
144 void CCSatDisplayTextFU::GenerateTerminalResponseL( |
|
145 TUint8 aCommandQualifier, |
|
146 const RSat::TDisplayTextRspV1& aResp, |
|
147 const TInt aExpResult) |
|
148 { |
|
149 |
|
150 TPtrC genResultAddInfo(KNullDesC); |
|
151 if ( RSat::KMeProblem == aResp.iInfoType ) |
|
152 { |
|
153 genResultAddInfo.Set( aResp.iAdditionalInfo ); |
|
154 } |
|
155 |
|
156 RSat::TDisplayTextRspV1Pckg respPckg(aResp); |
|
157 CCSatComponentTestBase::GenerateTerminalResponseL( |
|
158 aResp.PCmdNumber(), |
|
159 KDisplayText, |
|
160 aCommandQualifier, |
|
161 RSat::EDisplayText, |
|
162 respPckg, |
|
163 genResultAddInfo, |
|
164 aResp.iGeneralResult, |
|
165 KNullDesC8, |
|
166 aExpResult); |
|
167 } |
|
168 |
|
169 |
|
170 // |
|
171 // Actual test cases |
|
172 // |
|
173 |
|
174 |
|
175 /** |
|
176 @SYMTestCaseID BA-CSAT-DT-SNDTPC-0001 |
|
177 @SYMPREQ 1780 |
|
178 @SYMComponent telephony_csat |
|
179 @SYMTestCaseDesc Test support in CSAT for RSat::NotifyDisplayTextPCmd |
|
180 @SYMTestPriority High |
|
181 @SYMTestActions Invokes RSat::NotifyDisplayTextPCmd |
|
182 @SYMTestExpectedResults Pass |
|
183 @SYMTestType CT |
|
184 */ |
|
185 void CCSatDisplayTextFU::TestNotifyDisplayTextPCmd0001L() |
|
186 { |
|
187 |
|
188 OpenEtelServerL(EUseExtendedError); |
|
189 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
190 OpenPhoneL(); |
|
191 OpenSatL(); |
|
192 |
|
193 //------------------------------------------------------------------------- |
|
194 // TEST C: Successful completion request of |
|
195 // RSat::NotifyDisplayTextPCmd when result is not cached. |
|
196 //------------------------------------------------------------------------- |
|
197 // Expected Sequence 1.1 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.1. |
|
198 // (DISPLAY TEXT normal priority, Unpacked 8 bit data for Text String, successful) |
|
199 //------------------------------------------------------------------------- |
|
200 |
|
201 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
202 |
|
203 RSat::TDisplayTextV2 dspTxtData; |
|
204 ResetDisplayTextData(dspTxtData); |
|
205 RSat::TDisplayTextV2Pckg dspTxtDataPckg(dspTxtData); |
|
206 TRequestStatus requestStatus; |
|
207 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
208 |
|
209 TTlv dspTxtTlv; |
|
210 TUint8 pcmdNumber = 1; |
|
211 TUint8 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
212 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
213 |
|
214 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
215 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
216 _LIT8(KTextToDisplay, "Toolkit Test 1"); |
|
217 dspTxtTlv.AddData(KTextToDisplay); |
|
218 |
|
219 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
220 |
|
221 User::WaitForRequest(requestStatus); |
|
222 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
223 |
|
224 // check result |
|
225 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay, dspTxtData.iText)); |
|
226 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
227 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
228 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
229 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
230 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
231 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
232 |
|
233 //generate the terminal response |
|
234 RSat::TDisplayTextRspV1 resp; |
|
235 resp.iGeneralResult = RSat::KSuccess; |
|
236 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
237 resp.iAdditionalInfo.Zero(); |
|
238 resp.SetPCmdNumber(pcmdNumber); |
|
239 |
|
240 GenerateTerminalResponseL(dispTextMask, resp); |
|
241 AssertMockLtsyStatusL(); |
|
242 |
|
243 //------------------------------------------------------------------------- |
|
244 // TEST F: Coverage test(s) for RSat::NotifyDisplayTextPCmd |
|
245 //------------------------------------------------------------------------- |
|
246 // Expected Sequence 1.3 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.3. |
|
247 // (DISPLAY TEXT, high priority, Unpacked 8 bit data for Text String, successful) |
|
248 //------------------------------------------------------------------------- |
|
249 |
|
250 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
251 ResetDisplayTextData(dspTxtData); |
|
252 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
253 |
|
254 dispTextMask = KMessageClearMask | KPriorityMask; //user must acknowledge the message. high priority. |
|
255 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
256 |
|
257 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
258 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
259 _LIT8(KTextToDisplay2, "Toolkit Test 2"); |
|
260 dspTxtTlv.AddData(KTextToDisplay2); |
|
261 |
|
262 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
263 |
|
264 |
|
265 User::WaitForRequest(requestStatus); |
|
266 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
267 |
|
268 |
|
269 // check result |
|
270 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay2, dspTxtData.iText)); |
|
271 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
272 ASSERT_EQUALS(RSat::EHighPriority, dspTxtData.iPriority); |
|
273 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
274 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
275 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
276 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
277 |
|
278 |
|
279 //generate the terminal response |
|
280 resp.iGeneralResult = RSat::KSuccess; |
|
281 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
282 resp.iAdditionalInfo.Zero(); |
|
283 resp.SetPCmdNumber(pcmdNumber); |
|
284 |
|
285 GenerateTerminalResponseL(dispTextMask, resp); |
|
286 AssertMockLtsyStatusL(); |
|
287 |
|
288 //------------------------------------------------------------------------- |
|
289 // Expected Sequence 1.5 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.5. |
|
290 // (DISPLAY TEXT, Clear message after delay, successful) |
|
291 //------------------------------------------------------------------------- |
|
292 |
|
293 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
294 ResetDisplayTextData(dspTxtData); |
|
295 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
296 |
|
297 dispTextMask = 0; //Clear message after a delay. normal priority. |
|
298 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
299 |
|
300 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
301 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
302 _LIT8(KTextToDisplay4, "Toolkit Test 4"); |
|
303 dspTxtTlv.AddData(KTextToDisplay4); |
|
304 |
|
305 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
306 |
|
307 |
|
308 User::WaitForRequest(requestStatus); |
|
309 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
310 |
|
311 |
|
312 // check result |
|
313 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay4, dspTxtData.iText)); |
|
314 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
315 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
316 ASSERT_EQUALS(RSat::EClearAfterDelay, dspTxtData.iClearScreenTrigger); |
|
317 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
318 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
319 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
320 |
|
321 |
|
322 //generate the terminal response |
|
323 resp.iGeneralResult = RSat::KSuccess; |
|
324 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
325 resp.iAdditionalInfo.Zero(); |
|
326 resp.SetPCmdNumber(pcmdNumber); |
|
327 |
|
328 GenerateTerminalResponseL(dispTextMask, resp); |
|
329 AssertMockLtsyStatusL(); |
|
330 |
|
331 //------------------------------------------------------------------------- |
|
332 // Expected Sequence 4.1 See ETSI TS 102 384 in subclause 27.22.4.1.4.4.2, Expected Sequence 4.1. |
|
333 // (DISPLAY TEXT, sustained text, unpacked data 8 bits, successful) |
|
334 //------------------------------------------------------------------------- |
|
335 |
|
336 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
337 ResetDisplayTextData(dspTxtData); |
|
338 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
339 |
|
340 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
341 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
342 |
|
343 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
344 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
345 dspTxtTlv.AddData(KTextToDisplay); |
|
346 |
|
347 dspTxtTlv.AddTag(KTlvImmediateResponseTag); |
|
348 |
|
349 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
350 |
|
351 |
|
352 User::WaitForRequest(requestStatus); |
|
353 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
354 |
|
355 |
|
356 // check result |
|
357 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay, dspTxtData.iText)); |
|
358 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
359 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
360 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
361 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
362 ASSERT_EQUALS(RSat::EImmediateRsp, dspTxtData.iImmediateRsp); |
|
363 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
364 |
|
365 |
|
366 //generate the terminal response |
|
367 resp.iGeneralResult = RSat::KSuccess; |
|
368 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
369 resp.iAdditionalInfo.Zero(); |
|
370 resp.SetPCmdNumber(pcmdNumber); |
|
371 |
|
372 GenerateTerminalResponseL(dispTextMask, resp); |
|
373 AssertMockLtsyStatusL(); |
|
374 |
|
375 //------------------------------------------------------------------------- |
|
376 // Expected Sequence 5.1A See ETSI TS 102 384 in subclause 27.22.4.1.5.4.2, Expected Sequence 5.1A. |
|
377 // (DISPLAY TEXT, display of basic icon, self-explanatory, successful) |
|
378 //------------------------------------------------------------------------- |
|
379 |
|
380 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
381 ResetDisplayTextData(dspTxtData); |
|
382 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
383 |
|
384 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
385 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
386 |
|
387 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
388 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
389 _LIT8(KTextToDisplay51, "Basic Icon"); |
|
390 dspTxtTlv.AddData(KTextToDisplay51); |
|
391 |
|
392 dspTxtTlv.AddTag(KTlvIconIdentifierTag); |
|
393 TUint8 iconQualifier = 0; // self explanatory |
|
394 dspTxtTlv.AddByte(iconQualifier); //ETLV_IconQualifier |
|
395 TUint8 iconId = 1; // record 1 in EFIMG |
|
396 dspTxtTlv.AddByte(iconId); //ETLV_IconIdentifier |
|
397 |
|
398 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
399 |
|
400 |
|
401 User::WaitForRequest(requestStatus); |
|
402 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
403 |
|
404 // check whole result by package |
|
405 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay51, dspTxtData.iText)); |
|
406 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
407 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
408 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
409 ASSERT_EQUALS(RSat::ESelfExplanatory, dspTxtData.iIconId.iQualifier); |
|
410 ASSERT_EQUALS(static_cast<TUint8>(1), dspTxtData.iIconId.iIdentifier); |
|
411 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
412 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
413 |
|
414 //------------------------------------------------------------------------- |
|
415 // Expected Sequence 5.2A See ETSI TS 102 384 in subclause 27.22.4.1.5.4.2, Expected Sequence 5.2A. |
|
416 // (DISPLAY TEXT, display of colour icon, successful) |
|
417 //------------------------------------------------------------------------- |
|
418 |
|
419 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
420 ResetDisplayTextData(dspTxtData); |
|
421 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
422 |
|
423 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
424 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
425 |
|
426 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
427 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
428 _LIT8(KTextToDisplay52, "Colour Icon"); |
|
429 dspTxtTlv.AddData(KTextToDisplay52); |
|
430 |
|
431 dspTxtTlv.AddTag(KTlvIconIdentifierTag); |
|
432 iconQualifier = 1; // not self explanatory |
|
433 dspTxtTlv.AddByte(iconQualifier); //ETLV_IconQualifier |
|
434 iconId = 2; // record 2 in EFIMG |
|
435 dspTxtTlv.AddByte(iconId); //ETLV_IconIdentifier |
|
436 |
|
437 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
438 |
|
439 |
|
440 User::WaitForRequest(requestStatus); |
|
441 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
442 |
|
443 // check whole result by package |
|
444 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay52, dspTxtData.iText)); |
|
445 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
446 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
447 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
448 ASSERT_EQUALS(RSat::ENotSelfExplanatory, dspTxtData.iIconId.iQualifier); |
|
449 ASSERT_EQUALS(static_cast<TUint8>(2), dspTxtData.iIconId.iIdentifier); |
|
450 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
451 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
452 |
|
453 |
|
454 //generate the terminal response |
|
455 resp.iGeneralResult = RSat::KSuccess; |
|
456 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
457 resp.iAdditionalInfo.Zero(); |
|
458 resp.SetPCmdNumber(pcmdNumber); |
|
459 |
|
460 GenerateTerminalResponseL(dispTextMask, resp); |
|
461 AssertMockLtsyStatusL(); |
|
462 |
|
463 //------------------------------------------------------------------------- |
|
464 // TEST E: Unsolicited completion of RSat::NotifyDisplayTextPCmd |
|
465 // from LTSY. |
|
466 //------------------------------------------------------------------------- |
|
467 |
|
468 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
469 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
470 |
|
471 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
472 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
473 dspTxtTlv.AddData(KTextToDisplay); |
|
474 |
|
475 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
476 |
|
477 resp.iAdditionalInfo.Zero(); |
|
478 resp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem); |
|
479 PrepareTerminalResponseMockDataL(pcmdNumber, KDisplayText, dispTextMask, resp.iAdditionalInfo, RSat::KMeUnableToProcessCmd, KNullDesC8); |
|
480 |
|
481 TRequestStatus mockLtsyStatus; |
|
482 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
483 User::WaitForRequest(mockLtsyStatus); |
|
484 |
|
485 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
486 AssertMockLtsyStatusL(); |
|
487 |
|
488 //------------------------------------------------------------------------- |
|
489 // TEST B: failure on completion of pending request from LTSY->SATTSY |
|
490 //------------------------------------------------------------------------- |
|
491 |
|
492 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
493 ResetDisplayTextData(dspTxtData); |
|
494 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
495 |
|
496 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
497 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
498 |
|
499 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
500 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
501 dspTxtTlv.AddData(KTextToDisplay); |
|
502 |
|
503 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrGeneral); |
|
504 |
|
505 User::WaitForRequest(requestStatus); |
|
506 |
|
507 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
508 AssertMockLtsyStatusL(); |
|
509 |
|
510 CleanupStack::PopAndDestroy(this); |
|
511 |
|
512 } |
|
513 |
|
514 |
|
515 /** |
|
516 @SYMTestCaseID BA-CSAT-DT-SNDTPC-0001b |
|
517 @SYMPREQ 1780 |
|
518 @SYMComponent telephony_csat |
|
519 @SYMTestCaseDesc Test support in CSAT for RSat::NotifyDisplayTextPCmd when problems in processing command |
|
520 @SYMTestPriority High |
|
521 @SYMTestActions Invokes RSat::NotifyDisplayTextPCmd |
|
522 @SYMTestExpectedResults Pass |
|
523 @SYMTestType CT |
|
524 */ |
|
525 void CCSatDisplayTextFU::TestNotifyDisplayTextPCmd0001bL() |
|
526 { |
|
527 |
|
528 OpenEtelServerL(EUseExtendedError); |
|
529 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
530 OpenPhoneL(); |
|
531 OpenSatL(); |
|
532 |
|
533 //------------------------------------------------------------------------- |
|
534 // Expected Sequence 1.2 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.2. |
|
535 // (DISPLAY TEXT normal priority, Unpacked 8 bit data for Text String, screen busy) |
|
536 //------------------------------------------------------------------------- |
|
537 |
|
538 TUint8 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
539 _LIT8(KTextToDisplay, "Toolkit Test 1"); |
|
540 |
|
541 RSat::TDisplayTextRspV1 resp; |
|
542 resp.iGeneralResult = RSat::KMeUnableToProcessCmd; |
|
543 resp.iInfoType = RSat::KMeProblem; |
|
544 resp.iAdditionalInfo.Zero(); |
|
545 resp.iAdditionalInfo.Append(RSat::KScreenBusy); |
|
546 TUint8 pcmdNumber = 1; |
|
547 resp.SetPCmdNumber(pcmdNumber); |
|
548 |
|
549 TestNotifyDisplayTextSuccessfulL(dispTextMask, KTextToDisplay, resp); |
|
550 |
|
551 //------------------------------------------------------------------------- |
|
552 // Expected Sequence 1.7 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.7. |
|
553 // (DISPLAY TEXT, Backward move in UICC session, successful) |
|
554 //------------------------------------------------------------------------- |
|
555 |
|
556 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
557 _LIT8(KTextToDisplayBackwards, "<GO-BACKWARDS>"); |
|
558 |
|
559 resp.iGeneralResult = RSat::KBackwardModeRequestedByUser; |
|
560 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
561 resp.iAdditionalInfo.Zero(); |
|
562 resp.SetPCmdNumber(pcmdNumber); |
|
563 |
|
564 TestNotifyDisplayTextSuccessfulL(dispTextMask, KTextToDisplayBackwards, resp); |
|
565 |
|
566 //------------------------------------------------------------------------- |
|
567 // Expected Sequence 1.8 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.8. |
|
568 // (DISPLAY TEXT, session terminated by user) |
|
569 //------------------------------------------------------------------------- |
|
570 |
|
571 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
572 _LIT8(KTextToDisplayAbort, "<ABORT>"); |
|
573 |
|
574 resp.iGeneralResult = RSat::KPSessionTerminatedByUser; |
|
575 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
576 resp.iAdditionalInfo.Zero(); |
|
577 resp.SetPCmdNumber(pcmdNumber); |
|
578 |
|
579 TestNotifyDisplayTextSuccessfulL(dispTextMask, KTextToDisplayAbort, resp); |
|
580 |
|
581 //------------------------------------------------------------------------- |
|
582 // Expected Sequence 1.9 See ETSI TS 102 384 in subclause 27.22.4.1.1.4.2, Expected Sequence 1.9. |
|
583 // (DISPLAY TEXT, icon and text to be displayed, no text string given, not understood by ME) |
|
584 //------------------------------------------------------------------------- |
|
585 |
|
586 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
587 |
|
588 RSat::TDisplayTextV2 dspTxtData; |
|
589 ResetDisplayTextData(dspTxtData); |
|
590 RSat::TDisplayTextV2Pckg dspTxtDataPckg(dspTxtData); |
|
591 TRequestStatus requestStatus; |
|
592 ResetDisplayTextData(dspTxtData); |
|
593 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
594 |
|
595 TTlv dspTxtTlv; |
|
596 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
597 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
598 |
|
599 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
600 |
|
601 dspTxtTlv.AddTag(KTlvIconIdentifierTag); |
|
602 dspTxtTlv.AddByte(RSat::ESelfExplanatory); //ETLV_IconQualifier |
|
603 dspTxtTlv.AddByte(1); //ETLV_IconIdentifier |
|
604 |
|
605 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
606 |
|
607 // terminal response data |
|
608 PrepareTerminalResponseMockDataL(pcmdNumber, KDisplayText, dispTextMask, KNullDesC, RSat::KCmdDataNotUnderstood, KNullDesC8); |
|
609 |
|
610 User::WaitForRequest(requestStatus); //for the NotifyDisplayTextPCmd complete |
|
611 ASSERT_EQUALS(KErrCorrupt, requestStatus.Int()); |
|
612 AssertMockLtsyStatusL(); |
|
613 |
|
614 //------------------------------------------------------------------------- |
|
615 // Expected Sequence 2.1 See ETSI TS 102 384 in subclause 27.22.4.1.2.4.2, Expected Sequence 2.1. |
|
616 // (DISPLAY TEXT, no response from user) |
|
617 //------------------------------------------------------------------------- |
|
618 |
|
619 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
620 _LIT8(KTextToDisplayTimeout, "<TIME-OUT>"); |
|
621 |
|
622 resp.iGeneralResult = RSat::KNoResponseFromUser; |
|
623 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
624 resp.iAdditionalInfo.Zero(); |
|
625 resp.SetPCmdNumber(pcmdNumber); |
|
626 |
|
627 TestNotifyDisplayTextSuccessfulL(dispTextMask, KTextToDisplayTimeout, resp); |
|
628 |
|
629 //------------------------------------------------------------------------- |
|
630 // (DISPLAY TEXT, icon and text to be displayed, no text string tag given, required values missing ) |
|
631 //------------------------------------------------------------------------- |
|
632 |
|
633 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
634 ResetDisplayTextData(dspTxtData); |
|
635 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
636 |
|
637 // prepare data without text string tag |
|
638 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
639 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
640 |
|
641 dspTxtTlv.AddTag(KTlvIconIdentifierTag); |
|
642 dspTxtTlv.AddByte(RSat::ESelfExplanatory); //ETLV_IconQualifier |
|
643 dspTxtTlv.AddByte(1); //ETLV_IconIdentifier |
|
644 |
|
645 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
646 |
|
647 // terminal response data |
|
648 PrepareTerminalResponseMockDataL(pcmdNumber, KDisplayText, dispTextMask, KNullDesC, RSat::KErrorRequiredValuesMissing, KNullDesC8); |
|
649 |
|
650 User::WaitForRequest(requestStatus); //for the NotifyDisplayTextPCmd complete |
|
651 ASSERT_EQUALS(KErrCorrupt, requestStatus.Int()); |
|
652 |
|
653 AssertMockLtsyStatusL(); |
|
654 |
|
655 //------------------------------------------------------------------------- |
|
656 // (DISPLAY TEXT, command beyond me capabilities) |
|
657 //------------------------------------------------------------------------- |
|
658 |
|
659 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
660 ResetDisplayTextData(dspTxtData); |
|
661 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
662 |
|
663 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
664 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
665 |
|
666 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
667 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
668 _LIT8(KTextToDisplayBeyondCaps, "<BEYOND-CAPS>"); |
|
669 dspTxtTlv.AddData(KTextToDisplayBeyondCaps); |
|
670 |
|
671 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
672 |
|
673 |
|
674 User::WaitForRequest(requestStatus); |
|
675 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
676 |
|
677 |
|
678 // check result |
|
679 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplayBeyondCaps, dspTxtData.iText)); |
|
680 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
681 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
682 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
683 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
684 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
685 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
686 |
|
687 |
|
688 //generate the terminal response |
|
689 resp.iGeneralResult = RSat::KCmdBeyondMeCapabilities; |
|
690 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
691 resp.iAdditionalInfo.Zero(); |
|
692 resp.SetPCmdNumber(pcmdNumber); |
|
693 |
|
694 GenerateTerminalResponseL(dispTextMask, resp); |
|
695 AssertMockLtsyStatusL(); |
|
696 |
|
697 //------------------------------------------------------------------------- |
|
698 // Expected Sequence 5.1B See ETSI TS 102 384 in subclause 27.22.4.1.5.4.2, Expected Sequence 5.1B. |
|
699 // (DISPLAY TEXT, display of basic icon, self-explanatory, requested icon could not be displayed) |
|
700 //------------------------------------------------------------------------- |
|
701 |
|
702 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
703 ResetDisplayTextData(dspTxtData); |
|
704 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
705 |
|
706 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
707 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
708 |
|
709 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
710 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
711 _LIT8(KTextToDisplay51, "Basic Icon"); |
|
712 dspTxtTlv.AddData(KTextToDisplay51); |
|
713 |
|
714 dspTxtTlv.AddTag(KTlvIconIdentifierTag); |
|
715 TUint8 iconQualifier = 0; // self explanatory |
|
716 dspTxtTlv.AddByte(iconQualifier); //ETLV_IconQualifier |
|
717 TUint8 iconId = 1; // record 1 in EFIMG |
|
718 dspTxtTlv.AddByte(iconId); //ETLV_IconIdentifier |
|
719 |
|
720 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
721 |
|
722 |
|
723 User::WaitForRequest(requestStatus); |
|
724 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
725 |
|
726 |
|
727 // check result |
|
728 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay51, dspTxtData.iText)); |
|
729 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
730 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
731 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
732 ASSERT_EQUALS(RSat::ESelfExplanatory, dspTxtData.iIconId.iQualifier); |
|
733 ASSERT_EQUALS(static_cast<TUint8>(1), dspTxtData.iIconId.iIdentifier); |
|
734 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
735 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
736 |
|
737 |
|
738 //generate the terminal response |
|
739 resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed; |
|
740 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
741 resp.iAdditionalInfo.Zero(); |
|
742 resp.SetPCmdNumber(pcmdNumber); |
|
743 |
|
744 GenerateTerminalResponseL(dispTextMask, resp); |
|
745 AssertMockLtsyStatusL(); |
|
746 |
|
747 //------------------------------------------------------------------------- |
|
748 // (DISPLAY TEXT normal priority, Unpacked 8 bit data for Text String, me problem without additional info) |
|
749 //------------------------------------------------------------------------- |
|
750 |
|
751 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
752 |
|
753 resp.iGeneralResult = RSat::KMeUnableToProcessCmd; |
|
754 resp.iInfoType = RSat::KMeProblem; |
|
755 resp.iAdditionalInfo.Zero(); |
|
756 resp.SetPCmdNumber(pcmdNumber); |
|
757 |
|
758 TestNotifyDisplayTextSuccessfulL(dispTextMask, KTextToDisplay, resp, KErrCorrupt); |
|
759 |
|
760 CleanupStack::PopAndDestroy(this); |
|
761 |
|
762 } |
|
763 |
|
764 |
|
765 /** |
|
766 @SYMTestCaseID BA-CSAT-DT-SNDTPC-0002 |
|
767 @SYMPREQ 1780 |
|
768 @SYMComponent telephony_csat |
|
769 @SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifyDisplayTextPCmd |
|
770 @SYMTestPriority High |
|
771 @SYMTestActions Invokes cancelling of RSat::NotifyDisplayTextPCmd |
|
772 @SYMTestExpectedResults Pass |
|
773 @SYMTestType CT |
|
774 */ |
|
775 void CCSatDisplayTextFU::TestNotifyDisplayTextPCmd0002L() |
|
776 { |
|
777 |
|
778 OpenEtelServerL(EUseExtendedError); |
|
779 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
780 OpenPhoneL(); |
|
781 OpenSatL(); |
|
782 |
|
783 TRequestStatus mockLtsyStatus; |
|
784 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
785 |
|
786 //------------------------------------------------------------------------- |
|
787 // Test cancelling of RSat::NotifyDisplayTextPCmd |
|
788 //------------------------------------------------------------------------- |
|
789 |
|
790 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
791 |
|
792 TTlv dspTxtTlv; |
|
793 TUint8 pcmdNumber = 1; |
|
794 TUint8 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
795 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
796 |
|
797 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
798 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
799 _LIT8(KTextToDisplay, "Toolkit Test 1"); |
|
800 dspTxtTlv.AddData(KTextToDisplay); |
|
801 |
|
802 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone, 10); |
|
803 |
|
804 RSat::TAdditionalInfo addInfo; |
|
805 addInfo.Zero(); |
|
806 addInfo.Append(RSat::KNoSpecificMeProblem); |
|
807 PrepareTerminalResponseMockDataL( |
|
808 pcmdNumber, KDisplayText, dispTextMask, |
|
809 addInfo, RSat::KMeUnableToProcessCmd); |
|
810 |
|
811 RSat::TDisplayTextV2 dspTxtData; |
|
812 ResetDisplayTextData(dspTxtData); |
|
813 RSat::TDisplayTextV2Pckg dspTxtDataPckg(dspTxtData); |
|
814 TRequestStatus requestStatus; |
|
815 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
816 |
|
817 iSat.CancelAsyncRequest(ESatNotifyDisplayTextPCmd); |
|
818 |
|
819 User::WaitForRequest(requestStatus); |
|
820 ASSERT_EQUALS(KErrCancel, requestStatus.Int()); |
|
821 |
|
822 // Wait for completion of iMockLTSY.NotifyTerminated |
|
823 User::WaitForRequest(mockLtsyStatus); |
|
824 |
|
825 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
826 |
|
827 AssertMockLtsyStatusL(); |
|
828 |
|
829 CleanupStack::PopAndDestroy(this); |
|
830 |
|
831 } |
|
832 |
|
833 |
|
834 /** |
|
835 @SYMTestCaseID BA-CSAT-DT-SNDTPC-0004 |
|
836 @SYMPREQ 1780 |
|
837 @SYMComponent telephony_csat |
|
838 @SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifyDisplayTextPCmd |
|
839 @SYMTestPriority High |
|
840 @SYMTestActions Invokes multiple client requests to RSat::NotifyDisplayTextPCmd |
|
841 @SYMTestExpectedResults Pass |
|
842 @SYMTestType CT |
|
843 */ |
|
844 void CCSatDisplayTextFU::TestNotifyDisplayTextPCmd0004L() |
|
845 { |
|
846 |
|
847 OpenEtelServerL(EUseExtendedError); |
|
848 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
849 OpenPhoneL(); |
|
850 OpenSatL(); |
|
851 |
|
852 // Open second client |
|
853 RTelServer telServer2; |
|
854 TInt ret = telServer2.Connect(); |
|
855 ASSERT_EQUALS(KErrNone, ret); |
|
856 CleanupClosePushL(telServer2); |
|
857 |
|
858 RMobilePhone phone2; |
|
859 ret = phone2.Open(telServer2, KMmTsyPhoneName); |
|
860 ASSERT_EQUALS(KErrNone, ret); |
|
861 CleanupClosePushL(phone2); |
|
862 |
|
863 RSat sat2; |
|
864 ret = sat2.Open(phone2); |
|
865 ASSERT_EQUALS(KErrNone, ret); |
|
866 CleanupClosePushL(sat2); |
|
867 |
|
868 //------------------------------------------------------------------------- |
|
869 // Test A: Test multiple clients requesting RSat::NotifyDisplayTextPCmd |
|
870 // when they both pass the same T-class version |
|
871 //------------------------------------------------------------------------- |
|
872 |
|
873 // send 1st request |
|
874 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
875 |
|
876 RSat::TDisplayTextV2 dspTxtData; |
|
877 ResetDisplayTextData(dspTxtData); |
|
878 RSat::TDisplayTextV2Pckg dspTxtDataPckg(dspTxtData); |
|
879 TRequestStatus requestStatus; |
|
880 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
881 |
|
882 // send 2nd request |
|
883 RSat::TDisplayTextV2 dspTxtData2; |
|
884 ResetDisplayTextData(dspTxtData2); |
|
885 RSat::TDisplayTextV2Pckg dspTxtDataPckg2(dspTxtData2); |
|
886 TRequestStatus requestStatus2; |
|
887 sat2.NotifyDisplayTextPCmd(requestStatus2, dspTxtDataPckg2); |
|
888 |
|
889 // generate completion |
|
890 TUint8 pcmdNumber = 1; |
|
891 |
|
892 TTlv dspTxtTlv; |
|
893 TUint8 dispTextMask = KMessageClearMask; //user must acknowledge the message. normal priority. |
|
894 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
895 |
|
896 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
897 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
898 _LIT8(KTextToDisplay, "Toolkit Test 1"); |
|
899 dspTxtTlv.AddData(KTextToDisplay); |
|
900 |
|
901 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
902 |
|
903 // completion of requests |
|
904 User::WaitForRequest(requestStatus); |
|
905 User::WaitForRequest(requestStatus2); |
|
906 |
|
907 // check results |
|
908 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
909 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
910 |
|
911 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay, dspTxtData.iText)); |
|
912 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
913 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
914 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
915 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
916 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
917 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
918 |
|
919 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay, dspTxtData2.iText)); |
|
920 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData2.iDuration.iTimeUnit); |
|
921 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData2.iPriority); |
|
922 ASSERT_EQUALS(RSat::EUserClear, dspTxtData2.iClearScreenTrigger); |
|
923 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData2.iIconId.iQualifier); |
|
924 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData2.iImmediateRsp); |
|
925 ASSERT_EQUALS(pcmdNumber, dspTxtData2.PCmdNumber()); |
|
926 |
|
927 // generate the terminal response |
|
928 RSat::TDisplayTextRspV1 resp; |
|
929 resp.iGeneralResult = RSat::KSuccess; |
|
930 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
931 resp.iAdditionalInfo.Zero(); |
|
932 resp.SetPCmdNumber(pcmdNumber); |
|
933 GenerateTerminalResponseL(dispTextMask, resp); |
|
934 GenerateTerminalResponseL(dispTextMask, resp); |
|
935 |
|
936 AssertMockLtsyStatusL(); |
|
937 |
|
938 //------------------------------------------------------------------------- |
|
939 // Test B: Test multiple clients requesting RSat::NotifyDisplayTextPCmd |
|
940 // when they both pass different T-class versions |
|
941 //------------------------------------------------------------------------- |
|
942 |
|
943 // When multiple clients requesting RSat::NotifyDisplayTextPCmd and they both pass |
|
944 // different packaged parameter versions only the last request completes, because |
|
945 // etel reposts request with new parameter size and looses previous requests. |
|
946 // May be it would be worth to make ESatNotifyDisplayTextPCmd ipc requests flow controlled |
|
947 // by CSATTSY instead of multiple completed by ETEL. |
|
948 ERR_PRINTF2(_L("<font color=Orange>$CSATKnownFailure: defect id = %d</font>"), 58); |
|
949 // Following assert was added to prevent test execution hang |
|
950 ASSERT_TRUE( EFalse ); |
|
951 |
|
952 // send 1st request |
|
953 PrepareMockWithExpDataForPCmdNotifyL(KDisplayText); |
|
954 ResetDisplayTextData(dspTxtData); |
|
955 iSat.NotifyDisplayTextPCmd(requestStatus, dspTxtDataPckg); |
|
956 |
|
957 // send 2nd request |
|
958 RSat::TDisplayTextV5 dspTxtDataV5; |
|
959 ResetDisplayTextData(dspTxtDataV5); |
|
960 RSat::TDisplayTextV5Pckg dspTxtDataV5Pckg(dspTxtDataV5); |
|
961 sat2.NotifyDisplayTextPCmd(requestStatus2, dspTxtDataV5Pckg); |
|
962 |
|
963 // generate completion |
|
964 DisplayTextPCmdTlvBegin( dspTxtTlv, pcmdNumber, dispTextMask ); |
|
965 dspTxtTlv.AddTag(KTlvTextStringTag); |
|
966 dspTxtTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme |
|
967 dspTxtTlv.AddData(KTextToDisplay); |
|
968 PrepareMockWithCompleteDataForPCmdNotifyL(dspTxtTlv.End(), KErrNone); |
|
969 |
|
970 // completion of requests |
|
971 User::WaitForRequest(requestStatus2); |
|
972 User::WaitForRequest(requestStatus); |
|
973 |
|
974 // check results |
|
975 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
976 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
977 |
|
978 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay, dspTxtData.iText)); |
|
979 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtData.iDuration.iTimeUnit); |
|
980 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtData.iPriority); |
|
981 ASSERT_EQUALS(RSat::EUserClear, dspTxtData.iClearScreenTrigger); |
|
982 ASSERT_EQUALS(RSat::ENoIconId, dspTxtData.iIconId.iQualifier); |
|
983 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtData.iImmediateRsp); |
|
984 ASSERT_EQUALS(pcmdNumber, dspTxtData.PCmdNumber()); |
|
985 |
|
986 ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KTextToDisplay, dspTxtDataV5.iText)); |
|
987 ASSERT_EQUALS(RSat::ENoDurationAvailable, dspTxtDataV5.iDuration.iTimeUnit); |
|
988 ASSERT_EQUALS(RSat::ENormalPriority, dspTxtDataV5.iPriority); |
|
989 ASSERT_EQUALS(RSat::EUserClear, dspTxtDataV5.iClearScreenTrigger); |
|
990 ASSERT_EQUALS(RSat::ENoIconId, dspTxtDataV5.iIconId.iQualifier); |
|
991 ASSERT_EQUALS(RSat::ENoImmediateRsp, dspTxtDataV5.iImmediateRsp); |
|
992 ASSERT_TRUE(RSat::ETextAttributeProvided != dspTxtDataV5.iTextAttribute.iStatus); |
|
993 ASSERT_EQUALS(pcmdNumber, dspTxtDataV5.PCmdNumber()); |
|
994 |
|
995 |
|
996 // generate the terminal response |
|
997 resp.iGeneralResult = RSat::KSuccess; |
|
998 resp.iInfoType = RSat::KNoAdditionalInfo; |
|
999 resp.iAdditionalInfo.Zero(); |
|
1000 resp.SetPCmdNumber(pcmdNumber); |
|
1001 GenerateTerminalResponseL(dispTextMask, resp); |
|
1002 GenerateTerminalResponseL(dispTextMask, resp); |
|
1003 |
|
1004 AssertMockLtsyStatusL(); |
|
1005 |
|
1006 CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this |
|
1007 |
|
1008 } |
|
1009 |