|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The TEFUnit test suite for PacketQoS in the Common TSY. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #include "cctsypacketqosfu.h" |
|
23 #include <ctsy/serviceapi/cmmutility.h> // TContextMisc |
|
24 #include <etel.h> |
|
25 #include <etelmm.h> |
|
26 #include <et_clsvr.h> |
|
27 #include <pcktcs.h> |
|
28 #include <etelqos.h> |
|
29 #include <ctsy/mmtsy_names.h> |
|
30 #include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
|
31 #include "tmockltsydata.h" |
|
32 #include <ctsy/serviceapi/gsmerror.h> |
|
33 #include "Cmmpacketdef.h" |
|
34 |
|
35 CTestSuite* CCTsyPacketQoSFU::CreateSuiteL(const TDesC& aName) |
|
36 { |
|
37 SUB_SUITE; |
|
38 |
|
39 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddMediaAuthorizationL0001L); |
|
40 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddMediaAuthorizationL0002L); |
|
41 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddMediaAuthorizationL0004L); |
|
42 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddMediaAuthorizationL0005L); |
|
43 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestRemoveMediaAuthorization0001L); |
|
44 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestRemoveMediaAuthorization0003L); |
|
45 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestRemoveMediaAuthorization0004L); |
|
46 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetProfileParameters0001L); |
|
47 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetProfileParameters0003L); |
|
48 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetProfileParameters0004L); |
|
49 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestNotifyProfileChanged0001L); |
|
50 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestNotifyProfileChanged0002L); |
|
51 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestNotifyProfileChanged0003L); |
|
52 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestNotifyProfileChanged0004L); |
|
53 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestSetProfileParameters0001L); |
|
54 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestSetProfileParameters0002L); |
|
55 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestSetProfileParameters0003L); |
|
56 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestSetProfileParameters0004L); |
|
57 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestSetProfileParameters0005L); |
|
58 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetProfileCapabilities0001L); |
|
59 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetProfileCapabilities0003L); |
|
60 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetProfileCapabilities0004L); |
|
61 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestCreateNewTFT0001L); |
|
62 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddPacketFilter0001L); |
|
63 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddPacketFilter0002L); |
|
64 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddPacketFilter0003L); |
|
65 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestAddPacketFilter0004L); |
|
66 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestRemovePacketFilter0001L); |
|
67 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestRemovePacketFilter0003L); |
|
68 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetPacketFilterInfo0001L); |
|
69 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetPacketFilterInfo0003L); |
|
70 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestGetPacketFilterInfo0004L); |
|
71 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestDeleteTFT0001L); |
|
72 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestOpenNewQoS0001L); |
|
73 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestOpenNewQoS0003L); |
|
74 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestOpenExistingQoS0001L); |
|
75 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestOpenExistingQoS0003L); |
|
76 ADD_TEST_STEP_ISO_CPP(CCTsyPacketQoSFU, TestOpenExistingQoS0004L); |
|
77 |
|
78 END_SUITE; |
|
79 } |
|
80 |
|
81 |
|
82 // |
|
83 // Actual test cases |
|
84 // |
|
85 |
|
86 |
|
87 /** |
|
88 @SYMTestCaseID BA-CTSY-PKTQ-PCAMA-0001 |
|
89 @SYMComponent telephony_ctsy |
|
90 @SYMTestCaseDesc Test support in CTSY for RPacketContext::AddMediaAuthorizationL |
|
91 @SYMTestPriority High |
|
92 @SYMTestActions Invokes RPacketContext::AddMediaAuthorizationL |
|
93 @SYMTestExpectedResults Pass |
|
94 @SYMTestType CT |
|
95 */ |
|
96 void CCTsyPacketQoSFU::TestAddMediaAuthorizationL0001L() |
|
97 { |
|
98 |
|
99 OpenEtelServerL(EUseExtendedError); |
|
100 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
101 OpenPhoneL(); |
|
102 |
|
103 RBuf8 data; |
|
104 CleanupClosePushL(data); |
|
105 |
|
106 RBuf8 completeData; |
|
107 CleanupClosePushL(completeData); |
|
108 |
|
109 RPacketService packetService; |
|
110 OpenPacketServiceL(packetService); |
|
111 CleanupClosePushL(packetService); |
|
112 |
|
113 TInfoName contextName; |
|
114 RPacketContext packetContext; |
|
115 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
116 ASSERT_EQUALS(KErrNone, ret); |
|
117 CleanupClosePushL(packetContext); |
|
118 |
|
119 TInfoName contextName2; |
|
120 RPacketContext packetContext2; |
|
121 ret = packetContext2.OpenNewSecondaryContext(packetService, contextName, contextName2); |
|
122 ASSERT_EQUALS(KErrNone, ret); |
|
123 CleanupClosePushL(packetContext2); |
|
124 |
|
125 TRequestStatus requestStatus; |
|
126 TRequestStatus mockLtsyStatus; |
|
127 |
|
128 //------------------------------------------------------------------------- |
|
129 // TEST A: failure to dispatch request to LTSY |
|
130 //------------------------------------------------------------------------- |
|
131 |
|
132 RPacketContext::TContextConfigGPRS contextConfig; |
|
133 TInt configurationType = 0; |
|
134 |
|
135 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization = NULL; |
|
136 mediaAuthorization = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
137 CleanupStack::PushL(mediaAuthorization); |
|
138 |
|
139 mediaAuthorization->iAuthorizationToken = _L8("test"); |
|
140 |
|
141 RPacketContext::CTFTMediaAuthorizationV3::TFlowIdentifier flowId; |
|
142 flowId.iIPFlowNumber = 0x100; |
|
143 flowId.iMediaComponentNumber = 0x200; |
|
144 mediaAuthorization->iFlowIds.Append(flowId); |
|
145 flowId.iIPFlowNumber = 0x10; |
|
146 flowId.iMediaComponentNumber = 0x20; |
|
147 mediaAuthorization->iFlowIds.Append(flowId); |
|
148 |
|
149 TMockLtsyContextData2< TInfoName, RPacketContext::CTFTMediaAuthorizationV3* > |
|
150 expExpect(contextConfig, configurationType, contextName2, mediaAuthorization); |
|
151 |
|
152 expExpect.SerialiseL(data); |
|
153 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data, KErrNotSupported); |
|
154 |
|
155 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
156 User::WaitForRequest(requestStatus); |
|
157 AssertMockLtsyStatusL(); |
|
158 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
159 |
|
160 //------------------------------------------------------------------------- |
|
161 // TEST for increasing the coverage |
|
162 //------------------------------------------------------------------------- |
|
163 |
|
164 for (TInt index = 0; index < 3; index++) |
|
165 { |
|
166 RPacketContext::CTFTMediaAuthorizationV3* media= NULL; |
|
167 media = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
168 CleanupStack::PushL(media); |
|
169 |
|
170 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3* > |
|
171 exp(contextConfig, configurationType, contextName2, mediaAuthorization); |
|
172 |
|
173 data.Close(); |
|
174 exp.SerialiseL(data); |
|
175 |
|
176 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data, KErrNotSupported); |
|
177 |
|
178 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
179 User::WaitForRequest(requestStatus); |
|
180 AssertMockLtsyStatusL(); |
|
181 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
182 CleanupStack::Pop(media); |
|
183 } |
|
184 |
|
185 //------------------------------------------------------------------------- |
|
186 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
187 //------------------------------------------------------------------------- |
|
188 TMockLtsyData1<TInfoName > contexName(contextName2); |
|
189 contexName.SerialiseL(completeData); |
|
190 |
|
191 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
192 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrGeneral, completeData); |
|
193 |
|
194 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
195 User::WaitForRequest(requestStatus); |
|
196 AssertMockLtsyStatusL(); |
|
197 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
198 |
|
199 //------------------------------------------------------------------------- |
|
200 // TEST C: Successful completion request of |
|
201 // RPacketContext::AddMediaAuthorizationL when result is not cached. |
|
202 //------------------------------------------------------------------------- |
|
203 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
204 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData); |
|
205 |
|
206 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
207 User::WaitForRequest(requestStatus); |
|
208 AssertMockLtsyStatusL(); |
|
209 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
210 |
|
211 AssertMockLtsyStatusL(); |
|
212 |
|
213 //------------------------------------------------------------------------- |
|
214 // TEST for coverage increasing |
|
215 // with context status != Unknown |
|
216 //------------------------------------------------------------------------- |
|
217 |
|
218 // set context status to EStatusActive |
|
219 TInt err = SetContextActiveL(contextName2); |
|
220 AssertMockLtsyStatusL(); |
|
221 |
|
222 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
223 User::WaitForRequest(requestStatus); |
|
224 AssertMockLtsyStatusL(); |
|
225 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
226 |
|
227 //------------------------------------------------------------------------- |
|
228 // TEST for coverage increasing |
|
229 // with context status != Unknown |
|
230 //------------------------------------------------------------------------- |
|
231 |
|
232 // set context status to EStatusInactive |
|
233 err = SetContextStatusL(contextName2, RPacketContext::EStatusInactive ); |
|
234 |
|
235 // call AddMediaAuthorizationL itself |
|
236 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
237 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData); |
|
238 |
|
239 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
240 User::WaitForRequest(requestStatus); |
|
241 AssertMockLtsyStatusL(); |
|
242 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
243 |
|
244 CleanupStack::Pop(mediaAuthorization); |
|
245 CleanupStack::PopAndDestroy(3); // packetService1, packetContext1, packetContext2 |
|
246 CleanupStack::PopAndDestroy(3); // completeData, data, this, dataSerialise |
|
247 |
|
248 } |
|
249 |
|
250 |
|
251 /** |
|
252 @SYMTestCaseID BA-CTSY-PKTQ-PCAMA-0002 |
|
253 @SYMComponent telephony_ctsy |
|
254 @SYMTestCaseDesc Test support in CTSY for cancelling of RPacketContext::AddMediaAuthorizationL |
|
255 @SYMTestPriority High |
|
256 @SYMTestActions Invokes cancelling of RPacketContext::AddMediaAuthorizationL |
|
257 @SYMTestExpectedResults Pass |
|
258 @SYMTestType CT |
|
259 */ |
|
260 void CCTsyPacketQoSFU::TestAddMediaAuthorizationL0002L() |
|
261 { |
|
262 OpenEtelServerL(EUseExtendedError); |
|
263 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
264 OpenPhoneL(); |
|
265 |
|
266 RBuf8 data; |
|
267 CleanupClosePushL(data); |
|
268 |
|
269 RBuf8 completeData; |
|
270 CleanupClosePushL(completeData); |
|
271 |
|
272 RPacketService packetService; |
|
273 OpenPacketServiceL(packetService); |
|
274 CleanupClosePushL(packetService); |
|
275 |
|
276 TInfoName contextName; |
|
277 RPacketContext packetContext; |
|
278 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
279 ASSERT_EQUALS(KErrNone, ret); |
|
280 CleanupClosePushL(packetContext); |
|
281 |
|
282 TInfoName contextName2; |
|
283 RPacketContext packetContext2; |
|
284 ret = packetContext2.OpenNewSecondaryContext(packetService, contextName, contextName2); |
|
285 ASSERT_EQUALS(KErrNone, ret); |
|
286 CleanupClosePushL(packetContext2); |
|
287 |
|
288 TRequestStatus requestStatus; |
|
289 TRequestStatus mockLtsyStatus; |
|
290 |
|
291 //------------------------------------------------------------------------- |
|
292 // Test cancelling of RPacketContext::AddMediaAuthorizationL |
|
293 //------------------------------------------------------------------------- |
|
294 RPacketContext::TContextConfigGPRS contextConfig; |
|
295 TInt configurationType = 0; |
|
296 |
|
297 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization = NULL; |
|
298 mediaAuthorization = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
299 CleanupStack::PushL(mediaAuthorization); |
|
300 |
|
301 TMockLtsyContextData2< TInfoName, RPacketContext::CTFTMediaAuthorizationV3* > |
|
302 expExpect(contextConfig, configurationType, contextName2, mediaAuthorization); |
|
303 |
|
304 expExpect.SerialiseL(data); |
|
305 |
|
306 // data CompleteL |
|
307 TMockLtsyData1<TInfoName > contexName(contextName2); |
|
308 contexName.SerialiseL(completeData); |
|
309 |
|
310 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
311 |
|
312 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
313 |
|
314 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
315 |
|
316 packetContext2.CancelAsyncRequest(EPacketAddMediaAuthorization); |
|
317 |
|
318 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData); |
|
319 |
|
320 User::WaitForRequest(requestStatus); |
|
321 AssertMockLtsyStatusL(); |
|
322 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
323 |
|
324 User::WaitForRequest(mockLtsyStatus); |
|
325 |
|
326 CleanupStack::Pop(mediaAuthorization); |
|
327 CleanupStack::PopAndDestroy(3); // packetService1, packetContext1, packetContext2 |
|
328 CleanupStack::PopAndDestroy(3); //completeData, data, this |
|
329 |
|
330 } |
|
331 |
|
332 /** |
|
333 @SYMTestCaseID BA-CTSY-PKTQ-PCAMA-0004 |
|
334 @SYMComponent telephony_ctsy |
|
335 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketContext::AddMediaAuthorizationL |
|
336 @SYMTestPriority High |
|
337 @SYMTestActions Invokes multiple client requests to RPacketContext::AddMediaAuthorizationL |
|
338 @SYMTestExpectedResults Pass |
|
339 @SYMTestType CT |
|
340 */ |
|
341 void CCTsyPacketQoSFU::TestAddMediaAuthorizationL0004L() |
|
342 { |
|
343 OpenEtelServerL(EUseExtendedError); |
|
344 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
345 OpenPhoneL(); |
|
346 |
|
347 RBuf8 data1; |
|
348 CleanupClosePushL(data1); |
|
349 |
|
350 RBuf8 data2; |
|
351 CleanupClosePushL(data2); |
|
352 RBuf8 completeData1; |
|
353 CleanupClosePushL(completeData1); |
|
354 |
|
355 RBuf8 completeData2; |
|
356 CleanupClosePushL(completeData2); |
|
357 |
|
358 // Open second client |
|
359 RTelServer telServer1; |
|
360 TInt ret = telServer1.Connect(); |
|
361 ASSERT_EQUALS(KErrNone, ret); |
|
362 CleanupClosePushL(telServer1); |
|
363 |
|
364 RTelServer telServer1S; |
|
365 ret = telServer1S.Connect(); |
|
366 ASSERT_EQUALS(KErrNone, ret); |
|
367 CleanupClosePushL(telServer1S); |
|
368 |
|
369 RTelServer telServer2S; |
|
370 ret = telServer2S.Connect(); |
|
371 ASSERT_EQUALS(KErrNone, ret); |
|
372 CleanupClosePushL(telServer2S); |
|
373 |
|
374 RMobilePhone phone2; |
|
375 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
376 ASSERT_EQUALS(KErrNone, ret); |
|
377 CleanupClosePushL(phone2); |
|
378 |
|
379 RMobilePhone phone1S; |
|
380 ret = phone1S.Open(iTelServer,KMmTsyPhoneName); |
|
381 ASSERT_EQUALS(KErrNone, ret); |
|
382 CleanupClosePushL(phone1S); |
|
383 |
|
384 RMobilePhone phone2S; |
|
385 ret = phone2S.Open(iTelServer,KMmTsyPhoneName); |
|
386 ASSERT_EQUALS(KErrNone, ret); |
|
387 CleanupClosePushL(phone2S); |
|
388 |
|
389 RPacketService packetService1; |
|
390 OpenPacketServiceL(packetService1); |
|
391 CleanupClosePushL(packetService1); |
|
392 |
|
393 RPacketService packetService2; |
|
394 ret = packetService2.Open(phone2); |
|
395 ASSERT_EQUALS(KErrNone, ret); |
|
396 CleanupClosePushL(packetService2); |
|
397 |
|
398 RPacketService packetService1S; |
|
399 ret = packetService1S.Open(phone1S); |
|
400 ASSERT_EQUALS(KErrNone, ret); |
|
401 CleanupClosePushL(packetService1S); |
|
402 |
|
403 RPacketService packetService2S; |
|
404 ret = packetService2S.Open(phone2S); |
|
405 ASSERT_EQUALS(KErrNone, ret); |
|
406 CleanupClosePushL(packetService2S); |
|
407 |
|
408 TInfoName contextName1; |
|
409 RPacketContext packetContext1; |
|
410 ret = packetContext1.OpenNewContext(packetService1, contextName1); |
|
411 ASSERT_EQUALS(KErrNone, ret); |
|
412 CleanupClosePushL(packetContext1); |
|
413 |
|
414 TInfoName contextName2; |
|
415 RPacketContext packetContext2; |
|
416 ret = packetContext2.OpenNewContext(packetService2, contextName2); |
|
417 ASSERT_EQUALS(KErrNone, ret); |
|
418 CleanupClosePushL(packetContext2); |
|
419 |
|
420 TInfoName contextName1S; |
|
421 RPacketContext packetContext1S; |
|
422 ret = packetContext1S.OpenNewSecondaryContext(packetService1S, contextName1, contextName1S); |
|
423 ASSERT_EQUALS(KErrNone, ret); |
|
424 CleanupClosePushL(packetContext1S); |
|
425 |
|
426 TInfoName contextName2S; |
|
427 RPacketContext packetContext2S; |
|
428 ret = packetContext2S.OpenNewSecondaryContext(packetService2S, contextName2, contextName2S); |
|
429 ASSERT_EQUALS(KErrNone, ret); |
|
430 CleanupClosePushL(packetContext2S); |
|
431 |
|
432 TRequestStatus requestStatus1; |
|
433 TRequestStatus requestStatus2; |
|
434 |
|
435 //------------------------------------------------------------------------- |
|
436 // Test A: Test multiple clients requesting RPacketContext::AddMediaAuthorizationL |
|
437 //------------------------------------------------------------------------- |
|
438 |
|
439 RPacketContext::TContextConfigGPRS contextConfig; |
|
440 TInt configurationType = 0; |
|
441 |
|
442 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization = NULL; |
|
443 mediaAuthorization = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
444 CleanupStack::PushL(mediaAuthorization); |
|
445 |
|
446 // first client |
|
447 TMockLtsyData1<TInfoName > contexName1(contextName1S); |
|
448 contexName1.SerialiseL(completeData1); |
|
449 |
|
450 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3* > |
|
451 expExpect1(contextConfig, configurationType, contextName1S, mediaAuthorization); |
|
452 expExpect1.SerialiseL(data1); |
|
453 |
|
454 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data1); |
|
455 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData1); |
|
456 |
|
457 packetContext1S.AddMediaAuthorizationL(requestStatus1, *mediaAuthorization); |
|
458 |
|
459 // second client |
|
460 TMockLtsyData1<TInfoName > contexName2(contextName2S); |
|
461 contexName2.SerialiseL(completeData2); |
|
462 |
|
463 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3* > |
|
464 expExpect2(contextConfig, configurationType, contextName2S, mediaAuthorization); |
|
465 expExpect2.SerialiseL(data2); |
|
466 |
|
467 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data2); |
|
468 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData2); |
|
469 |
|
470 packetContext2S.AddMediaAuthorizationL(requestStatus2, *mediaAuthorization); |
|
471 |
|
472 User::WaitForRequest(requestStatus1); |
|
473 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
474 |
|
475 User::WaitForRequest(requestStatus2); |
|
476 AssertMockLtsyStatusL(); |
|
477 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
478 |
|
479 CleanupStack::Pop(mediaAuthorization); |
|
480 CleanupStack::PopAndDestroy(14); |
|
481 CleanupStack::PopAndDestroy(5, this); // data1, data2, this, completeData1, completeData2 |
|
482 |
|
483 } |
|
484 |
|
485 |
|
486 /** |
|
487 @SYMTestCaseID BA-CTSY-PKTQ-PCAMA-0005 |
|
488 @SYMComponent telephony_ctsy |
|
489 @SYMTestCaseDesc Test support in CTSY for RPacketContext::AddMediaAuthorizationL with timeout |
|
490 @SYMTestPriority High |
|
491 @SYMTestActions Invokes RPacketContext::AddMediaAuthorizationL and tests for timeout |
|
492 @SYMTestExpectedResults Pass |
|
493 @SYMTestType CT |
|
494 */ |
|
495 void CCTsyPacketQoSFU::TestAddMediaAuthorizationL0005L() |
|
496 { |
|
497 OpenEtelServerL(EUseExtendedError); |
|
498 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
499 OpenPhoneL(); |
|
500 |
|
501 RBuf8 data; |
|
502 CleanupClosePushL(data); |
|
503 |
|
504 RPacketService packetService; |
|
505 OpenPacketServiceL(packetService); |
|
506 CleanupClosePushL(packetService); |
|
507 |
|
508 TInfoName contextName; |
|
509 RPacketContext packetContext; |
|
510 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
511 ASSERT_EQUALS(KErrNone, ret); |
|
512 CleanupClosePushL(packetContext); |
|
513 |
|
514 TInfoName contextName2; |
|
515 RPacketContext packetContext2; |
|
516 ret = packetContext2.OpenNewSecondaryContext(packetService, contextName, contextName2); |
|
517 ASSERT_EQUALS(KErrNone, ret); |
|
518 CleanupClosePushL(packetContext2); |
|
519 |
|
520 TRequestStatus requestStatus; |
|
521 |
|
522 RPacketContext::TContextConfigGPRS contextConfig; |
|
523 TInt configurationType = 0; |
|
524 |
|
525 //------------------------------------------------------------------------- |
|
526 // Test A: Test timeout of RPacketContext::AddMediaAuthorizationL |
|
527 //------------------------------------------------------------------------- |
|
528 |
|
529 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization = NULL; |
|
530 mediaAuthorization = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
531 CleanupStack::PushL(mediaAuthorization); |
|
532 |
|
533 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3*> |
|
534 expExpect(contextConfig, configurationType, contextName2, mediaAuthorization); |
|
535 |
|
536 expExpect.SerialiseL(data); |
|
537 |
|
538 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
539 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
540 |
|
541 User::WaitForRequest(requestStatus); |
|
542 AssertMockLtsyStatusL(); |
|
543 ASSERT_EQUALS(KErrTimedOut, requestStatus.Int()); |
|
544 |
|
545 CleanupStack::Pop(mediaAuthorization); |
|
546 CleanupStack::PopAndDestroy(3); // packetService1, packetContext1, packetContext2 |
|
547 CleanupStack::PopAndDestroy(2); // data, this |
|
548 } |
|
549 |
|
550 |
|
551 /** |
|
552 @SYMTestCaseID BA-CTSY-PKTQ-PCRMA-0001 |
|
553 @SYMComponent telephony_ctsy |
|
554 @SYMTestCaseDesc Test support in CTSY for RPacketContext::RemoveMediaAuthorization |
|
555 @SYMTestPriority High |
|
556 @SYMTestActions Invokes RPacketContext::RemoveMediaAuthorization |
|
557 @SYMTestExpectedResults Pass |
|
558 @SYMTestType CT |
|
559 */ |
|
560 void CCTsyPacketQoSFU::TestRemoveMediaAuthorization0001L() |
|
561 { |
|
562 OpenEtelServerL(EUseExtendedError); |
|
563 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
564 OpenPhoneL(); |
|
565 |
|
566 RBuf8 data; |
|
567 CleanupClosePushL(data); |
|
568 |
|
569 RBuf8 completeData; |
|
570 CleanupClosePushL(completeData); |
|
571 |
|
572 RPacketService packetService; |
|
573 OpenPacketServiceL(packetService); |
|
574 CleanupClosePushL(packetService); |
|
575 |
|
576 TInfoName contextName; |
|
577 RPacketContext packetContext; |
|
578 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
579 ASSERT_EQUALS(KErrNone, ret); |
|
580 CleanupClosePushL(packetContext); |
|
581 |
|
582 TInfoName contextName2; |
|
583 RPacketContext packetContext2; |
|
584 ret = packetContext2.OpenNewSecondaryContext(packetService, contextName, contextName2); |
|
585 ASSERT_EQUALS(KErrNone, ret); |
|
586 CleanupClosePushL(packetContext2); |
|
587 |
|
588 TRequestStatus requestStatus; |
|
589 |
|
590 //------------------------------------------------------------------------- |
|
591 // TEST |
|
592 //------------------------------------------------------------------------- |
|
593 |
|
594 _LIT8(KAuthorizationToken, "AuthorizationToken"); |
|
595 |
|
596 RPacketContext::TContextConfigGPRS contextConfig; |
|
597 TInt configurationType = 0; |
|
598 |
|
599 RPacketContext::CTFTMediaAuthorizationV3* media = NULL; |
|
600 media = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
601 media->iAuthorizationToken = KAuthorizationToken; |
|
602 CleanupStack::PushL(media); |
|
603 |
|
604 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3*> |
|
605 exp(contextConfig, configurationType, contextName2, media); |
|
606 |
|
607 exp.SerialiseL(data); |
|
608 |
|
609 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data, KErrNotSupported); |
|
610 |
|
611 packetContext2.AddMediaAuthorizationL(requestStatus, *media); |
|
612 User::WaitForRequest(requestStatus); |
|
613 AssertMockLtsyStatusL(); |
|
614 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
615 |
|
616 RPacketContext::TAuthorizationToken authorization1; |
|
617 authorization1 = KAuthorizationToken; |
|
618 |
|
619 packetContext2.RemoveMediaAuthorization(requestStatus, authorization1); |
|
620 ASSERT_EQUALS(KErrNone, ret); |
|
621 User::WaitForRequest(requestStatus); |
|
622 AssertMockLtsyStatusL(); |
|
623 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
624 |
|
625 //------------------------------------------------------------------------- |
|
626 // TEST |
|
627 //------------------------------------------------------------------------- |
|
628 |
|
629 RPacketContext::TAuthorizationToken authorizationToken; |
|
630 authorizationToken = KAuthorizationToken; |
|
631 |
|
632 packetContext.RemoveMediaAuthorization(requestStatus, authorizationToken); |
|
633 User::WaitForRequest(requestStatus); |
|
634 AssertMockLtsyStatusL(); |
|
635 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
636 |
|
637 //------------------------------------------------------------------------- |
|
638 // TEST |
|
639 //------------------------------------------------------------------------- |
|
640 |
|
641 // add new MediaAuthorization |
|
642 //------------------------------------------------------------------------- |
|
643 |
|
644 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization= NULL; |
|
645 mediaAuthorization = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
646 mediaAuthorization->iAuthorizationToken = KAuthorizationToken; |
|
647 CleanupStack::PushL(mediaAuthorization); |
|
648 |
|
649 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3*> |
|
650 expExpect(contextConfig, configurationType, contextName2, mediaAuthorization); |
|
651 data.Close(); |
|
652 expExpect.SerialiseL(data); |
|
653 |
|
654 TMockLtsyData1<TInfoName > contexName(contextName2); |
|
655 contexName.SerialiseL(completeData); |
|
656 |
|
657 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
658 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData); |
|
659 |
|
660 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
661 User::WaitForRequest(requestStatus); |
|
662 AssertMockLtsyStatusL(); |
|
663 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
664 //------------------------------------------------------------------------- |
|
665 |
|
666 packetContext2.RemoveMediaAuthorization(requestStatus, authorizationToken); |
|
667 User::WaitForRequest(requestStatus); |
|
668 AssertMockLtsyStatusL(); |
|
669 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
670 |
|
671 //------------------------------------------------------------------------- |
|
672 // TEST C: Successful completion request of |
|
673 // RPacketContext::RemoveMediaAuthorization when result is not cached. |
|
674 //------------------------------------------------------------------------- |
|
675 packetContext2.RemoveMediaAuthorization(requestStatus, authorizationToken); |
|
676 User::WaitForRequest(requestStatus); |
|
677 AssertMockLtsyStatusL(); |
|
678 ASSERT_EQUALS(KErrNotFound, requestStatus.Int()); |
|
679 |
|
680 CleanupStack::Pop(mediaAuthorization); |
|
681 CleanupStack::Pop(media); |
|
682 AssertMockLtsyStatusL(); |
|
683 CleanupStack::PopAndDestroy(6, this); // data, this, completeData |
|
684 } |
|
685 |
|
686 |
|
687 /** |
|
688 @SYMTestCaseID BA-CTSY-PKTQ-PCRMA-0003 |
|
689 @SYMComponent telephony_ctsy |
|
690 @SYMTestCaseDesc Test support in CTSY for RPacketContext::RemoveMediaAuthorization with bad parameter data |
|
691 @SYMTestPriority High |
|
692 @SYMTestActions Invokes RPacketContext::RemoveMediaAuthorization with bad parameter data |
|
693 @SYMTestExpectedResults Pass |
|
694 @SYMTestType CT |
|
695 */ |
|
696 void CCTsyPacketQoSFU::TestRemoveMediaAuthorization0003L() |
|
697 { |
|
698 OpenEtelServerL(EUseExtendedError); |
|
699 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
700 OpenPhoneL(); |
|
701 |
|
702 RBuf8 data; |
|
703 CleanupClosePushL(data); |
|
704 |
|
705 RBuf8 completeData; |
|
706 CleanupClosePushL(completeData); |
|
707 |
|
708 RPacketService packetService; |
|
709 OpenPacketServiceL(packetService); |
|
710 CleanupClosePushL(packetService); |
|
711 |
|
712 TInfoName contextName; |
|
713 RPacketContext packetContext; |
|
714 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
715 ASSERT_EQUALS(KErrNone, ret); |
|
716 CleanupClosePushL(packetContext); |
|
717 |
|
718 TInfoName contextName2; |
|
719 RPacketContext packetContext2; |
|
720 ret = packetContext2.OpenNewSecondaryContext(packetService, contextName, contextName2); |
|
721 ASSERT_EQUALS(KErrNone, ret); |
|
722 CleanupClosePushL(packetContext2); |
|
723 |
|
724 TRequestStatus requestStatus; |
|
725 |
|
726 //------------------------------------------------------------------------- |
|
727 // Test add new MediaAuthorization |
|
728 //------------------------------------------------------------------------- |
|
729 _LIT8(KAuthorizationToken, "AuthorizationToken"); |
|
730 _LIT8(KAuthorizationToken2, "Other AuthorizationToken"); |
|
731 |
|
732 RPacketContext::TContextConfigGPRS contextConfig; |
|
733 TInt configurationType = 0; |
|
734 |
|
735 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization= NULL; |
|
736 mediaAuthorization = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
737 mediaAuthorization->iAuthorizationToken = KAuthorizationToken; |
|
738 CleanupStack::PushL(mediaAuthorization); |
|
739 |
|
740 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3*> |
|
741 expExpect(contextConfig, configurationType, contextName2, mediaAuthorization); |
|
742 |
|
743 TMockLtsyData1<TInfoName > contexName(contextName2); |
|
744 contexName.SerialiseL(completeData); |
|
745 |
|
746 expExpect.SerialiseL(data); |
|
747 |
|
748 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data); |
|
749 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData); |
|
750 |
|
751 packetContext2.AddMediaAuthorizationL(requestStatus, *mediaAuthorization); |
|
752 User::WaitForRequest(requestStatus); |
|
753 AssertMockLtsyStatusL(); |
|
754 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
755 //------------------------------------------------------------------------- |
|
756 |
|
757 RPacketContext::TAuthorizationToken authorizationToken; |
|
758 authorizationToken = KAuthorizationToken2; |
|
759 |
|
760 packetContext2.RemoveMediaAuthorization(requestStatus, authorizationToken); |
|
761 User::WaitForRequest(requestStatus); |
|
762 AssertMockLtsyStatusL(); |
|
763 ASSERT_EQUALS(KErrNotFound, requestStatus.Int()); |
|
764 |
|
765 CleanupStack::Pop(mediaAuthorization); |
|
766 CleanupStack::PopAndDestroy(6, this); // data, completeData, packetService, packetContext, packetContext2, this |
|
767 |
|
768 } |
|
769 |
|
770 |
|
771 /** |
|
772 @SYMTestCaseID BA-CTSY-PKTQ-PCRMA-0004 |
|
773 @SYMComponent telephony_ctsy |
|
774 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketContext::RemoveMediaAuthorization |
|
775 @SYMTestPriority High |
|
776 @SYMTestActions Invokes multiple client requests to RPacketContext::RemoveMediaAuthorization |
|
777 @SYMTestExpectedResults Pass |
|
778 @SYMTestType CT |
|
779 */ |
|
780 void CCTsyPacketQoSFU::TestRemoveMediaAuthorization0004L() |
|
781 { |
|
782 |
|
783 OpenEtelServerL(EUseExtendedError); |
|
784 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
785 OpenPhoneL(); |
|
786 |
|
787 RBuf8 data1; |
|
788 CleanupClosePushL(data1); |
|
789 |
|
790 RBuf8 data2; |
|
791 CleanupClosePushL(data2); |
|
792 |
|
793 RBuf8 completeData1; |
|
794 CleanupClosePushL(completeData1); |
|
795 |
|
796 RBuf8 completeData2; |
|
797 CleanupClosePushL(completeData2); |
|
798 |
|
799 // Open second client |
|
800 RTelServer telServer1; |
|
801 TInt ret = telServer1.Connect(); |
|
802 ASSERT_EQUALS(KErrNone, ret); |
|
803 CleanupClosePushL(telServer1); |
|
804 |
|
805 RTelServer telServer1S; |
|
806 ret = telServer1S.Connect(); |
|
807 ASSERT_EQUALS(KErrNone, ret); |
|
808 CleanupClosePushL(telServer1S); |
|
809 |
|
810 RTelServer telServer2S; |
|
811 ret = telServer2S.Connect(); |
|
812 ASSERT_EQUALS(KErrNone, ret); |
|
813 CleanupClosePushL(telServer2S); |
|
814 |
|
815 RMobilePhone phone2; |
|
816 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
817 ASSERT_EQUALS(KErrNone, ret); |
|
818 CleanupClosePushL(phone2); |
|
819 |
|
820 RMobilePhone phone1S; |
|
821 ret = phone1S.Open(iTelServer,KMmTsyPhoneName); |
|
822 ASSERT_EQUALS(KErrNone, ret); |
|
823 CleanupClosePushL(phone1S); |
|
824 |
|
825 RMobilePhone phone2S; |
|
826 ret = phone2S.Open(iTelServer,KMmTsyPhoneName); |
|
827 ASSERT_EQUALS(KErrNone, ret); |
|
828 CleanupClosePushL(phone2S); |
|
829 |
|
830 RPacketService packetService1; |
|
831 OpenPacketServiceL(packetService1); |
|
832 CleanupClosePushL(packetService1); |
|
833 |
|
834 RPacketService packetService2; |
|
835 ret = packetService2.Open(phone2); |
|
836 ASSERT_EQUALS(KErrNone, ret); |
|
837 CleanupClosePushL(packetService2); |
|
838 |
|
839 RPacketService packetService1S; |
|
840 ret = packetService1S.Open(phone1S); |
|
841 ASSERT_EQUALS(KErrNone, ret); |
|
842 CleanupClosePushL(packetService1S); |
|
843 |
|
844 RPacketService packetService2S; |
|
845 ret = packetService2S.Open(phone2S); |
|
846 ASSERT_EQUALS(KErrNone, ret); |
|
847 CleanupClosePushL(packetService2S); |
|
848 |
|
849 TInfoName contextName1; |
|
850 RPacketContext packetContext1; |
|
851 ret = packetContext1.OpenNewContext(packetService1, contextName1); |
|
852 ASSERT_EQUALS(KErrNone, ret); |
|
853 CleanupClosePushL(packetContext1); |
|
854 |
|
855 TInfoName contextName2; |
|
856 RPacketContext packetContext2; |
|
857 ret = packetContext2.OpenNewContext(packetService2, contextName2); |
|
858 ASSERT_EQUALS(KErrNone, ret); |
|
859 CleanupClosePushL(packetContext2); |
|
860 |
|
861 TInfoName contextName1S; |
|
862 RPacketContext packetContext1S; |
|
863 ret = packetContext1S.OpenNewSecondaryContext(packetService1S, contextName1, contextName1S); |
|
864 ASSERT_EQUALS(KErrNone, ret); |
|
865 CleanupClosePushL(packetContext1S); |
|
866 |
|
867 TInfoName contextName2S; |
|
868 RPacketContext packetContext2S; |
|
869 ret = packetContext2S.OpenNewSecondaryContext(packetService2S, contextName2, contextName2S); |
|
870 ASSERT_EQUALS(KErrNone, ret); |
|
871 CleanupClosePushL(packetContext2S); |
|
872 |
|
873 TRequestStatus requestStatus; |
|
874 |
|
875 //------------------------------------------------------------------------- |
|
876 // Test A: Test multiple clients requesting RPacketContext::RemoveMediaAuthorization |
|
877 //------------------------------------------------------------------------- |
|
878 |
|
879 _LIT8(KAuthorizationToken1, "AuthorizationToken1"); |
|
880 _LIT8(KAuthorizationToken2, "AuthorizationToken2"); |
|
881 |
|
882 // add new MediaAuthorization |
|
883 //------------------------------------------------------------------------- |
|
884 RPacketContext::TContextConfigGPRS contextConfig; |
|
885 TInt configurationType = 0; |
|
886 |
|
887 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization1 = NULL; |
|
888 mediaAuthorization1 = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
889 mediaAuthorization1->iAuthorizationToken = KAuthorizationToken1; |
|
890 CleanupStack::PushL(mediaAuthorization1); |
|
891 |
|
892 TMockLtsyData1<TInfoName > contexName1(contextName1S); |
|
893 contexName1.SerialiseL(completeData1); |
|
894 |
|
895 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3*> |
|
896 expExpect1(contextConfig, configurationType, contextName1S, mediaAuthorization1); |
|
897 expExpect1.SerialiseL(data1); |
|
898 |
|
899 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data1); |
|
900 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData1); |
|
901 |
|
902 packetContext1S.AddMediaAuthorizationL(requestStatus, *mediaAuthorization1); |
|
903 User::WaitForRequest(requestStatus); |
|
904 AssertMockLtsyStatusL(); |
|
905 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
906 //------------------------------------------------------------------------- |
|
907 |
|
908 TRequestStatus requestStatus1; |
|
909 TRequestStatus requestStatus2; |
|
910 |
|
911 RPacketContext::TAuthorizationToken authorizationToken; |
|
912 authorizationToken = KAuthorizationToken1; |
|
913 |
|
914 packetContext1S.RemoveMediaAuthorization(requestStatus1, authorizationToken); |
|
915 |
|
916 // add new MediaAuthorization |
|
917 //------------------------------------------------------------------------- |
|
918 RPacketContext::CTFTMediaAuthorizationV3* mediaAuthorization2 = NULL; |
|
919 mediaAuthorization2 = RPacketContext::CTFTMediaAuthorizationV3::NewL(); |
|
920 mediaAuthorization2->iAuthorizationToken = KAuthorizationToken2; |
|
921 CleanupStack::PushL(mediaAuthorization2); |
|
922 |
|
923 TMockLtsyData1<TInfoName > contexName2(contextName2S); |
|
924 contexName2.SerialiseL(completeData2); |
|
925 |
|
926 TMockLtsyContextData2<TInfoName, RPacketContext::CTFTMediaAuthorizationV3*> |
|
927 expExpect2(contextConfig, configurationType, contextName2S, mediaAuthorization2); |
|
928 expExpect2.SerialiseL(data2); |
|
929 |
|
930 iMockLTSY.ExpectL(EPacketAddMediaAuthorization, data2); |
|
931 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, completeData2); |
|
932 |
|
933 packetContext2S.AddMediaAuthorizationL(requestStatus, *mediaAuthorization2); |
|
934 User::WaitForRequest(requestStatus); |
|
935 AssertMockLtsyStatusL(); |
|
936 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
937 //------------------------------------------------------------------------- |
|
938 |
|
939 authorizationToken = KAuthorizationToken2; |
|
940 |
|
941 packetContext2S.RemoveMediaAuthorization(requestStatus2, authorizationToken); |
|
942 |
|
943 User::WaitForRequest(requestStatus1); |
|
944 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
945 |
|
946 User::WaitForRequest(requestStatus2); |
|
947 AssertMockLtsyStatusL(); |
|
948 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
949 |
|
950 CleanupStack::Pop(mediaAuthorization2); |
|
951 CleanupStack::Pop(mediaAuthorization1); |
|
952 CleanupStack::PopAndDestroy(14); |
|
953 CleanupStack::PopAndDestroy(5, this); // data1, data2, this, completeData1, completeData2 |
|
954 |
|
955 } |
|
956 |
|
957 |
|
958 /** |
|
959 @SYMTestCaseID BA-CTSY-PKTQ-QGPP-0001 |
|
960 @SYMComponent telephony_ctsy |
|
961 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::GetProfileParameters |
|
962 @SYMTestPriority High |
|
963 @SYMTestActions Invokes RPacketQoS::GetProfileParameters |
|
964 @SYMTestExpectedResults Pass |
|
965 @SYMTestType CT |
|
966 */ |
|
967 void CCTsyPacketQoSFU::TestGetProfileParameters0001L() |
|
968 { |
|
969 |
|
970 OpenEtelServerL(EUseExtendedError); |
|
971 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
972 OpenPhoneL(); |
|
973 |
|
974 RBuf8 data; |
|
975 CleanupClosePushL(data); |
|
976 |
|
977 TName profileName; |
|
978 |
|
979 RBuf8 expectData; |
|
980 CleanupClosePushL(expectData); |
|
981 |
|
982 RPacketService packetService; |
|
983 OpenPacketServiceL(packetService); |
|
984 CleanupClosePushL(packetService); |
|
985 |
|
986 // Open new context |
|
987 TInfoName contextName; |
|
988 RPacketContext packetContext; |
|
989 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
990 ASSERT_EQUALS(KErrNone, ret); |
|
991 CleanupClosePushL(packetContext); |
|
992 |
|
993 RPacketQoS packetQoS; |
|
994 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
995 ASSERT_EQUALS(KErrNone, ret); |
|
996 CleanupClosePushL(packetQoS); |
|
997 |
|
998 TRequestStatus requestStatus; |
|
999 |
|
1000 RPacketQoS::TQoSGPRSNegotiated packetGPRS; |
|
1001 TPckg< RPacketQoS::TQoSGPRSNegotiated > profilePckgGPRS = packetGPRS; |
|
1002 packetQoS.GetProfileParameters(requestStatus, profilePckgGPRS); |
|
1003 User::WaitForRequest(requestStatus); |
|
1004 AssertMockLtsyStatusL(); |
|
1005 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1006 |
|
1007 ASSERT_EQUALS(packetGPRS.iPrecedence , RPacketQoS::EUnspecifiedPrecedence); |
|
1008 ASSERT_EQUALS(packetGPRS.iDelay , RPacketQoS::EUnspecifiedDelayClass); |
|
1009 ASSERT_EQUALS(packetGPRS.iReliability , RPacketQoS::EUnspecifiedReliabilityClass); |
|
1010 ASSERT_EQUALS(packetGPRS.iPeakThroughput, RPacketQoS::EUnspecifiedPeakThroughput); |
|
1011 ASSERT_EQUALS(packetGPRS.iMeanThroughput, RPacketQoS::EUnspecifiedMeanThroughput); |
|
1012 |
|
1013 RPacketQoS::TQoSR5Negotiated packetR5; |
|
1014 TPckg< RPacketQoS::TQoSR5Negotiated > profilePckgR5 = packetR5; |
|
1015 packetQoS.GetProfileParameters(requestStatus, profilePckgR5); |
|
1016 User::WaitForRequest(requestStatus); |
|
1017 AssertMockLtsyStatusL(); |
|
1018 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1019 |
|
1020 ASSERT_EQUALS(packetR5.iSignallingIndication , 0); |
|
1021 ASSERT_EQUALS(packetR5.iSourceStatisticsDescriptor, |
|
1022 RPacketQoS::ESourceStatisticsDescriptorUnknown); |
|
1023 ASSERT_EQUALS(packetR5.iTrafficClass , |
|
1024 RPacketQoS::ETrafficClassUnspecified); |
|
1025 ASSERT_EQUALS(packetR5.iDeliveryOrderReqd , |
|
1026 RPacketQoS::EDeliveryOrderUnspecified); |
|
1027 ASSERT_EQUALS(packetR5.iDeliverErroneousSDU , |
|
1028 RPacketQoS::EErroneousSDUDeliveryUnspecified); |
|
1029 ASSERT_EQUALS(packetR5.iMaxSDUSize , 0); |
|
1030 ASSERT_EQUALS(packetR5.iMaxRate.iUplinkRate , 0); |
|
1031 ASSERT_EQUALS(packetR5.iMaxRate.iDownlinkRate , 0); |
|
1032 ASSERT_EQUALS(packetR5.iBER , |
|
1033 RPacketQoS::EBERUnspecified); |
|
1034 ASSERT_EQUALS(packetR5.iSDUErrorRatio , |
|
1035 RPacketQoS::ESDUErrorRatioUnspecified); |
|
1036 ASSERT_EQUALS(packetR5.iTrafficHandlingPriority , |
|
1037 RPacketQoS::ETrafficPriorityUnspecified); |
|
1038 ASSERT_EQUALS(packetR5.iTransferDelay , 0); |
|
1039 ASSERT_EQUALS(packetR5.iGuaranteedRate.iDownlinkRate, 0); |
|
1040 ASSERT_EQUALS(packetR5.iGuaranteedRate.iUplinkRate , 0); |
|
1041 |
|
1042 RPacketQoS::TQoSR99_R4Negotiated packetR99; |
|
1043 TPckg< RPacketQoS::TQoSR99_R4Negotiated > profilePckgR99 = packetR99; |
|
1044 packetQoS.GetProfileParameters(requestStatus, profilePckgR99); |
|
1045 User::WaitForRequest(requestStatus); |
|
1046 AssertMockLtsyStatusL(); |
|
1047 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1048 |
|
1049 ASSERT_EQUALS(packetR99.iTrafficClass , |
|
1050 RPacketQoS::ETrafficClassUnspecified); |
|
1051 ASSERT_EQUALS(packetR99.iDeliveryOrderReqd , |
|
1052 RPacketQoS::EDeliveryOrderUnspecified); |
|
1053 ASSERT_EQUALS(packetR99.iDeliverErroneousSDU , |
|
1054 RPacketQoS::EErroneousSDUDeliveryUnspecified); |
|
1055 ASSERT_EQUALS(packetR99.iMaxSDUSize , 0); |
|
1056 ASSERT_EQUALS(packetR99.iMaxRate.iUplinkRate , 0); |
|
1057 ASSERT_EQUALS(packetR99.iMaxRate.iDownlinkRate , 0); |
|
1058 ASSERT_EQUALS(packetR99.iBER , |
|
1059 RPacketQoS::EBERUnspecified); |
|
1060 ASSERT_EQUALS(packetR99.iSDUErrorRatio , |
|
1061 RPacketQoS::ESDUErrorRatioUnspecified); |
|
1062 ASSERT_EQUALS(packetR99.iTrafficHandlingPriority , |
|
1063 RPacketQoS::ETrafficPriorityUnspecified); |
|
1064 ASSERT_EQUALS(packetR99.iTransferDelay , 0); |
|
1065 ASSERT_EQUALS(packetR99.iGuaranteedRate.iDownlinkRate, 0); |
|
1066 ASSERT_EQUALS(packetR99.iGuaranteedRate.iUplinkRate , 0); |
|
1067 |
|
1068 //------------------------------------------------------------------------- |
|
1069 TPacketQoSGPRSNegotiated packetQoSGPRS; |
|
1070 TPacketQoSR99_R4Negotiated packetQoSR99_R4; |
|
1071 TPacketQoSR5Negotiated packetQoSR5; |
|
1072 |
|
1073 //------------------------------------------------------------------------- |
|
1074 // Initialization TPacketQoSGPRSNegotiated |
|
1075 packetQoSGPRS.iPrecedence = RPacketQoS::EPriorityHighPrecedence; |
|
1076 packetQoSGPRS.iDelay = RPacketQoS::EDelayClass3; |
|
1077 packetQoSGPRS.iReliability = RPacketQoS::EReliabilityClass2; |
|
1078 packetQoSGPRS.iPeakThroughput = RPacketQoS::EPeakThroughput16000; |
|
1079 packetQoSGPRS.iMeanThroughput = RPacketQoS::EMeanThroughput100000; |
|
1080 |
|
1081 //------------------------------------------------------------------------- |
|
1082 // Initialization packetQoSR99_R4 |
|
1083 packetQoSR99_R4.iTrafficClass = RPacketQoS::ETrafficClassBackground; |
|
1084 packetQoSR99_R4.iDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; |
|
1085 packetQoSR99_R4.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
1086 packetQoSR99_R4.iMaxSDUSize = 10; |
|
1087 packetQoSR99_R4.iMaxRate.iUplinkRate = 20; |
|
1088 packetQoSR99_R4.iMaxRate.iDownlinkRate = 100; |
|
1089 packetQoSR99_R4.iBER = RPacketQoS::EBERSixPerHundredMillion; |
|
1090 packetQoSR99_R4.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerMillion; |
|
1091 packetQoSR99_R4.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority3; |
|
1092 packetQoSR99_R4.iTransferDelay = 1000; |
|
1093 packetQoSR99_R4.iGuaranteedRate.iDownlinkRate = 5; |
|
1094 packetQoSR99_R4.iGuaranteedRate.iUplinkRate = 7; |
|
1095 |
|
1096 //------------------------------------------------------------------------- |
|
1097 // Initialization packetQoSR5 |
|
1098 packetQoSR5.iSignallingIndication = ETrue; |
|
1099 packetQoSR5.iSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorSpeech; |
|
1100 packetQoSR5.iTrafficClass = RPacketQoS::ETrafficClassBackground; |
|
1101 packetQoSR5.iDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; |
|
1102 packetQoSR5.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; |
|
1103 packetQoSR5.iMaxSDUSize = 12; |
|
1104 packetQoSR5.iMaxRate.iUplinkRate = 22; |
|
1105 packetQoSR5.iMaxRate.iDownlinkRate = 102; |
|
1106 packetQoSR5.iBER = RPacketQoS::EBERSixPerHundredMillion; |
|
1107 packetQoSR5.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerMillion; |
|
1108 packetQoSR5.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority3; |
|
1109 packetQoSR5.iTransferDelay = 1002; |
|
1110 packetQoSR5.iGuaranteedRate.iDownlinkRate = 7; |
|
1111 packetQoSR5.iGuaranteedRate.iUplinkRate = 9; |
|
1112 |
|
1113 TMockLtsyPacketQoSData1< TInfoName > mockData(packetQoSGPRS, packetQoSR99_R4, |
|
1114 packetQoSR5 , contextName); |
|
1115 mockData.SerialiseL(data); |
|
1116 |
|
1117 TRequestStatus mockLtsyStatus; |
|
1118 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1119 iMockLTSY.CompleteL(EPacketQoSNotifyProfileChanged, KErrNone, data); |
|
1120 User::WaitForRequest(mockLtsyStatus); |
|
1121 |
|
1122 //------------------------------------------------------------------------- |
|
1123 // TEST RPacketQoS::GetProfileParameters again, this time CTSY |
|
1124 // will get result from the cache for RPacketQoS::TQoSGPRSNegotiated. |
|
1125 //------------------------------------------------------------------------- |
|
1126 |
|
1127 packetQoS.GetProfileParameters(requestStatus, profilePckgGPRS); |
|
1128 User::WaitForRequest(requestStatus); |
|
1129 AssertMockLtsyStatusL(); |
|
1130 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1131 |
|
1132 ASSERT_EQUALS(packetQoSGPRS.iPrecedence , packetGPRS.iPrecedence ); |
|
1133 ASSERT_EQUALS(packetQoSGPRS.iDelay , packetGPRS.iDelay ); |
|
1134 ASSERT_EQUALS(packetQoSGPRS.iReliability , packetGPRS.iReliability ); |
|
1135 ASSERT_EQUALS(packetQoSGPRS.iPeakThroughput, packetGPRS.iPeakThroughput); |
|
1136 ASSERT_EQUALS(packetQoSGPRS.iMeanThroughput, packetGPRS.iMeanThroughput); |
|
1137 |
|
1138 //------------------------------------------------------------------------- |
|
1139 // TEST RPacketQoS::GetProfileParameters again, this time CTSY |
|
1140 // will get result from the cache for RPacketQoS::TQoSR5Negotiated. |
|
1141 //------------------------------------------------------------------------- |
|
1142 |
|
1143 packetQoS.GetProfileParameters(requestStatus, profilePckgR5); |
|
1144 User::WaitForRequest(requestStatus); |
|
1145 AssertMockLtsyStatusL(); |
|
1146 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1147 |
|
1148 ASSERT_EQUALS(packetQoSR5.iSignallingIndication , packetR5.iSignallingIndication ); |
|
1149 ASSERT_EQUALS(packetQoSR5.iSourceStatisticsDescriptor , packetR5.iSourceStatisticsDescriptor ); |
|
1150 ASSERT_EQUALS(packetQoSR5.iTrafficClass , packetR5.iTrafficClass ); |
|
1151 ASSERT_EQUALS(packetQoSR5.iDeliveryOrderReqd , packetR5.iDeliveryOrderReqd ); |
|
1152 ASSERT_EQUALS(packetQoSR5.iDeliverErroneousSDU , packetR5.iDeliverErroneousSDU ); |
|
1153 ASSERT_EQUALS(packetQoSR5.iMaxSDUSize , packetR5.iMaxSDUSize ); |
|
1154 ASSERT_EQUALS(packetQoSR5.iMaxRate.iUplinkRate , packetR5.iMaxRate.iUplinkRate ); |
|
1155 ASSERT_EQUALS(packetQoSR5.iMaxRate.iDownlinkRate , packetR5.iMaxRate.iDownlinkRate ); |
|
1156 ASSERT_EQUALS(packetQoSR5.iBER , packetR5.iBER ); |
|
1157 ASSERT_EQUALS(packetQoSR5.iSDUErrorRatio , packetR5.iSDUErrorRatio ); |
|
1158 ASSERT_EQUALS(packetQoSR5.iTrafficHandlingPriority , packetR5.iTrafficHandlingPriority ); |
|
1159 ASSERT_EQUALS(packetQoSR5.iTransferDelay , packetR5.iTransferDelay ); |
|
1160 ASSERT_EQUALS(packetQoSR5.iGuaranteedRate.iDownlinkRate, packetR5.iGuaranteedRate.iDownlinkRate); |
|
1161 ASSERT_EQUALS(packetQoSR5.iGuaranteedRate.iUplinkRate , packetR5.iGuaranteedRate.iUplinkRate ); |
|
1162 |
|
1163 //------------------------------------------------------------------------- |
|
1164 // TEST RPacketQoS::GetProfileParameters again, this time CTSY |
|
1165 // will get result from the cache for RPacketQoS::TQoSR99_R4Negotiated. |
|
1166 //------------------------------------------------------------------------- |
|
1167 |
|
1168 packetQoS.GetProfileParameters(requestStatus, profilePckgR99); |
|
1169 User::WaitForRequest(requestStatus); |
|
1170 AssertMockLtsyStatusL(); |
|
1171 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1172 |
|
1173 ASSERT_EQUALS(packetQoSR99_R4.iTrafficClass , packetR99.iTrafficClass ); |
|
1174 ASSERT_EQUALS(packetQoSR99_R4.iDeliveryOrderReqd , packetR99.iDeliveryOrderReqd ); |
|
1175 ASSERT_EQUALS(packetQoSR99_R4.iDeliverErroneousSDU , packetR99.iDeliverErroneousSDU ); |
|
1176 ASSERT_EQUALS(packetQoSR99_R4.iMaxSDUSize , packetR99.iMaxSDUSize ); |
|
1177 ASSERT_EQUALS(packetQoSR99_R4.iMaxRate.iUplinkRate , packetR99.iMaxRate.iUplinkRate ); |
|
1178 ASSERT_EQUALS(packetQoSR99_R4.iMaxRate.iDownlinkRate , packetR99.iMaxRate.iDownlinkRate ); |
|
1179 ASSERT_EQUALS(packetQoSR99_R4.iBER , packetR99.iBER ); |
|
1180 ASSERT_EQUALS(packetQoSR99_R4.iSDUErrorRatio , packetR99.iSDUErrorRatio ); |
|
1181 ASSERT_EQUALS(packetQoSR99_R4.iTrafficHandlingPriority , packetR99.iTrafficHandlingPriority ); |
|
1182 ASSERT_EQUALS(packetQoSR99_R4.iTransferDelay , packetR99.iTransferDelay ); |
|
1183 ASSERT_EQUALS(packetQoSR99_R4.iGuaranteedRate.iDownlinkRate, packetR99.iGuaranteedRate.iDownlinkRate); |
|
1184 ASSERT_EQUALS(packetQoSR99_R4.iGuaranteedRate.iUplinkRate , packetR99.iGuaranteedRate.iUplinkRate ); |
|
1185 |
|
1186 CleanupStack::PopAndDestroy(3); // packetService, packetContext, packetQoS |
|
1187 CleanupStack::PopAndDestroy(3, this); // data, this, expectData |
|
1188 } |
|
1189 |
|
1190 /** |
|
1191 @SYMTestCaseID BA-CTSY-PKTQ-QGPP-0003 |
|
1192 @SYMComponent telephony_ctsy |
|
1193 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::GetProfileParameters with bad parameter data |
|
1194 @SYMTestPriority High |
|
1195 @SYMTestActions Invokes RPacketQoS::GetProfileParameters with bad parameter data |
|
1196 @SYMTestExpectedResults Pass |
|
1197 @SYMTestType CT |
|
1198 */ |
|
1199 void CCTsyPacketQoSFU::TestGetProfileParameters0003L() |
|
1200 { |
|
1201 OpenEtelServerL(EUseExtendedError); |
|
1202 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1203 OpenPhoneL(); |
|
1204 |
|
1205 RBuf8 data; |
|
1206 CleanupClosePushL(data); |
|
1207 |
|
1208 TName profileName; |
|
1209 |
|
1210 RPacketService packetService; |
|
1211 OpenPacketServiceL(packetService); |
|
1212 CleanupClosePushL(packetService); |
|
1213 |
|
1214 // Open new context |
|
1215 TInfoName contextName; |
|
1216 RPacketContext packetContext; |
|
1217 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
1218 ASSERT_EQUALS(KErrNone, ret); |
|
1219 CleanupClosePushL(packetContext); |
|
1220 |
|
1221 RPacketQoS packetQoS; |
|
1222 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1223 ASSERT_EQUALS(KErrNone, ret); |
|
1224 CleanupClosePushL(packetQoS); |
|
1225 |
|
1226 TRequestStatus requestStatus; |
|
1227 |
|
1228 //------------------------------------------------------------------------- |
|
1229 // Test A: Test passing wrong version of parameters to |
|
1230 // RPacketQoS::GetProfileParameters |
|
1231 //------------------------------------------------------------------------- |
|
1232 |
|
1233 RPacketQoS::TQoSCDMA2000Negotiated packetCDMA2000; |
|
1234 TPckg< RPacketQoS::TQoSCDMA2000Negotiated > profilePckgCDMA2000 = packetCDMA2000; |
|
1235 packetQoS.GetProfileParameters(requestStatus, profilePckgCDMA2000); |
|
1236 User::WaitForRequest(requestStatus); |
|
1237 TInt error = requestStatus.Int(); |
|
1238 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
1239 |
|
1240 //------------------------------------------------------------------------- |
|
1241 // Test B: Test passing wrong descriptor size to parameter in |
|
1242 // RPacketQoS::GetProfileParameters |
|
1243 //------------------------------------------------------------------------- |
|
1244 |
|
1245 TBuf8<1> nullDescriptor; |
|
1246 packetQoS.GetProfileParameters(requestStatus, nullDescriptor); |
|
1247 User::WaitForRequest(requestStatus); |
|
1248 error = requestStatus.Int(); |
|
1249 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
1250 |
|
1251 CleanupStack::PopAndDestroy(3); // packetService, packetContext, packetQoS |
|
1252 CleanupStack::PopAndDestroy(2, this); // data, this |
|
1253 } |
|
1254 |
|
1255 |
|
1256 /** |
|
1257 @SYMTestCaseID BA-CTSY-PKTQ-QGPP-0004 |
|
1258 @SYMComponent telephony_ctsy |
|
1259 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketQoS::GetProfileParameters |
|
1260 @SYMTestPriority High |
|
1261 @SYMTestActions Invokes multiple client requests to RPacketQoS::GetProfileParameters |
|
1262 @SYMTestExpectedResults Pass |
|
1263 @SYMTestType CT |
|
1264 */ |
|
1265 void CCTsyPacketQoSFU::TestGetProfileParameters0004L() |
|
1266 { |
|
1267 OpenEtelServerL(EUseExtendedError); |
|
1268 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1269 OpenPhoneL(); |
|
1270 |
|
1271 RBuf8 data; |
|
1272 CleanupClosePushL(data); |
|
1273 |
|
1274 TName profileName; |
|
1275 TName profileName2; |
|
1276 TName profileName3; |
|
1277 |
|
1278 // Open second client |
|
1279 RTelServer telServer2; |
|
1280 TInt ret = telServer2.Connect(); |
|
1281 ASSERT_EQUALS(KErrNone, ret); |
|
1282 CleanupClosePushL(telServer2); |
|
1283 |
|
1284 // Open third client |
|
1285 RTelServer telServer3; |
|
1286 ret = telServer3.Connect(); |
|
1287 ASSERT_EQUALS(KErrNone, ret); |
|
1288 CleanupClosePushL(telServer3); |
|
1289 |
|
1290 RMobilePhone phone2; |
|
1291 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
1292 ASSERT_EQUALS(KErrNone, ret); |
|
1293 CleanupClosePushL(phone2); |
|
1294 |
|
1295 RMobilePhone phone3; |
|
1296 ret = phone3.Open(iTelServer,KMmTsyPhoneName); |
|
1297 ASSERT_EQUALS(KErrNone, ret); |
|
1298 CleanupClosePushL(phone3); |
|
1299 |
|
1300 RPacketService packetService; |
|
1301 OpenPacketServiceL(packetService); |
|
1302 CleanupClosePushL(packetService); |
|
1303 |
|
1304 RPacketService packetService2; |
|
1305 ret = packetService2.Open(phone2); |
|
1306 ASSERT_EQUALS(KErrNone, ret); |
|
1307 CleanupClosePushL(packetService2); |
|
1308 |
|
1309 RPacketService packetService3; |
|
1310 ret = packetService3.Open(phone3); |
|
1311 ASSERT_EQUALS(KErrNone, ret); |
|
1312 CleanupClosePushL(packetService3); |
|
1313 |
|
1314 // Open first context |
|
1315 TInfoName contextId; |
|
1316 RPacketContext packetContext; |
|
1317 ret = packetContext.OpenNewContext(packetService, contextId); |
|
1318 ASSERT_EQUALS(KErrNone, ret); |
|
1319 CleanupClosePushL(packetContext); |
|
1320 |
|
1321 // Open second context |
|
1322 TInfoName contextId2; |
|
1323 RPacketContext packetContext2; |
|
1324 ret = packetContext2.OpenNewContext(packetService2, contextId2); |
|
1325 ASSERT_EQUALS(KErrNone, ret); |
|
1326 CleanupClosePushL(packetContext2); |
|
1327 |
|
1328 // Open third context |
|
1329 TInfoName contextId3; |
|
1330 RPacketContext packetContext3; |
|
1331 ret = packetContext3.OpenNewContext(packetService3, contextId3); |
|
1332 ASSERT_EQUALS(KErrNone, ret); |
|
1333 CleanupClosePushL(packetContext3); |
|
1334 |
|
1335 RPacketQoS packetQoS; |
|
1336 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1337 ASSERT_EQUALS(KErrNone, ret); |
|
1338 CleanupClosePushL(packetQoS); |
|
1339 |
|
1340 RPacketQoS packetQoS2; |
|
1341 ret = packetQoS2.OpenNewQoS(packetContext2, profileName2); |
|
1342 ASSERT_EQUALS(KErrNone, ret); |
|
1343 CleanupClosePushL(packetQoS2); |
|
1344 |
|
1345 RPacketQoS packetQoS3; |
|
1346 ret = packetQoS3.OpenNewQoS(packetContext3, profileName3); |
|
1347 ASSERT_EQUALS(KErrNone, ret); |
|
1348 CleanupClosePushL(packetQoS3); |
|
1349 |
|
1350 //------------------------------------------------------------------------- |
|
1351 // Test A: Test multiple clients requesting RPacketQoS::GetProfileParameters |
|
1352 //------------------------------------------------------------------------- |
|
1353 |
|
1354 TRequestStatus requestStatus1; |
|
1355 TRequestStatus requestStatus2; |
|
1356 TRequestStatus requestStatus3; |
|
1357 |
|
1358 RPacketQoS::TQoSGPRSNegotiated packetGPRS; |
|
1359 TPckg< RPacketQoS::TQoSGPRSNegotiated > profilePckgGPRS = packetGPRS; |
|
1360 packetQoS.GetProfileParameters(requestStatus1, profilePckgGPRS); |
|
1361 |
|
1362 RPacketQoS::TQoSR99_R4Negotiated packetR99; |
|
1363 TPckg< RPacketQoS::TQoSR99_R4Negotiated > profilePckgR99 = packetR99; |
|
1364 packetQoS2.GetProfileParameters(requestStatus2, profilePckgR99); |
|
1365 |
|
1366 RPacketQoS::TQoSR5Negotiated packetR5; |
|
1367 TPckg< RPacketQoS::TQoSR5Negotiated > profilePckgR5 = packetR5; |
|
1368 packetQoS3.GetProfileParameters(requestStatus3, profilePckgR5); |
|
1369 |
|
1370 User::WaitForRequest(requestStatus1); |
|
1371 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
1372 User::WaitForRequest(requestStatus2); |
|
1373 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
1374 User::WaitForRequest(requestStatus3); |
|
1375 ASSERT_EQUALS(KErrNone, requestStatus3.Int()); |
|
1376 |
|
1377 CleanupStack::PopAndDestroy(13); |
|
1378 CleanupStack::PopAndDestroy(2, this); // this |
|
1379 |
|
1380 } |
|
1381 |
|
1382 |
|
1383 /** |
|
1384 @SYMTestCaseID BA-CTSY-PKTQ-QNPC-0001 |
|
1385 @SYMComponent telephony_ctsy |
|
1386 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::NotifyProfileChanged |
|
1387 @SYMTestPriority High |
|
1388 @SYMTestActions Invokes RPacketQoS::NotifyProfileChanged |
|
1389 @SYMTestExpectedResults Pass |
|
1390 @SYMTestType CT |
|
1391 */ |
|
1392 void CCTsyPacketQoSFU::TestNotifyProfileChanged0001L() |
|
1393 { |
|
1394 |
|
1395 OpenEtelServerL(EUseExtendedError); |
|
1396 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1397 OpenPhoneL(); |
|
1398 |
|
1399 RBuf8 data; |
|
1400 CleanupClosePushL(data); |
|
1401 |
|
1402 TName profileName; |
|
1403 |
|
1404 RPacketService packetService; |
|
1405 OpenPacketServiceL(packetService); |
|
1406 CleanupClosePushL(packetService); |
|
1407 |
|
1408 // Open new context |
|
1409 TInfoName contextName; |
|
1410 RPacketContext packetContext; |
|
1411 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
1412 ASSERT_EQUALS(KErrNone, ret); |
|
1413 CleanupClosePushL(packetContext); |
|
1414 |
|
1415 RPacketQoS packetQoS; |
|
1416 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1417 ASSERT_EQUALS(KErrNone, ret); |
|
1418 CleanupClosePushL(packetQoS); |
|
1419 |
|
1420 TRequestStatus requestNotify; |
|
1421 TRequestStatus mockLtsyStatus; |
|
1422 |
|
1423 //------------------------------------------------------------------------- |
|
1424 // TEST C: Successful completion request of |
|
1425 // RPacketQoS::NotifyProfileChanged when result is not cached. |
|
1426 //------------------------------------------------------------------------- |
|
1427 |
|
1428 RPacketQoS::TQoSR5Negotiated qosR5Negotiated; |
|
1429 TPckg< RPacketQoS::TQoSR5Negotiated > pckgQoSR5Negotiated(qosR5Negotiated); |
|
1430 |
|
1431 packetQoS.NotifyProfileChanged(requestNotify, pckgQoSR5Negotiated); |
|
1432 |
|
1433 ChangeProfileDataL<RPacketQoS::TQoSR5Requested>(packetContext, packetQoS, contextName, data); |
|
1434 |
|
1435 User::WaitForRequest(requestNotify); |
|
1436 AssertMockLtsyStatusL(); |
|
1437 ASSERT_EQUALS(KErrNone, requestNotify.Int()); |
|
1438 |
|
1439 ASSERT_EQUALS(qosR5Negotiated.iSignallingIndication , 1 ); |
|
1440 ASSERT_EQUALS(qosR5Negotiated.iSourceStatisticsDescriptor , RPacketQoS::ESourceStatisticsDescriptorSpeech); |
|
1441 ASSERT_EQUALS(qosR5Negotiated.iTrafficClass , RPacketQoS::ETrafficClassStreaming ); |
|
1442 ASSERT_EQUALS(qosR5Negotiated.iDeliveryOrderReqd , RPacketQoS::EDeliveryOrderRequired ); |
|
1443 ASSERT_EQUALS(qosR5Negotiated.iDeliverErroneousSDU , RPacketQoS::EErroneousSDUDeliveryRequired ); |
|
1444 ASSERT_EQUALS(qosR5Negotiated.iMaxSDUSize , 0x100 ); |
|
1445 ASSERT_EQUALS(qosR5Negotiated.iMaxRate.iUplinkRate , 10000 ); |
|
1446 ASSERT_EQUALS(qosR5Negotiated.iMaxRate.iDownlinkRate , 10000 ); |
|
1447 ASSERT_EQUALS(qosR5Negotiated.iBER , RPacketQoS::EBEROnePerHundredThousand ); |
|
1448 ASSERT_EQUALS(qosR5Negotiated.iSDUErrorRatio , RPacketQoS::ESDUErrorRatioOnePerTenThousand ); |
|
1449 ASSERT_EQUALS(qosR5Negotiated.iTrafficHandlingPriority , RPacketQoS::ETrafficPriority2 ); |
|
1450 ASSERT_EQUALS(qosR5Negotiated.iTransferDelay , 1000 ); |
|
1451 ASSERT_EQUALS(qosR5Negotiated.iGuaranteedRate.iDownlinkRate, 1000 ); |
|
1452 ASSERT_EQUALS(qosR5Negotiated.iGuaranteedRate.iUplinkRate , 1000 ); |
|
1453 |
|
1454 //------------------------------------------------------------------------- |
|
1455 // TEST E: Unsolicited completion of RPacketQoS::NotifyProfileChanged |
|
1456 // from LTSY. |
|
1457 //------------------------------------------------------------------------- |
|
1458 |
|
1459 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1460 iMockLTSY.CompleteL(EPacketQoSNotifyProfileChanged, KErrNone, data); |
|
1461 User::WaitForRequest(mockLtsyStatus); |
|
1462 AssertMockLtsyStatusL(); |
|
1463 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1464 |
|
1465 AssertMockLtsyStatusL(); |
|
1466 CleanupStack::PopAndDestroy(3); // packetService, packetContext, packetQoS |
|
1467 CleanupStack::PopAndDestroy(2, this); // data, this |
|
1468 } |
|
1469 |
|
1470 |
|
1471 /** |
|
1472 @SYMTestCaseID BA-CTSY-PKTQ-QNPC-0002 |
|
1473 @SYMComponent telephony_ctsy |
|
1474 @SYMTestCaseDesc Test support in CTSY for cancelling of RPacketQoS::NotifyProfileChanged |
|
1475 @SYMTestPriority High |
|
1476 @SYMTestActions Invokes cancelling of RPacketQoS::NotifyProfileChanged |
|
1477 @SYMTestExpectedResults Pass |
|
1478 @SYMTestType CT |
|
1479 */ |
|
1480 void CCTsyPacketQoSFU::TestNotifyProfileChanged0002L() |
|
1481 { |
|
1482 |
|
1483 OpenEtelServerL(EUseExtendedError); |
|
1484 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1485 OpenPhoneL(); |
|
1486 |
|
1487 RBuf8 data; |
|
1488 CleanupClosePushL(data); |
|
1489 |
|
1490 TName profileName; |
|
1491 |
|
1492 RPacketService packetService; |
|
1493 OpenPacketServiceL(packetService); |
|
1494 CleanupClosePushL(packetService); |
|
1495 |
|
1496 // Open new context |
|
1497 TInfoName contextName; |
|
1498 RPacketContext packetContext; |
|
1499 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
1500 ASSERT_EQUALS(KErrNone, ret); |
|
1501 CleanupClosePushL(packetContext); |
|
1502 |
|
1503 RPacketQoS packetQoS; |
|
1504 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1505 ASSERT_EQUALS(KErrNone, ret); |
|
1506 CleanupClosePushL(packetQoS); |
|
1507 |
|
1508 //------------------------------------------------------------------------- |
|
1509 // Test cancelling of RPacketQoS::NotifyProfileChanged |
|
1510 //------------------------------------------------------------------------- |
|
1511 RPacketQoS::TQoSGPRSNegotiated qosGPRSNegotiated; |
|
1512 TPckg< RPacketQoS::TQoSGPRSNegotiated > pckgQoSGPRSNegotiated(qosGPRSNegotiated); |
|
1513 |
|
1514 TRequestStatus requestNotify; |
|
1515 packetQoS.NotifyProfileChanged(requestNotify, pckgQoSGPRSNegotiated); |
|
1516 |
|
1517 packetQoS.CancelAsyncRequest(EPacketQoSNotifyProfileChanged); |
|
1518 |
|
1519 User::WaitForRequest(requestNotify); |
|
1520 AssertMockLtsyStatusL(); |
|
1521 ASSERT_EQUALS(KErrCancel, requestNotify.Int()); |
|
1522 |
|
1523 CleanupStack::PopAndDestroy(3); // packetService, packetContext, packetQoS |
|
1524 CleanupStack::PopAndDestroy(2); // data, this |
|
1525 |
|
1526 } |
|
1527 |
|
1528 |
|
1529 /** |
|
1530 @SYMTestCaseID BA-CTSY-PKTQ-QNPC-0003 |
|
1531 @SYMComponent telephony_ctsy |
|
1532 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::NotifyProfileChanged with bad parameter data |
|
1533 @SYMTestPriority High |
|
1534 @SYMTestActions Invokes RPacketQoS::NotifyProfileChanged with bad parameter data |
|
1535 @SYMTestExpectedResults Pass |
|
1536 @SYMTestType CT |
|
1537 */ |
|
1538 void CCTsyPacketQoSFU::TestNotifyProfileChanged0003L() |
|
1539 { |
|
1540 |
|
1541 OpenEtelServerL(EUseExtendedError); |
|
1542 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1543 OpenPhoneL(); |
|
1544 |
|
1545 RBuf8 data; |
|
1546 CleanupClosePushL(data); |
|
1547 |
|
1548 TName profileName; |
|
1549 |
|
1550 RPacketService packetService; |
|
1551 OpenPacketServiceL(packetService); |
|
1552 CleanupClosePushL(packetService); |
|
1553 |
|
1554 // Open new context |
|
1555 TInfoName contextName; |
|
1556 RPacketContext packetContext; |
|
1557 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
1558 ASSERT_EQUALS(KErrNone, ret); |
|
1559 CleanupClosePushL(packetContext); |
|
1560 |
|
1561 RPacketQoS packetQoS; |
|
1562 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1563 ASSERT_EQUALS(KErrNone, ret); |
|
1564 CleanupClosePushL(packetQoS); |
|
1565 |
|
1566 TRequestStatus requestNotify; |
|
1567 |
|
1568 //------------------------------------------------------------------------- |
|
1569 // Test A: Test passing wrong version of parameters to |
|
1570 // RPacketQoS::NotifyProfileChanged |
|
1571 //------------------------------------------------------------------------- |
|
1572 |
|
1573 RPacketQoS::TQoSCDMA2000Negotiated qosCDMA2000Negotiated; |
|
1574 TPckg< RPacketQoS::TQoSCDMA2000Negotiated > pckgQoSCDMA2000Negotiated = qosCDMA2000Negotiated; |
|
1575 |
|
1576 packetQoS.NotifyProfileChanged(requestNotify, pckgQoSCDMA2000Negotiated); |
|
1577 |
|
1578 User::WaitForRequest(requestNotify); |
|
1579 AssertMockLtsyStatusL(); |
|
1580 ASSERT_EQUALS(KErrNotSupported, requestNotify.Int()); |
|
1581 |
|
1582 //------------------------------------------------------------------------- |
|
1583 // Test B: Test passing wrong descriptor size to parameter in |
|
1584 // RPacketQoS::NotifyProfileChanged |
|
1585 //------------------------------------------------------------------------- |
|
1586 |
|
1587 TBuf8<1> nullDes; |
|
1588 |
|
1589 packetQoS.NotifyProfileChanged(requestNotify, nullDes); |
|
1590 |
|
1591 User::WaitForRequest(requestNotify); |
|
1592 AssertMockLtsyStatusL(); |
|
1593 ASSERT_EQUALS(KErrNotSupported, requestNotify.Int()); |
|
1594 |
|
1595 //------------------------------------------------------------------------- |
|
1596 // Test C: Test passing out of bounds parameters to |
|
1597 // RPacketQoS::NotifyProfileChanged |
|
1598 //------------------------------------------------------------------------- |
|
1599 |
|
1600 TPacketDataConfigBase packetGPRS; |
|
1601 TPckg< TPacketDataConfigBase > outOfBoundParameter = packetGPRS; |
|
1602 |
|
1603 packetQoS.NotifyProfileChanged(requestNotify, outOfBoundParameter); |
|
1604 |
|
1605 User::WaitForRequest(requestNotify); |
|
1606 AssertMockLtsyStatusL(); |
|
1607 ASSERT_EQUALS(KErrNotSupported, requestNotify.Int()); |
|
1608 |
|
1609 CleanupStack::PopAndDestroy(3); // packetService, packetContext, packetQoS |
|
1610 CleanupStack::PopAndDestroy(2, this); // data, this |
|
1611 |
|
1612 } |
|
1613 |
|
1614 |
|
1615 /** |
|
1616 @SYMTestCaseID BA-CTSY-PKTQ-QNPC-0004 |
|
1617 @SYMComponent telephony_ctsy |
|
1618 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketQoS::NotifyProfileChanged |
|
1619 @SYMTestPriority High |
|
1620 @SYMTestActions Invokes multiple client requests to RPacketQoS::NotifyProfileChanged |
|
1621 @SYMTestExpectedResults Pass |
|
1622 @SYMTestType CT |
|
1623 */ |
|
1624 void CCTsyPacketQoSFU::TestNotifyProfileChanged0004L() |
|
1625 { |
|
1626 OpenEtelServerL(EUseExtendedError); |
|
1627 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1628 OpenPhoneL(); |
|
1629 |
|
1630 RBuf8 data; |
|
1631 CleanupClosePushL(data); |
|
1632 |
|
1633 TName profileName; |
|
1634 TName profileName2; |
|
1635 TName profileName3; |
|
1636 |
|
1637 // Open second client |
|
1638 RTelServer telServer2; |
|
1639 TInt ret = telServer2.Connect(); |
|
1640 ASSERT_EQUALS(KErrNone, ret); |
|
1641 CleanupClosePushL(telServer2); |
|
1642 |
|
1643 // Open third client |
|
1644 RTelServer telServer3; |
|
1645 ret = telServer3.Connect(); |
|
1646 ASSERT_EQUALS(KErrNone, ret); |
|
1647 CleanupClosePushL(telServer3); |
|
1648 |
|
1649 RMobilePhone phone2; |
|
1650 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
1651 ASSERT_EQUALS(KErrNone, ret); |
|
1652 CleanupClosePushL(phone2); |
|
1653 |
|
1654 RMobilePhone phone3; |
|
1655 ret = phone3.Open(iTelServer,KMmTsyPhoneName); |
|
1656 ASSERT_EQUALS(KErrNone, ret); |
|
1657 CleanupClosePushL(phone3); |
|
1658 |
|
1659 RPacketService packetService; |
|
1660 OpenPacketServiceL(packetService); |
|
1661 CleanupClosePushL(packetService); |
|
1662 |
|
1663 RPacketService packetService2; |
|
1664 ret = packetService2.Open(phone2); |
|
1665 ASSERT_EQUALS(KErrNone, ret); |
|
1666 CleanupClosePushL(packetService2); |
|
1667 |
|
1668 RPacketService packetService3; |
|
1669 ret = packetService3.Open(phone3); |
|
1670 ASSERT_EQUALS(KErrNone, ret); |
|
1671 CleanupClosePushL(packetService3); |
|
1672 |
|
1673 // Open first context |
|
1674 TInfoName contextId; |
|
1675 RPacketContext packetContext; |
|
1676 ret = packetContext.OpenNewContext(packetService, contextId); |
|
1677 ASSERT_EQUALS(KErrNone, ret); |
|
1678 CleanupClosePushL(packetContext); |
|
1679 |
|
1680 // Open second context |
|
1681 TInfoName contextId2; |
|
1682 RPacketContext packetContext2; |
|
1683 ret = packetContext2.OpenNewContext(packetService2, contextId2); |
|
1684 ASSERT_EQUALS(KErrNone, ret); |
|
1685 CleanupClosePushL(packetContext2); |
|
1686 |
|
1687 // Open third context |
|
1688 TInfoName contextId3; |
|
1689 RPacketContext packetContext3; |
|
1690 ret = packetContext3.OpenNewContext(packetService3, contextId3); |
|
1691 ASSERT_EQUALS(KErrNone, ret); |
|
1692 CleanupClosePushL(packetContext3); |
|
1693 |
|
1694 RPacketQoS packetQoS; |
|
1695 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1696 ASSERT_EQUALS(KErrNone, ret); |
|
1697 CleanupClosePushL(packetQoS); |
|
1698 |
|
1699 RPacketQoS packetQoS2; |
|
1700 ret = packetQoS2.OpenNewQoS(packetContext2, profileName2); |
|
1701 ASSERT_EQUALS(KErrNone, ret); |
|
1702 CleanupClosePushL(packetQoS2); |
|
1703 |
|
1704 RPacketQoS packetQoS3; |
|
1705 ret = packetQoS3.OpenNewQoS(packetContext3, profileName3); |
|
1706 ASSERT_EQUALS(KErrNone, ret); |
|
1707 CleanupClosePushL(packetQoS3); |
|
1708 |
|
1709 TRequestStatus requestNotify1; |
|
1710 TRequestStatus requestNotify2; |
|
1711 TRequestStatus requestNotify3; |
|
1712 |
|
1713 //------------------------------------------------------------------------- |
|
1714 // Test A: Test multiple clients requesting RPacketQoS::NotifyProfileChanged |
|
1715 //------------------------------------------------------------------------- |
|
1716 |
|
1717 // first client |
|
1718 RPacketQoS::TQoSGPRSNegotiated qosGPRSNegotiated; |
|
1719 TPckg< RPacketQoS::TQoSGPRSNegotiated > pckgQoSGPRSNegotiated(qosGPRSNegotiated); |
|
1720 packetQoS.NotifyProfileChanged(requestNotify1, pckgQoSGPRSNegotiated); |
|
1721 |
|
1722 // second client |
|
1723 RPacketQoS::TQoSR99_R4Negotiated qosR99_R4Negotiated; |
|
1724 TPckg< RPacketQoS::TQoSR99_R4Negotiated > pckgQoSR99_R4Negotiated(qosR99_R4Negotiated); |
|
1725 packetQoS2.NotifyProfileChanged(requestNotify2, pckgQoSR99_R4Negotiated); |
|
1726 |
|
1727 // third client |
|
1728 RPacketQoS::TQoSR5Negotiated qosR5Negotiated; |
|
1729 TPckg< RPacketQoS::TQoSR5Negotiated > pckgQoSR5Negotiated(qosR5Negotiated); |
|
1730 packetQoS3.NotifyProfileChanged(requestNotify3, pckgQoSR5Negotiated); |
|
1731 |
|
1732 ChangeProfileDataL<RPacketQoS::TQoSGPRSRequested>(packetContext, packetQoS, contextId, data); |
|
1733 User::WaitForRequest(requestNotify1); |
|
1734 AssertMockLtsyStatusL(); |
|
1735 ASSERT_EQUALS(KErrNone, requestNotify1.Int()); |
|
1736 |
|
1737 ChangeProfileDataL<RPacketQoS::TQoSR99_R4Requested>(packetContext2, packetQoS2, contextId2, data); |
|
1738 User::WaitForRequest(requestNotify2); |
|
1739 AssertMockLtsyStatusL(); |
|
1740 ASSERT_EQUALS(KErrNone, requestNotify2.Int()); |
|
1741 |
|
1742 ChangeProfileDataL<RPacketQoS::TQoSR5Requested>(packetContext3, packetQoS3, contextId3, data); |
|
1743 User::WaitForRequest(requestNotify3); |
|
1744 AssertMockLtsyStatusL(); |
|
1745 ASSERT_EQUALS(KErrNone, requestNotify3.Int()); |
|
1746 |
|
1747 CleanupStack::PopAndDestroy(13); |
|
1748 CleanupStack::PopAndDestroy(2, this); // this |
|
1749 } |
|
1750 |
|
1751 |
|
1752 /** |
|
1753 @SYMTestCaseID BA-CTSY-PKTQ-QSPP-0001 |
|
1754 @SYMComponent telephony_ctsy |
|
1755 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::SetProfileParameters |
|
1756 @SYMTestPriority High |
|
1757 @SYMTestActions Invokes RPacketQoS::SetProfileParameters |
|
1758 @SYMTestExpectedResults Pass |
|
1759 @SYMTestType CT |
|
1760 */ |
|
1761 void CCTsyPacketQoSFU::TestSetProfileParameters0001L() |
|
1762 { |
|
1763 |
|
1764 OpenEtelServerL(EUseExtendedError); |
|
1765 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1766 OpenPhoneL(); |
|
1767 |
|
1768 RBuf8 data; |
|
1769 CleanupClosePushL(data); |
|
1770 |
|
1771 RBuf8 completeData; |
|
1772 CleanupClosePushL(completeData); |
|
1773 |
|
1774 RBuf8 expectData; |
|
1775 CleanupClosePushL(expectData); |
|
1776 |
|
1777 TName profileName; |
|
1778 |
|
1779 RPacketService packetService; |
|
1780 OpenPacketServiceL(packetService); |
|
1781 CleanupClosePushL(packetService); |
|
1782 |
|
1783 // Open new context |
|
1784 TInfoName contextName; |
|
1785 RPacketContext packetContext; |
|
1786 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
1787 ASSERT_EQUALS(KErrNone, ret); |
|
1788 CleanupClosePushL(packetContext); |
|
1789 |
|
1790 RPacketQoS packetQoS; |
|
1791 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1792 ASSERT_EQUALS(KErrNone, ret); |
|
1793 CleanupClosePushL(packetQoS); |
|
1794 |
|
1795 TRequestStatus requestStatus; |
|
1796 TRequestStatus mockLtsyStatus; |
|
1797 |
|
1798 RPacketContext::TContextStatus contextStatus; |
|
1799 |
|
1800 RPacketQoS::TQoSGPRSRequested packetGPRS; |
|
1801 TPckg< RPacketQoS::TQoSGPRSRequested > profilePckgGPRS = packetGPRS; |
|
1802 |
|
1803 packetGPRS.iReqPrecedence = RPacketQoS::EPriorityLowPrecedence; |
|
1804 packetGPRS.iMinPrecedence = RPacketQoS::EPriorityLowPrecedence; |
|
1805 packetGPRS.iReqDelay = RPacketQoS::EDelay360ms; |
|
1806 packetGPRS.iMinDelay = RPacketQoS::EDelay40ms; |
|
1807 packetGPRS.iReqReliability = RPacketQoS::EReliabilityClass3; |
|
1808 packetGPRS.iMinReliability = RPacketQoS::EReliabilityClass4; |
|
1809 packetGPRS.iReqPeakThroughput = RPacketQoS::EPeakThroughput32000; |
|
1810 packetGPRS.iMinPeakThroughput = RPacketQoS::EPeakThroughput32000; |
|
1811 packetGPRS.iReqMeanThroughput = RPacketQoS::EMeanThroughput500000; |
|
1812 packetGPRS.iMinMeanThroughput = RPacketQoS::EMeanThroughput1000000; |
|
1813 |
|
1814 packetContext.GetStatus(contextStatus); |
|
1815 |
|
1816 RPacketContext::TContextConfigGPRS contextConfig; |
|
1817 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig = |
|
1818 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig; |
|
1819 |
|
1820 packetContext.GetConfig(requestStatus, pckgContextConfig); |
|
1821 User::WaitForRequest(requestStatus); |
|
1822 |
|
1823 TInfoName primaryContextName; |
|
1824 |
|
1825 TContextParams contextParams; |
|
1826 contextParams.iContextName = contextName; |
|
1827 contextParams.iContextType = contextConfig.iNWIContext; |
|
1828 contextParams.iPdpType = contextConfig.iPdpType; |
|
1829 contextParams.iPrimaryContextName = primaryContextName; |
|
1830 contextParams.iContextStatus = contextStatus; |
|
1831 |
|
1832 TMockLtsyData2<TContextParams, RPacketQoS::TQoSGPRSRequested> |
|
1833 expExpect(contextParams, packetGPRS); |
|
1834 expExpect.SerialiseL(expectData); |
|
1835 |
|
1836 TMockLtsyData1< TInfoName > contexName(contextName); |
|
1837 contexName.SerialiseL(completeData); |
|
1838 |
|
1839 //------------------------------------------------------------------------- |
|
1840 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
1841 //------------------------------------------------------------------------- |
|
1842 |
|
1843 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData); |
|
1844 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrGeneral, completeData); |
|
1845 |
|
1846 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
1847 User::WaitForRequest(requestStatus); |
|
1848 AssertMockLtsyStatusL(); |
|
1849 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
1850 |
|
1851 //------------------------------------------------------------------------- |
|
1852 // TEST C: Successful completion request of |
|
1853 // RPacketQoS::SetProfileParameters when result is not cached. |
|
1854 //------------------------------------------------------------------------- |
|
1855 |
|
1856 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData); |
|
1857 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, completeData); |
|
1858 |
|
1859 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
1860 |
|
1861 User::WaitForRequest(requestStatus); |
|
1862 AssertMockLtsyStatusL(); |
|
1863 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1864 |
|
1865 //------------------------------------------------------------------------- |
|
1866 // TEST E: Unsolicited completion of RPacketQoS::SetProfileParameters |
|
1867 // from LTSY. |
|
1868 //------------------------------------------------------------------------- |
|
1869 |
|
1870 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1871 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, completeData, 0); |
|
1872 User::WaitForRequest(mockLtsyStatus); |
|
1873 AssertMockLtsyStatusL(); |
|
1874 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1875 |
|
1876 //------------------------------------------------------------------------- |
|
1877 // TEST for coverage increasing |
|
1878 //------------------------------------------------------------------------- |
|
1879 |
|
1880 struct TContextMisc completeMisc; |
|
1881 completeMisc.iStatus = RPacketContext::EStatusActivating; |
|
1882 TMockLtsyData2 <TInfoName, TContextMisc> ltsyData(contextName, completeMisc); |
|
1883 ltsyData.SerialiseL(data); |
|
1884 |
|
1885 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1886 iMockLTSY.CompleteL(EPacketContextNotifyStatusChange, KErrNone, data); |
|
1887 User::WaitForRequest(mockLtsyStatus); |
|
1888 AssertMockLtsyStatusL(); |
|
1889 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1890 |
|
1891 //refresh data for ExpectL, as iStatus was changed |
|
1892 packetContext.GetStatus(contextStatus); |
|
1893 contextParams.iContextStatus = contextStatus; |
|
1894 TMockLtsyData2<TContextParams, RPacketQoS::TQoSGPRSRequested> |
|
1895 expExpect2(contextParams, packetGPRS); |
|
1896 expectData.Close(); |
|
1897 expExpect2.SerialiseL(expectData); |
|
1898 |
|
1899 |
|
1900 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData); |
|
1901 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
1902 |
|
1903 User::WaitForRequest(requestStatus); |
|
1904 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1905 AssertMockLtsyStatusL(); |
|
1906 |
|
1907 //------------------------------------------------------------------------- |
|
1908 // TEST coverage increasing |
|
1909 //------------------------------------------------------------------------- |
|
1910 |
|
1911 completeMisc.iStatus = RPacketContext::EStatusActive; |
|
1912 TMockLtsyData2 <TInfoName, TContextMisc> ltsyData2(contextName, completeMisc); |
|
1913 data.Close(); |
|
1914 ltsyData2.SerialiseL(data); |
|
1915 |
|
1916 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
1917 iMockLTSY.CompleteL(EPacketContextNotifyStatusChange, KErrNone, data); |
|
1918 User::WaitForRequest(mockLtsyStatus); |
|
1919 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
1920 |
|
1921 //refresh data for ExpectL, as iStatus was changed |
|
1922 packetContext.GetStatus(contextStatus); |
|
1923 contextParams.iContextStatus = contextStatus; |
|
1924 TMockLtsyData2<TContextParams, RPacketQoS::TQoSGPRSRequested> |
|
1925 expExpect3(contextParams, packetGPRS); |
|
1926 expectData.Close(); |
|
1927 expExpect3.SerialiseL(expectData); |
|
1928 |
|
1929 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData); |
|
1930 //iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, data); |
|
1931 |
|
1932 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
1933 |
|
1934 User::WaitForRequest(requestStatus); |
|
1935 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
1936 AssertMockLtsyStatusL(); |
|
1937 |
|
1938 //------------------------------------------------------------------------- |
|
1939 // TEST A: failure to dispatch request to LTSY |
|
1940 //------------------------------------------------------------------------- |
|
1941 |
|
1942 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData, KErrNotSupported); |
|
1943 |
|
1944 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
1945 User::WaitForRequest(requestStatus); |
|
1946 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
1947 |
|
1948 AssertMockLtsyStatusL(); |
|
1949 |
|
1950 |
|
1951 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
1952 CleanupStack::PopAndDestroy(4, this); // data, this,expectData, completeData |
|
1953 } |
|
1954 |
|
1955 |
|
1956 /** |
|
1957 @SYMTestCaseID BA-CTSY-PKTQ-QSPP-0002 |
|
1958 @SYMComponent telephony_ctsy |
|
1959 @SYMTestCaseDesc Test support in CTSY for cancelling of RPacketQoS::SetProfileParameters |
|
1960 @SYMTestPriority High |
|
1961 @SYMTestActions Invokes cancelling of RPacketQoS::SetProfileParameters |
|
1962 @SYMTestExpectedResults Pass |
|
1963 @SYMTestType CT |
|
1964 */ |
|
1965 void CCTsyPacketQoSFU::TestSetProfileParameters0002L() |
|
1966 { |
|
1967 OpenEtelServerL(EUseExtendedError); |
|
1968 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
1969 OpenPhoneL(); |
|
1970 |
|
1971 RBuf8 data; |
|
1972 CleanupClosePushL(data); |
|
1973 |
|
1974 RBuf8 expectData; |
|
1975 CleanupClosePushL(expectData); |
|
1976 |
|
1977 TName profileName; |
|
1978 |
|
1979 RPacketService packetService; |
|
1980 OpenPacketServiceL(packetService); |
|
1981 CleanupClosePushL(packetService); |
|
1982 |
|
1983 // Open new context |
|
1984 TInfoName contextName; |
|
1985 RPacketContext packetContext; |
|
1986 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
1987 ASSERT_EQUALS(KErrNone, ret); |
|
1988 CleanupClosePushL(packetContext); |
|
1989 |
|
1990 RPacketQoS packetQoS; |
|
1991 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
1992 ASSERT_EQUALS(KErrNone, ret); |
|
1993 CleanupClosePushL(packetQoS); |
|
1994 |
|
1995 TRequestStatus requestStatus; |
|
1996 |
|
1997 RPacketQoS::TQoSGPRSRequested packetGPRS; |
|
1998 TPckg< RPacketQoS::TQoSGPRSRequested > profilePckgGPRS = packetGPRS; |
|
1999 |
|
2000 RPacketContext::TContextStatus contextStatus; |
|
2001 packetContext.GetStatus(contextStatus); |
|
2002 |
|
2003 RPacketContext::TContextConfigGPRS contextConfig; |
|
2004 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig = |
|
2005 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig; |
|
2006 |
|
2007 packetContext.GetConfig(requestStatus, pckgContextConfig); |
|
2008 User::WaitForRequest(requestStatus); |
|
2009 |
|
2010 TInfoName primaryContextName; |
|
2011 |
|
2012 TContextParams contextParams; |
|
2013 contextParams.iContextName = contextName; |
|
2014 contextParams.iContextType = contextConfig.iNWIContext; |
|
2015 contextParams.iPdpType = contextConfig.iPdpType; |
|
2016 contextParams.iPrimaryContextName = primaryContextName; |
|
2017 contextParams.iContextStatus = contextStatus; |
|
2018 |
|
2019 TMockLtsyData2<TContextParams, RPacketQoS::TQoSGPRSRequested> |
|
2020 expExpect(contextParams, packetGPRS); |
|
2021 expExpect.SerialiseL(expectData); |
|
2022 |
|
2023 TMockLtsyData1< TInfoName > contexName(contextName); |
|
2024 contexName.SerialiseL(data); |
|
2025 |
|
2026 //------------------------------------------------------------------------- |
|
2027 // Test cancelling of RPacketQoS::SetProfileParameters |
|
2028 //------------------------------------------------------------------------- |
|
2029 |
|
2030 TRequestStatus mockLtsyStatus; |
|
2031 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
2032 |
|
2033 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData); |
|
2034 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, data, 10); |
|
2035 |
|
2036 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
2037 |
|
2038 packetQoS.CancelAsyncRequest(EPacketQoSSetProfileParams); |
|
2039 |
|
2040 User::WaitForRequest(requestStatus); |
|
2041 |
|
2042 AssertMockLtsyStatusL(); |
|
2043 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2044 |
|
2045 User::WaitForRequest(mockLtsyStatus); |
|
2046 |
|
2047 AssertMockLtsyStatusL(); |
|
2048 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
2049 CleanupStack::PopAndDestroy(3, this); // data, this, expectData |
|
2050 } |
|
2051 |
|
2052 |
|
2053 /** |
|
2054 @SYMTestCaseID BA-CTSY-PKTQ-QSPP-0003 |
|
2055 @SYMComponent telephony_ctsy |
|
2056 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::SetProfileParameters with bad parameter data |
|
2057 @SYMTestPriority High |
|
2058 @SYMTestActions Invokes RPacketQoS::SetProfileParameters with bad parameter data |
|
2059 @SYMTestExpectedResults Pass |
|
2060 @SYMTestType CT |
|
2061 */ |
|
2062 void CCTsyPacketQoSFU::TestSetProfileParameters0003L() |
|
2063 { |
|
2064 |
|
2065 OpenEtelServerL(EUseExtendedError); |
|
2066 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2067 OpenPhoneL(); |
|
2068 |
|
2069 RBuf8 data; |
|
2070 CleanupClosePushL(data); |
|
2071 |
|
2072 TName profileName; |
|
2073 |
|
2074 RPacketService packetService; |
|
2075 OpenPacketServiceL(packetService); |
|
2076 CleanupClosePushL(packetService); |
|
2077 |
|
2078 // Open new context |
|
2079 TInfoName contextName; |
|
2080 RPacketContext packetContext; |
|
2081 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
2082 ASSERT_EQUALS(KErrNone, ret); |
|
2083 CleanupClosePushL(packetContext); |
|
2084 |
|
2085 RPacketQoS packetQoS; |
|
2086 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
2087 ASSERT_EQUALS(KErrNone, ret); |
|
2088 CleanupClosePushL(packetQoS); |
|
2089 |
|
2090 TRequestStatus requestStatus; |
|
2091 |
|
2092 RPacketContext::TContextStatus contextStatus; |
|
2093 packetContext.GetStatus(contextStatus); |
|
2094 |
|
2095 RPacketContext::TContextConfigGPRS contextConfig; |
|
2096 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig = |
|
2097 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig; |
|
2098 |
|
2099 packetContext.GetConfig(requestStatus, pckgContextConfig); |
|
2100 User::WaitForRequest(requestStatus); |
|
2101 |
|
2102 TInfoName primaryContextName; |
|
2103 |
|
2104 TContextParams contextParams; |
|
2105 contextParams.iContextName = contextName; |
|
2106 contextParams.iContextType = contextConfig.iNWIContext; |
|
2107 contextParams.iPdpType = contextConfig.iPdpType; |
|
2108 contextParams.iPrimaryContextName = primaryContextName; |
|
2109 contextParams.iContextStatus = contextStatus; |
|
2110 |
|
2111 TMockLtsyData1< TInfoName > dataContextName(contextName); |
|
2112 dataContextName.SerialiseL(data); |
|
2113 |
|
2114 //------------------------------------------------------------------------- |
|
2115 // Test A: Test passing wrong version of parameters to |
|
2116 // RPacketContext::AddPacketFilter |
|
2117 //------------------------------------------------------------------------- |
|
2118 |
|
2119 // wrong version of parameter |
|
2120 RPacketQoS::TQoSCDMA2000Requested packetCDMA2000; |
|
2121 TPckg< RPacketQoS::TQoSCDMA2000Requested > pckgCDMA2000 = packetCDMA2000; |
|
2122 |
|
2123 packetQoS.SetProfileParameters(requestStatus, pckgCDMA2000); |
|
2124 |
|
2125 User::WaitForRequest(requestStatus); |
|
2126 |
|
2127 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2128 |
|
2129 //------------------------------------------------------------------------- |
|
2130 // Test B: Test passing wrong descriptor size to parameter in |
|
2131 // RPacketContext::AddPacketFilter |
|
2132 //------------------------------------------------------------------------- |
|
2133 |
|
2134 TBuf8<1> nullDescriptor; |
|
2135 |
|
2136 packetQoS.SetProfileParameters(requestStatus, nullDescriptor); |
|
2137 |
|
2138 User::WaitForRequest(requestStatus); |
|
2139 |
|
2140 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2141 |
|
2142 //------------------------------------------------------------------------- |
|
2143 // Test C: Test passing out of bounds parameters to |
|
2144 // RPacketQoS::SetProfileParameters |
|
2145 //------------------------------------------------------------------------- |
|
2146 |
|
2147 TPacketDataConfigBase packetGPRS; |
|
2148 TPckg< TPacketDataConfigBase > parameter = packetGPRS; |
|
2149 |
|
2150 packetQoS.SetProfileParameters(requestStatus, parameter); |
|
2151 |
|
2152 User::WaitForRequest(requestStatus); |
|
2153 |
|
2154 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2155 |
|
2156 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
2157 CleanupStack::PopAndDestroy(2, this); // data, this |
|
2158 } |
|
2159 |
|
2160 |
|
2161 /** |
|
2162 @SYMTestCaseID BA-CTSY-PKTQ-QSPP-0004 |
|
2163 @SYMComponent telephony_ctsy |
|
2164 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketQoS::SetProfileParameters |
|
2165 @SYMTestPriority High |
|
2166 @SYMTestActions Invokes multiple client requests to RPacketQoS::SetProfileParameters |
|
2167 @SYMTestExpectedResults Pass |
|
2168 @SYMTestType CT |
|
2169 */ |
|
2170 void CCTsyPacketQoSFU::TestSetProfileParameters0004L() |
|
2171 { |
|
2172 OpenEtelServerL(EUseExtendedError); |
|
2173 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2174 OpenPhoneL(); |
|
2175 |
|
2176 RBuf8 data1; |
|
2177 CleanupClosePushL(data1); |
|
2178 |
|
2179 RBuf8 data2; |
|
2180 CleanupClosePushL(data2); |
|
2181 |
|
2182 RBuf8 data3; |
|
2183 CleanupClosePushL(data3); |
|
2184 |
|
2185 TName profileName1; |
|
2186 TName profileName2; |
|
2187 TName profileName3; |
|
2188 |
|
2189 RBuf8 expectData1; |
|
2190 CleanupClosePushL(expectData1); |
|
2191 |
|
2192 RBuf8 expectData2; |
|
2193 CleanupClosePushL(expectData2); |
|
2194 |
|
2195 RBuf8 expectData3; |
|
2196 CleanupClosePushL(expectData3); |
|
2197 |
|
2198 // Open second client |
|
2199 RTelServer telServer2; |
|
2200 TInt ret = telServer2.Connect(); |
|
2201 ASSERT_EQUALS(KErrNone, ret); |
|
2202 CleanupClosePushL(telServer2); |
|
2203 |
|
2204 RMobilePhone phone2; |
|
2205 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
2206 ASSERT_EQUALS(KErrNone, ret); |
|
2207 CleanupClosePushL(phone2); |
|
2208 |
|
2209 // Open third client |
|
2210 RTelServer telServer3; |
|
2211 ret = telServer3.Connect(); |
|
2212 ASSERT_EQUALS(KErrNone, ret); |
|
2213 CleanupClosePushL(telServer3); |
|
2214 |
|
2215 RMobilePhone phone3; |
|
2216 ret = phone3.Open(iTelServer,KMmTsyPhoneName); |
|
2217 ASSERT_EQUALS(KErrNone, ret); |
|
2218 CleanupClosePushL(phone3); |
|
2219 |
|
2220 RPacketService packetService1; |
|
2221 OpenPacketServiceL(packetService1); |
|
2222 CleanupClosePushL(packetService1); |
|
2223 |
|
2224 RPacketService packetService2; |
|
2225 ret = packetService2.Open(phone2); |
|
2226 ASSERT_EQUALS(KErrNone, ret); |
|
2227 CleanupClosePushL(packetService2); |
|
2228 |
|
2229 RPacketService packetService3; |
|
2230 ret = packetService3.Open(phone3); |
|
2231 ASSERT_EQUALS(KErrNone, ret); |
|
2232 CleanupClosePushL(packetService3); |
|
2233 |
|
2234 TInfoName contextName1; |
|
2235 RPacketContext packetContext1; |
|
2236 ret = packetContext1.OpenNewContext(packetService1, contextName1); |
|
2237 ASSERT_EQUALS(KErrNone, ret); |
|
2238 CleanupClosePushL(packetContext1); |
|
2239 |
|
2240 TInfoName contextName2; |
|
2241 RPacketContext packetContext2; |
|
2242 ret = packetContext2.OpenNewContext(packetService2, contextName2); |
|
2243 ASSERT_EQUALS(KErrNone, ret); |
|
2244 CleanupClosePushL(packetContext2); |
|
2245 |
|
2246 TInfoName contextName3; |
|
2247 RPacketContext packetContext3; |
|
2248 ret = packetContext3.OpenNewContext(packetService3, contextName3); |
|
2249 ASSERT_EQUALS(KErrNone, ret); |
|
2250 CleanupClosePushL(packetContext3); |
|
2251 |
|
2252 RPacketQoS packetQoS1; |
|
2253 ret = packetQoS1.OpenNewQoS(packetContext1, profileName1); |
|
2254 ASSERT_EQUALS(KErrNone, ret); |
|
2255 CleanupClosePushL(packetQoS1); |
|
2256 |
|
2257 RPacketQoS packetQoS2; |
|
2258 ret = packetQoS2.OpenNewQoS(packetContext2, profileName2); |
|
2259 ASSERT_EQUALS(KErrNone, ret); |
|
2260 CleanupClosePushL(packetQoS2); |
|
2261 |
|
2262 RPacketQoS packetQoS3; |
|
2263 ret = packetQoS3.OpenNewQoS(packetContext3, profileName3); |
|
2264 ASSERT_EQUALS(KErrNone, ret); |
|
2265 CleanupClosePushL(packetQoS3); |
|
2266 |
|
2267 TRequestStatus requestStatus; |
|
2268 |
|
2269 // for packetContext1 |
|
2270 RPacketQoS::TQoSGPRSRequested packetGPRS; |
|
2271 TPckg< RPacketQoS::TQoSGPRSRequested > profilePckgGPRS = packetGPRS; |
|
2272 |
|
2273 RPacketContext::TContextStatus contextStatus1; |
|
2274 packetContext1.GetStatus(contextStatus1); |
|
2275 |
|
2276 RPacketContext::TContextConfigGPRS contextConfig1; |
|
2277 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig1 = |
|
2278 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig1; |
|
2279 |
|
2280 packetContext1.GetConfig(requestStatus, pckgContextConfig1); |
|
2281 User::WaitForRequest(requestStatus); |
|
2282 |
|
2283 TInfoName primaryContextName1; |
|
2284 |
|
2285 TContextParams contextParams1; |
|
2286 contextParams1.iContextName = contextName1; |
|
2287 contextParams1.iContextType = contextConfig1.iNWIContext; |
|
2288 contextParams1.iPdpType = contextConfig1.iPdpType; |
|
2289 contextParams1.iPrimaryContextName = primaryContextName1; |
|
2290 contextParams1.iContextStatus = contextStatus1; |
|
2291 |
|
2292 TMockLtsyData2<TContextParams, RPacketQoS::TQoSGPRSRequested> |
|
2293 expExpect1(contextParams1, packetGPRS); |
|
2294 expExpect1.SerialiseL(expectData1); |
|
2295 |
|
2296 TMockLtsyData1< TInfoName > dataContextName1(contextName1); |
|
2297 dataContextName1.SerialiseL(data1); |
|
2298 |
|
2299 // for packetContext2 |
|
2300 RPacketQoS::TQoSR99_R4Requested packetR99_R4; |
|
2301 TPckg< RPacketQoS::TQoSR99_R4Requested > profilePckgR99_R4 = packetR99_R4; |
|
2302 |
|
2303 RPacketContext::TContextStatus contextStatus2; |
|
2304 packetContext2.GetStatus(contextStatus2); |
|
2305 |
|
2306 RPacketContext::TContextConfigR99_R4 contextConfig2; |
|
2307 TPckg< RPacketContext::TContextConfigR99_R4 > pckgContextConfig2 = |
|
2308 ( TPckg< RPacketContext::TContextConfigR99_R4 > ) contextConfig2; |
|
2309 |
|
2310 packetContext2.GetConfig(requestStatus, pckgContextConfig2); |
|
2311 User::WaitForRequest(requestStatus); |
|
2312 |
|
2313 TInfoName primaryContextName2; |
|
2314 |
|
2315 TContextParams contextParams2; |
|
2316 contextParams2.iContextName = contextName2; |
|
2317 contextParams2.iContextType = contextConfig2.iNWIContext; |
|
2318 contextParams2.iPdpType = contextConfig2.iPdpType; |
|
2319 contextParams2.iPrimaryContextName = primaryContextName2; |
|
2320 contextParams2.iContextStatus = contextStatus2; |
|
2321 |
|
2322 TMockLtsyData2<TContextParams, RPacketQoS::TQoSR99_R4Requested> |
|
2323 expExpect2(contextParams2, packetR99_R4); |
|
2324 expExpect2.SerialiseL(expectData2); |
|
2325 |
|
2326 TMockLtsyData1< TInfoName > dataContextName2(contextName2); |
|
2327 dataContextName2.SerialiseL(data2); |
|
2328 |
|
2329 // for packetContext3 |
|
2330 RPacketQoS::TQoSR5Requested packetR5; |
|
2331 TPckg< RPacketQoS::TQoSR5Requested > profilePckgR5 = packetR5; |
|
2332 |
|
2333 RPacketContext::TContextStatus contextStatus3; |
|
2334 packetContext3.GetStatus(contextStatus3); |
|
2335 |
|
2336 RPacketContext::TContextConfigGPRS contextConfig3; |
|
2337 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig3 = |
|
2338 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig3; |
|
2339 |
|
2340 packetContext3.GetConfig(requestStatus, pckgContextConfig3); |
|
2341 User::WaitForRequest(requestStatus); |
|
2342 |
|
2343 TInfoName primaryContextName3; |
|
2344 |
|
2345 TContextParams contextParams3; |
|
2346 contextParams3.iContextName = contextName3; |
|
2347 contextParams3.iContextType = contextConfig3.iNWIContext; |
|
2348 contextParams3.iPdpType = contextConfig3.iPdpType; |
|
2349 contextParams3.iPrimaryContextName = primaryContextName3; |
|
2350 contextParams3.iContextStatus = contextStatus3; |
|
2351 |
|
2352 TMockLtsyData2<TContextParams, RPacketQoS::TQoSR5Requested> |
|
2353 expExpect3(contextParams3, packetR5); |
|
2354 expExpect3.SerialiseL(expectData3); |
|
2355 |
|
2356 TMockLtsyData1< TInfoName > dataContextName3(contextName3); |
|
2357 dataContextName3.SerialiseL(data3); |
|
2358 |
|
2359 //------------------------------------------------------------------------- |
|
2360 // Test A: Test multiple clients requesting RPacketQoS::SetProfileParameters |
|
2361 //------------------------------------------------------------------------- |
|
2362 |
|
2363 TRequestStatus requestStatus1; |
|
2364 TRequestStatus requestStatus2; |
|
2365 TRequestStatus requestStatus3; |
|
2366 |
|
2367 iMockLTSY.ExpectL (EPacketQoSSetProfileParams, expectData1); |
|
2368 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, data1); |
|
2369 packetQoS1.SetProfileParameters(requestStatus1, profilePckgGPRS); |
|
2370 |
|
2371 iMockLTSY.ExpectL (EPacketQoSSetProfileParams, expectData2); |
|
2372 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, data2); |
|
2373 packetQoS2.SetProfileParameters(requestStatus2, profilePckgR99_R4); |
|
2374 |
|
2375 iMockLTSY.ExpectL (EPacketQoSSetProfileParams, expectData3); |
|
2376 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, data3); |
|
2377 packetQoS3.SetProfileParameters(requestStatus3, profilePckgR5); |
|
2378 |
|
2379 User::WaitForRequest(requestStatus1); |
|
2380 ASSERT_EQUALS(KErrNone, requestStatus1.Int()); |
|
2381 |
|
2382 User::WaitForRequest(requestStatus2); |
|
2383 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
2384 |
|
2385 User::WaitForRequest(requestStatus3); |
|
2386 AssertMockLtsyStatusL(); |
|
2387 ASSERT_EQUALS(KErrNone, requestStatus3.Int()); |
|
2388 |
|
2389 CleanupStack::PopAndDestroy(3); // packetQoS1, packetQoS2, packetQoS3 |
|
2390 CleanupStack::PopAndDestroy(3); // packetContext1, packetContext2, packetContext3 |
|
2391 CleanupStack::PopAndDestroy(3); // packetService1, packetService2, packetService3 |
|
2392 CleanupStack::PopAndDestroy(4); // telServer2, telServer3 |
|
2393 // phone2, phone3 |
|
2394 CleanupStack::PopAndDestroy(7, this); // data1, data2, data3, expectData1, |
|
2395 // expectData2, expectData3, |
|
2396 // this |
|
2397 } |
|
2398 |
|
2399 |
|
2400 /** |
|
2401 @SYMTestCaseID BA-CTSY-PKTQ-QSPP-0005 |
|
2402 @SYMComponent telephony_ctsy |
|
2403 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::SetProfileParameters with timeout |
|
2404 @SYMTestPriority High |
|
2405 @SYMTestActions Invokes RPacketQoS::SetProfileParameters and tests for timeout |
|
2406 @SYMTestExpectedResults Pass |
|
2407 @SYMTestType CT |
|
2408 */ |
|
2409 void CCTsyPacketQoSFU::TestSetProfileParameters0005L() |
|
2410 { |
|
2411 OpenEtelServerL(EUseExtendedError); |
|
2412 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2413 OpenPhoneL(); |
|
2414 |
|
2415 RBuf8 data; |
|
2416 CleanupClosePushL(data); |
|
2417 |
|
2418 TName profileName; |
|
2419 |
|
2420 RBuf8 expectData; |
|
2421 CleanupClosePushL(expectData); |
|
2422 |
|
2423 RPacketService packetService; |
|
2424 OpenPacketServiceL(packetService); |
|
2425 CleanupClosePushL(packetService); |
|
2426 |
|
2427 // Open new context |
|
2428 TInfoName contextName; |
|
2429 RPacketContext packetContext; |
|
2430 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
2431 ASSERT_EQUALS(KErrNone, ret); |
|
2432 CleanupClosePushL(packetContext); |
|
2433 |
|
2434 RPacketQoS packetQoS; |
|
2435 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
2436 ASSERT_EQUALS(KErrNone, ret); |
|
2437 CleanupClosePushL(packetQoS); |
|
2438 |
|
2439 TRequestStatus requestStatus; |
|
2440 |
|
2441 RPacketQoS::TQoSGPRSRequested packetGPRS; |
|
2442 TPckg< RPacketQoS::TQoSGPRSRequested > profilePckgGPRS = packetGPRS; |
|
2443 |
|
2444 RPacketContext::TContextStatus contextStatus; |
|
2445 packetContext.GetStatus(contextStatus); |
|
2446 |
|
2447 RPacketContext::TContextConfigGPRS contextConfig; |
|
2448 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig = |
|
2449 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig; |
|
2450 |
|
2451 packetContext.GetConfig(requestStatus, pckgContextConfig); |
|
2452 User::WaitForRequest(requestStatus); |
|
2453 |
|
2454 TInfoName primaryContextName; |
|
2455 |
|
2456 TContextParams contextParams; |
|
2457 contextParams.iContextName = contextName; |
|
2458 contextParams.iContextType = contextConfig.iNWIContext; |
|
2459 contextParams.iPdpType = contextConfig.iPdpType; |
|
2460 contextParams.iPrimaryContextName = primaryContextName; |
|
2461 contextParams.iContextStatus = contextStatus; |
|
2462 |
|
2463 TMockLtsyData2<TContextParams, RPacketQoS::TQoSGPRSRequested> |
|
2464 expExpect(contextParams, packetGPRS); |
|
2465 expExpect.SerialiseL(expectData); |
|
2466 |
|
2467 //------------------------------------------------------------------------- |
|
2468 // Test A: Test timeout of RPacketQoS::SetProfileParameters |
|
2469 //------------------------------------------------------------------------- |
|
2470 |
|
2471 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, expectData); |
|
2472 |
|
2473 packetQoS.SetProfileParameters(requestStatus, profilePckgGPRS); |
|
2474 |
|
2475 User::WaitForRequest(requestStatus); |
|
2476 AssertMockLtsyStatusL(); |
|
2477 ASSERT_EQUALS(KErrTimedOut, requestStatus.Int()); |
|
2478 |
|
2479 CleanupStack::PopAndDestroy(3); // packetServicem, packetContext, packetQoS |
|
2480 CleanupStack::PopAndDestroy(3, this); // data, this, expectData |
|
2481 } |
|
2482 |
|
2483 |
|
2484 /** |
|
2485 @SYMTestCaseID BA-CTSY-PKTQ-QGPC-0001 |
|
2486 @SYMComponent telephony_ctsy |
|
2487 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::GetProfileCapabilities |
|
2488 @SYMTestPriority High |
|
2489 @SYMTestActions Invokes RPacketQoS::GetProfileCapabilities |
|
2490 @SYMTestExpectedResults Pass |
|
2491 @SYMTestType CT |
|
2492 */ |
|
2493 void CCTsyPacketQoSFU::TestGetProfileCapabilities0001L() |
|
2494 { |
|
2495 |
|
2496 OpenEtelServerL(EUseExtendedError); |
|
2497 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2498 OpenPhoneL(); |
|
2499 |
|
2500 RBuf8 data; |
|
2501 CleanupClosePushL(data); |
|
2502 |
|
2503 TName profileName; |
|
2504 |
|
2505 RPacketService packetService; |
|
2506 OpenPacketServiceL(packetService); |
|
2507 CleanupClosePushL(packetService); |
|
2508 |
|
2509 // Open new context |
|
2510 TInfoName contextName; |
|
2511 RPacketContext packetContext; |
|
2512 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
2513 ASSERT_EQUALS(KErrNone, ret); |
|
2514 CleanupClosePushL(packetContext); |
|
2515 |
|
2516 RPacketQoS packetQoS; |
|
2517 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
2518 ASSERT_EQUALS(KErrNone, ret); |
|
2519 CleanupClosePushL(packetQoS); |
|
2520 |
|
2521 TRequestStatus requestStatus; |
|
2522 |
|
2523 //------------------------------------------------------------------------- |
|
2524 // TEST C: Successful completion request of |
|
2525 // RPacketQoS::GetProfileCapabilities when result is not cached. |
|
2526 //------------------------------------------------------------------------- |
|
2527 |
|
2528 RPacketQoS::TQoSCapsGPRS capsGPRS; |
|
2529 TPckg<RPacketQoS::TQoSCapsGPRS> capsGPRSPckg(capsGPRS); |
|
2530 packetQoS.GetProfileCapabilities(requestStatus, capsGPRSPckg); |
|
2531 |
|
2532 User::WaitForRequest(requestStatus); |
|
2533 AssertMockLtsyStatusL(); |
|
2534 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2535 ASSERT_EQUALS(capsGPRS.iPrecedence, KMmPrecedence); |
|
2536 ASSERT_EQUALS(capsGPRS.iDelay, KMmDelay); |
|
2537 ASSERT_EQUALS(capsGPRS.iReliability, KMmReliability); |
|
2538 ASSERT_EQUALS(capsGPRS.iPeak, KMmPeak); |
|
2539 ASSERT_EQUALS(capsGPRS.iMean, KMmMean); |
|
2540 |
|
2541 RPacketQoS::TQoSCapsR99_R4 capsR99_R4; |
|
2542 TPckg<RPacketQoS::TQoSCapsR99_R4> capsR99_R4Pckg(capsR99_R4); |
|
2543 packetQoS.GetProfileCapabilities(requestStatus, capsR99_R4Pckg); |
|
2544 |
|
2545 User::WaitForRequest(requestStatus); |
|
2546 AssertMockLtsyStatusL(); |
|
2547 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2548 ASSERT_EQUALS(capsR99_R4.iTrafficClass, KMmTrafficClass); |
|
2549 ASSERT_EQUALS(capsR99_R4.iDeliveryOrderReqd, KMmDeliveryOrderReqd); |
|
2550 ASSERT_EQUALS(capsR99_R4.iDeliverErroneousSDU, KMmErroneousSDUDelivery); |
|
2551 ASSERT_EQUALS(capsR99_R4.iBER, KMmBitErrorRatio); |
|
2552 ASSERT_EQUALS(capsR99_R4.iSDUErrorRatio, KMmSDUErrorRatio); |
|
2553 ASSERT_EQUALS(capsR99_R4.iTrafficHandlingPriority, KMmTrafficHandlingPriority); |
|
2554 |
|
2555 RPacketQoS::TQoSCapsR5 capsR5; |
|
2556 TPckg<RPacketQoS::TQoSCapsR5> capsR5Pckg(capsR5); |
|
2557 packetQoS.GetProfileCapabilities(requestStatus, capsR5Pckg); |
|
2558 |
|
2559 User::WaitForRequest(requestStatus); |
|
2560 AssertMockLtsyStatusL(); |
|
2561 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2562 ASSERT_EQUALS(capsR5.iTrafficClass, KMmTrafficClass); |
|
2563 ASSERT_EQUALS(capsR5.iDeliveryOrderReqd, KMmDeliveryOrderReqd); |
|
2564 ASSERT_EQUALS(capsR5.iDeliverErroneousSDU, KMmErroneousSDUDelivery); |
|
2565 ASSERT_EQUALS(capsR5.iBER, KMmBitErrorRatio); |
|
2566 ASSERT_EQUALS(capsR5.iSDUErrorRatio, KMmSDUErrorRatio); |
|
2567 ASSERT_EQUALS(capsR5.iTrafficHandlingPriority, KMmTrafficHandlingPriority); |
|
2568 |
|
2569 AssertMockLtsyStatusL(); |
|
2570 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
2571 |
|
2572 CleanupStack::PopAndDestroy(2, this); // data, this |
|
2573 |
|
2574 } |
|
2575 |
|
2576 |
|
2577 /** |
|
2578 @SYMTestCaseID BA-CTSY-PKTQ-QGPC-0003 |
|
2579 @SYMComponent telephony_ctsy |
|
2580 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::GetProfileCapabilities with bad parameter data |
|
2581 @SYMTestPriority High |
|
2582 @SYMTestActions Invokes RPacketQoS::GetProfileCapabilities with bad parameter data |
|
2583 @SYMTestExpectedResults Pass |
|
2584 @SYMTestType CT |
|
2585 */ |
|
2586 void CCTsyPacketQoSFU::TestGetProfileCapabilities0003L() |
|
2587 { |
|
2588 OpenEtelServerL(EUseExtendedError); |
|
2589 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2590 OpenPhoneL(); |
|
2591 |
|
2592 RBuf8 data; |
|
2593 CleanupClosePushL(data); |
|
2594 |
|
2595 TName profileName; |
|
2596 |
|
2597 RPacketService packetService; |
|
2598 OpenPacketServiceL(packetService); |
|
2599 CleanupClosePushL(packetService); |
|
2600 |
|
2601 // Open new context |
|
2602 TInfoName contextName; |
|
2603 RPacketContext packetContext; |
|
2604 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
2605 ASSERT_EQUALS(KErrNone, ret); |
|
2606 CleanupClosePushL(packetContext); |
|
2607 |
|
2608 RPacketQoS packetQoS; |
|
2609 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
2610 ASSERT_EQUALS(KErrNone, ret); |
|
2611 CleanupClosePushL(packetQoS); |
|
2612 |
|
2613 TRequestStatus requestStatus; |
|
2614 |
|
2615 //------------------------------------------------------------------------- |
|
2616 // Test A: Test passing wrong version of parameters to |
|
2617 // RPacketQoS::GetProfileCapabilities |
|
2618 //------------------------------------------------------------------------- |
|
2619 |
|
2620 RPacketQoS::TQoSCapsCDMA2000 capsCDMA2000; |
|
2621 TPckg<RPacketQoS::TQoSCapsCDMA2000> capsCDMA2000Pckg(capsCDMA2000); |
|
2622 |
|
2623 packetQoS.GetProfileCapabilities(requestStatus, capsCDMA2000Pckg); |
|
2624 |
|
2625 User::WaitForRequest(requestStatus); |
|
2626 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2627 AssertMockLtsyStatusL(); |
|
2628 |
|
2629 //------------------------------------------------------------------------- |
|
2630 // Test B: Test passing wrong descriptor size to parameter in |
|
2631 // RPacketQoS::GetProfileCapabilities |
|
2632 //------------------------------------------------------------------------- |
|
2633 |
|
2634 TBuf8<1> nullDescriptor; |
|
2635 packetQoS.GetProfileCapabilities(requestStatus, nullDescriptor); |
|
2636 |
|
2637 User::WaitForRequest(requestStatus); |
|
2638 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2639 AssertMockLtsyStatusL(); |
|
2640 |
|
2641 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
2642 CleanupStack::PopAndDestroy(2, this); // data, this |
|
2643 } |
|
2644 |
|
2645 |
|
2646 /** |
|
2647 @SYMTestCaseID BA-CTSY-PKTQ-QGPC-0004 |
|
2648 @SYMComponent telephony_ctsy |
|
2649 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketQoS::GetProfileCapabilities |
|
2650 @SYMTestPriority High |
|
2651 @SYMTestActions Invokes multiple client requests to RPacketQoS::GetProfileCapabilities |
|
2652 @SYMTestExpectedResults Pass |
|
2653 @SYMTestType CT |
|
2654 */ |
|
2655 void CCTsyPacketQoSFU::TestGetProfileCapabilities0004L() |
|
2656 { |
|
2657 OpenEtelServerL(EUseExtendedError); |
|
2658 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2659 OpenPhoneL(); |
|
2660 |
|
2661 RBuf8 data; |
|
2662 CleanupClosePushL(data); |
|
2663 |
|
2664 // Open second client |
|
2665 RTelServer telServer2; |
|
2666 TInt ret = telServer2.Connect(); |
|
2667 ASSERT_EQUALS(KErrNone, ret); |
|
2668 CleanupClosePushL(telServer2); |
|
2669 |
|
2670 RMobilePhone phone2; |
|
2671 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
2672 ASSERT_EQUALS(KErrNone, ret); |
|
2673 CleanupClosePushL(phone2); |
|
2674 |
|
2675 // Open 3rd client |
|
2676 RTelServer telServer3; |
|
2677 ret = telServer3.Connect(); |
|
2678 ASSERT_EQUALS(KErrNone, ret); |
|
2679 CleanupClosePushL(telServer3); |
|
2680 |
|
2681 RMobilePhone phone3; |
|
2682 ret = phone3.Open(iTelServer,KMmTsyPhoneName); |
|
2683 ASSERT_EQUALS(KErrNone, ret); |
|
2684 CleanupClosePushL(phone3); |
|
2685 |
|
2686 //------------------------------------------------------------------------- |
|
2687 // Test A: Test multiple clients requesting RPacketQoS::GetProfileCapabilities |
|
2688 //------------------------------------------------------------------------- |
|
2689 |
|
2690 TName profileName; |
|
2691 |
|
2692 RPacketService packetService; |
|
2693 OpenPacketServiceL(packetService); |
|
2694 CleanupClosePushL(packetService); |
|
2695 |
|
2696 // Open new context |
|
2697 TInfoName contextName; |
|
2698 RPacketContext packetContext; |
|
2699 ret = packetContext.OpenNewContext(packetService, contextName); |
|
2700 ASSERT_EQUALS(KErrNone, ret); |
|
2701 CleanupClosePushL(packetContext); |
|
2702 |
|
2703 RPacketQoS packetQoS; |
|
2704 ret = packetQoS.OpenNewQoS(packetContext, profileName); |
|
2705 ASSERT_EQUALS(KErrNone, ret); |
|
2706 CleanupClosePushL(packetQoS); |
|
2707 |
|
2708 TName profileName2; |
|
2709 |
|
2710 RPacketService packetService2; |
|
2711 ret = packetService2.Open(phone2); |
|
2712 ASSERT_EQUALS(KErrNone, ret); |
|
2713 CleanupClosePushL(packetService2); |
|
2714 |
|
2715 // Open new context |
|
2716 TInfoName contextName2; |
|
2717 RPacketContext packetContext2; |
|
2718 ret = packetContext2.OpenNewContext(packetService2, contextName2); |
|
2719 ASSERT_EQUALS(KErrNone, ret); |
|
2720 CleanupClosePushL(packetContext2); |
|
2721 |
|
2722 RPacketQoS packetQoS2; |
|
2723 ret = packetQoS2.OpenNewQoS(packetContext2, profileName2); |
|
2724 ASSERT_EQUALS(KErrNone, ret); |
|
2725 CleanupClosePushL(packetQoS2); |
|
2726 |
|
2727 TName profileName3; |
|
2728 |
|
2729 RPacketService packetService3; |
|
2730 ret = packetService3.Open(phone3); |
|
2731 ASSERT_EQUALS(KErrNone, ret); |
|
2732 CleanupClosePushL(packetService3); |
|
2733 |
|
2734 // Open new context |
|
2735 TInfoName contextName3; |
|
2736 RPacketContext packetContext3; |
|
2737 ret = packetContext3.OpenNewContext(packetService3, contextName3); |
|
2738 ASSERT_EQUALS(KErrNone, ret); |
|
2739 CleanupClosePushL(packetContext3); |
|
2740 |
|
2741 RPacketQoS packetQoS3; |
|
2742 ret = packetQoS3.OpenNewQoS(packetContext3, profileName3); |
|
2743 ASSERT_EQUALS(KErrNone, ret); |
|
2744 CleanupClosePushL(packetQoS3); |
|
2745 |
|
2746 TRequestStatus requestStatus; |
|
2747 |
|
2748 RPacketQoS::TQoSCapsGPRS capsGPRS; |
|
2749 TPckg<RPacketQoS::TQoSCapsGPRS> capsGPRSPckg(capsGPRS); |
|
2750 packetQoS.GetProfileCapabilities(requestStatus, capsGPRSPckg); |
|
2751 |
|
2752 TRequestStatus requestStatus2; |
|
2753 |
|
2754 RPacketQoS::TQoSCapsR99_R4 capsR99_R4; |
|
2755 TPckg<RPacketQoS::TQoSCapsR99_R4> capsR99_R4Pckg(capsR99_R4); |
|
2756 packetQoS2.GetProfileCapabilities(requestStatus2, capsR99_R4Pckg); |
|
2757 |
|
2758 TRequestStatus requestStatus3; |
|
2759 |
|
2760 RPacketQoS::TQoSCapsR5 capsR5; |
|
2761 TPckg<RPacketQoS::TQoSCapsR5> capsR5Pckg(capsR5); |
|
2762 packetQoS3.GetProfileCapabilities(requestStatus3, capsR5Pckg); |
|
2763 |
|
2764 User::WaitForRequest(requestStatus); |
|
2765 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2766 ASSERT_EQUALS(capsGPRS.iPrecedence, KMmPrecedence); |
|
2767 ASSERT_EQUALS(capsGPRS.iDelay, KMmDelay); |
|
2768 ASSERT_EQUALS(capsGPRS.iReliability, KMmReliability); |
|
2769 ASSERT_EQUALS(capsGPRS.iPeak, KMmPeak); |
|
2770 ASSERT_EQUALS(capsGPRS.iMean, KMmMean); |
|
2771 |
|
2772 User::WaitForRequest(requestStatus2); |
|
2773 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
2774 ASSERT_EQUALS(capsR99_R4.iTrafficClass, KMmTrafficClass); |
|
2775 ASSERT_EQUALS(capsR99_R4.iDeliveryOrderReqd, KMmDeliveryOrderReqd); |
|
2776 ASSERT_EQUALS(capsR99_R4.iDeliverErroneousSDU, KMmErroneousSDUDelivery); |
|
2777 ASSERT_EQUALS(capsR99_R4.iBER, KMmBitErrorRatio); |
|
2778 ASSERT_EQUALS(capsR99_R4.iSDUErrorRatio, KMmSDUErrorRatio); |
|
2779 ASSERT_EQUALS(capsR99_R4.iTrafficHandlingPriority, KMmTrafficHandlingPriority); |
|
2780 |
|
2781 User::WaitForRequest(requestStatus3); |
|
2782 ASSERT_EQUALS(KErrNone, requestStatus3.Int()); |
|
2783 ASSERT_EQUALS(capsR5.iTrafficClass, KMmTrafficClass); |
|
2784 ASSERT_EQUALS(capsR5.iDeliveryOrderReqd, KMmDeliveryOrderReqd); |
|
2785 ASSERT_EQUALS(capsR5.iDeliverErroneousSDU, KMmErroneousSDUDelivery); |
|
2786 ASSERT_EQUALS(capsR5.iBER, KMmBitErrorRatio); |
|
2787 ASSERT_EQUALS(capsR5.iSDUErrorRatio, KMmSDUErrorRatio); |
|
2788 ASSERT_EQUALS(capsR5.iTrafficHandlingPriority, KMmTrafficHandlingPriority); |
|
2789 |
|
2790 AssertMockLtsyStatusL(); |
|
2791 |
|
2792 CleanupStack::PopAndDestroy(3); // packetQoS3, packetContext3, packetService3, |
|
2793 CleanupStack::PopAndDestroy(3); // packetQoS2, packetContext2, packetService2, |
|
2794 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
2795 CleanupStack::PopAndDestroy(6, this); // phone3, telServer3, phone2, telServer2, data, this |
|
2796 } |
|
2797 |
|
2798 |
|
2799 /** |
|
2800 @SYMTestCaseID BA-CTSY-PKTQ-PCCNT-0001 |
|
2801 @SYMComponent telephony_ctsy |
|
2802 @SYMTestCaseDesc Test support in CTSY for RPacketContext::CreateNewTFT |
|
2803 @SYMTestPriority High |
|
2804 @SYMTestActions Invokes RPacketContext::CreateNewTFT |
|
2805 @SYMTestExpectedResults Pass |
|
2806 @SYMTestType CT |
|
2807 */ |
|
2808 void CCTsyPacketQoSFU::TestCreateNewTFT0001L() |
|
2809 { |
|
2810 OpenEtelServerL(EUseExtendedError); |
|
2811 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2812 OpenPhoneL(); |
|
2813 |
|
2814 RBuf8 data; |
|
2815 CleanupClosePushL(data); |
|
2816 |
|
2817 RPacketService packetService; |
|
2818 OpenPacketServiceL(packetService); |
|
2819 CleanupClosePushL(packetService); |
|
2820 |
|
2821 // Open new context |
|
2822 TInfoName contextName; |
|
2823 RPacketContext packetContext; |
|
2824 TInt ret = packetContext.OpenNewContext(packetService, contextName); |
|
2825 ASSERT_EQUALS(KErrNone, ret); |
|
2826 CleanupClosePushL(packetContext); |
|
2827 |
|
2828 TRequestStatus requestStatus; |
|
2829 |
|
2830 packetContext.CreateNewTFT(requestStatus, 8); |
|
2831 User::WaitForRequest(requestStatus); |
|
2832 AssertMockLtsyStatusL(); |
|
2833 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2834 |
|
2835 AssertMockLtsyStatusL(); |
|
2836 CleanupStack::PopAndDestroy(2); |
|
2837 CleanupStack::PopAndDestroy(2, this); // data, this |
|
2838 |
|
2839 } |
|
2840 |
|
2841 |
|
2842 /** |
|
2843 @SYMTestCaseID BA-CTSY-PKTQ-PCAPF-0001 |
|
2844 @SYMComponent telephony_ctsy |
|
2845 @SYMTestCaseDesc Test support in CTSY for RPacketContext::AddPacketFilter |
|
2846 @SYMTestPriority High |
|
2847 @SYMTestActions Invokes RPacketContext::AddPacketFilter |
|
2848 @SYMTestExpectedResults Pass |
|
2849 @SYMTestType CT |
|
2850 */ |
|
2851 void CCTsyPacketQoSFU::TestAddPacketFilter0001L() |
|
2852 { |
|
2853 |
|
2854 OpenEtelServerL(EUseExtendedError); |
|
2855 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
2856 OpenPhoneL(); |
|
2857 |
|
2858 RBuf8 data; |
|
2859 CleanupClosePushL(data); |
|
2860 |
|
2861 RPacketService packetService; |
|
2862 OpenPacketServiceL(packetService); |
|
2863 CleanupClosePushL(packetService); |
|
2864 |
|
2865 // Open new context |
|
2866 TInfoName contextId; |
|
2867 TInfoName secContextId; |
|
2868 RPacketContext packetPrimContext; |
|
2869 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
2870 ASSERT_EQUALS(KErrNone, err); |
|
2871 CleanupClosePushL(packetPrimContext); |
|
2872 |
|
2873 RPacketContext packetContext; |
|
2874 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
2875 ASSERT_EQUALS(KErrNone, err); |
|
2876 CleanupClosePushL(packetContext); |
|
2877 |
|
2878 TRequestStatus requestStatus; |
|
2879 |
|
2880 //------------------------------------------------------------------------- |
|
2881 // TEST E: Unsolicited completion of RPacketContext::AddPacketFilter |
|
2882 // from LTSY. |
|
2883 //------------------------------------------------------------------------- |
|
2884 |
|
2885 iMockLTSY.NotifyTerminated(requestStatus); |
|
2886 //send completion |
|
2887 iMockLTSY.CompleteL(EPacketContextAddPacketFilter, KErrNone); |
|
2888 // wait for completion |
|
2889 User::WaitForRequest(requestStatus); |
|
2890 AssertMockLtsyStatusL(); |
|
2891 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2892 |
|
2893 //------------------------------------------------------------------------- |
|
2894 // TEST A: failure to dispatch request to LTSY |
|
2895 //------------------------------------------------------------------------- |
|
2896 |
|
2897 RPacketContext::TPacketFilterV2 contextFilter; |
|
2898 contextFilter.iId = 1;// 1 - 8 |
|
2899 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
2900 |
|
2901 RPacketContext::TContextConfigGPRS configGPRS; |
|
2902 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray = new ( ELeave ) CArrayFixFlat |
|
2903 <RPacketContext::TPacketFilterV2>( 1 ); |
|
2904 CleanupStack::PushL(filterArray); |
|
2905 |
|
2906 contextFilter.iId = 1; |
|
2907 filterArray->AppendL( contextFilter ); |
|
2908 |
|
2909 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
2910 packetFilterData( configGPRS, 0, secContextId, filterArray ); |
|
2911 |
|
2912 packetFilterData.SerialiseL(data); |
|
2913 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data, KErrNotSupported); |
|
2914 |
|
2915 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
2916 |
|
2917 User::WaitForRequest(requestStatus); |
|
2918 //ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 50101); |
|
2919 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
2920 AssertMockLtsyStatusL(); |
|
2921 |
|
2922 //------------------------------------------------------------------------- |
|
2923 // TEST B: failure on completion of pending request from LTSY->CTSY |
|
2924 //------------------------------------------------------------------------- |
|
2925 |
|
2926 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
2927 |
|
2928 TMockLtsyData1<TInfoName > contexName(secContextId); |
|
2929 data.Close(); |
|
2930 contexName.SerialiseL(data); |
|
2931 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrGeneral, data); |
|
2932 |
|
2933 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
2934 User::WaitForRequest(requestStatus); |
|
2935 AssertMockLtsyStatusL(); |
|
2936 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
2937 |
|
2938 //------------------------------------------------------------------------- |
|
2939 // TEST C: Successful completion request of |
|
2940 // RPacketContext::AddPacketFilter when result is not cached. |
|
2941 //------------------------------------------------------------------------- |
|
2942 |
|
2943 SetContextActiveL(secContextId); |
|
2944 AssertMockLtsyStatusL(); |
|
2945 |
|
2946 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
2947 User::WaitForRequest(requestStatus); |
|
2948 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2949 |
|
2950 SetContextStatusL(secContextId, RPacketContext::EStatusUnknown); |
|
2951 AssertMockLtsyStatusL(); |
|
2952 |
|
2953 filterArray->AppendL( contextFilter ); |
|
2954 contextFilter.iId = 2; |
|
2955 filterArray->AppendL( contextFilter ); |
|
2956 data.Close(); |
|
2957 packetFilterData.SerialiseL(data); |
|
2958 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
2959 |
|
2960 data.Close(); |
|
2961 contexName.SerialiseL(data); |
|
2962 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
2963 |
|
2964 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
2965 |
|
2966 User::WaitForRequest(requestStatus); |
|
2967 //ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 50101); |
|
2968 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2969 AssertMockLtsyStatusL(); |
|
2970 |
|
2971 //------------------------------------------------------------------------- |
|
2972 // TEST D: RPacketContext::AddPacketFilter again, this time CTSY |
|
2973 // will get result from the cache. |
|
2974 //------------------------------------------------------------------------- |
|
2975 |
|
2976 filterArray->Delete(0); |
|
2977 contextFilter.iId = 4; |
|
2978 filterArray->AppendL( contextFilter ); |
|
2979 data.Close(); |
|
2980 packetFilterData.SerialiseL(data); |
|
2981 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
2982 |
|
2983 data.Close(); |
|
2984 contexName.SerialiseL(data); |
|
2985 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
2986 |
|
2987 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
2988 User::WaitForRequest(requestStatus); |
|
2989 AssertMockLtsyStatusL(); |
|
2990 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
2991 |
|
2992 CleanupStack::PopAndDestroy(4); // packetContext, packetPrimContext, packetService, filterArray |
|
2993 CleanupStack::PopAndDestroy(2, this); // data, this |
|
2994 |
|
2995 } |
|
2996 |
|
2997 |
|
2998 /** |
|
2999 @SYMTestCaseID BA-CTSY-PKTQ-PCAPF-0002 |
|
3000 @SYMComponent telephony_ctsy |
|
3001 @SYMTestCaseDesc Test support in CTSY for cancelling of RPacketContext::AddPacketFilter |
|
3002 @SYMTestPriority High |
|
3003 @SYMTestActions Invokes cancelling of RPacketContext::AddPacketFilter |
|
3004 @SYMTestExpectedResults Pass |
|
3005 @SYMTestType CT |
|
3006 */ |
|
3007 void CCTsyPacketQoSFU::TestAddPacketFilter0002L() |
|
3008 { |
|
3009 |
|
3010 OpenEtelServerL(EUseExtendedError); |
|
3011 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3012 OpenPhoneL(); |
|
3013 |
|
3014 RBuf8 data; |
|
3015 CleanupClosePushL(data); |
|
3016 |
|
3017 //------------------------------------------------------------------------- |
|
3018 // Test cancelling of RPacketContext::AddPacketFilter |
|
3019 //------------------------------------------------------------------------- |
|
3020 |
|
3021 RPacketService packetService; |
|
3022 OpenPacketServiceL(packetService); |
|
3023 CleanupClosePushL(packetService); |
|
3024 |
|
3025 // Open new context |
|
3026 TInfoName contextId; |
|
3027 TInfoName secContextId; |
|
3028 RPacketContext packetPrimContext; |
|
3029 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3030 ASSERT_EQUALS(KErrNone, err); |
|
3031 CleanupClosePushL(packetPrimContext); |
|
3032 |
|
3033 RPacketContext packetContext; |
|
3034 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3035 ASSERT_EQUALS(KErrNone, err); |
|
3036 CleanupClosePushL(packetContext); |
|
3037 |
|
3038 TRequestStatus mockLtsyStatus; |
|
3039 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
3040 |
|
3041 RPacketContext::TPacketFilterV2 contextFilter; |
|
3042 contextFilter.iId = 1;// 1 - 8 |
|
3043 //contextFilter.iEvaluationPrecedenceIndex = 0; |
|
3044 |
|
3045 RPacketContext::TContextConfigGPRS configGPRS; |
|
3046 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray = new ( ELeave ) CArrayFixFlat |
|
3047 <RPacketContext::TPacketFilterV2>( 1 );; |
|
3048 CleanupStack::PushL(filterArray); |
|
3049 filterArray->AppendL( contextFilter ); |
|
3050 |
|
3051 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3052 packetFilterData( configGPRS, 0, secContextId, filterArray ); |
|
3053 |
|
3054 packetFilterData.SerialiseL(data); |
|
3055 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3056 |
|
3057 TMockLtsyData1<TInfoName > contexName(secContextId); |
|
3058 data.Close(); |
|
3059 contexName.SerialiseL(data); |
|
3060 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data, 10); |
|
3061 //iMockLTSY.CompleteL(EPacketContextAddPacketFilter, KErrNone, 10); |
|
3062 |
|
3063 TRequestStatus requestStatus; |
|
3064 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
3065 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3066 |
|
3067 //packetContext.AddPacketFilterCancel(); |
|
3068 packetContext.CancelAsyncRequest(EPacketContextAddPacketFilter); |
|
3069 packetContext.CancelAsyncRequest(EPacketContextSetConfig); |
|
3070 |
|
3071 User::WaitForRequest(requestStatus); |
|
3072 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3073 |
|
3074 // Wait for completion of iMockLTSY.NotifyTerminated |
|
3075 User::WaitForRequest(mockLtsyStatus); |
|
3076 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
3077 AssertMockLtsyStatusL(); |
|
3078 |
|
3079 CleanupStack::PopAndDestroy(4); // packetContext, packetPrimContext, packetService, filterArray |
|
3080 CleanupStack::PopAndDestroy(2); // data, this |
|
3081 } |
|
3082 |
|
3083 |
|
3084 /** |
|
3085 @SYMTestCaseID BA-CTSY-PKTQ-PCAPF-0003 |
|
3086 @SYMComponent telephony_ctsy |
|
3087 @SYMTestCaseDesc Test support in CTSY for RPacketContext::AddPacketFilter with bad parameter data |
|
3088 @SYMTestPriority High |
|
3089 @SYMTestActions Invokes RPacketContext::AddPacketFilter with bad parameter data |
|
3090 @SYMTestExpectedResults Pass |
|
3091 @SYMTestType CT |
|
3092 */ |
|
3093 void CCTsyPacketQoSFU::TestAddPacketFilter0003L() |
|
3094 { |
|
3095 OpenEtelServerL(EUseExtendedError); |
|
3096 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3097 OpenPhoneL(); |
|
3098 |
|
3099 RBuf8 data; |
|
3100 CleanupClosePushL(data); |
|
3101 |
|
3102 RPacketService packetService; |
|
3103 OpenPacketServiceL(packetService); |
|
3104 CleanupClosePushL(packetService); |
|
3105 |
|
3106 // Open new context |
|
3107 TInfoName contextId; |
|
3108 TInfoName secContextId; |
|
3109 RPacketContext packetPrimContext; |
|
3110 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3111 ASSERT_EQUALS(KErrNone, err); |
|
3112 CleanupClosePushL(packetPrimContext); |
|
3113 |
|
3114 RPacketContext packetContext; |
|
3115 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3116 ASSERT_EQUALS(KErrNone, err); |
|
3117 CleanupClosePushL(packetContext); |
|
3118 |
|
3119 TRequestStatus requestStatus; |
|
3120 |
|
3121 //------------------------------------------------------------------------- |
|
3122 // Test C: Test passing out of bounds parameters to |
|
3123 // RPacketContext::AddPacketFilter |
|
3124 //------------------------------------------------------------------------- |
|
3125 |
|
3126 RPacketContext::TPacketFilterV2 contextFilter; |
|
3127 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
3128 |
|
3129 SetContextActiveL(secContextId); |
|
3130 |
|
3131 contextFilter.iId = 0;// 1 - 8 |
|
3132 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3133 User::WaitForRequest(requestStatus); |
|
3134 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3135 |
|
3136 contextFilter.iId = 9;// 1 - 8 |
|
3137 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3138 User::WaitForRequest(requestStatus); |
|
3139 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3140 |
|
3141 contextFilter.iId = 1;// 1 - 8 |
|
3142 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3143 User::WaitForRequest(requestStatus); |
|
3144 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3145 |
|
3146 AssertMockLtsyStatusL(); |
|
3147 SetContextStatusL(secContextId, RPacketContext::EStatusActivating); |
|
3148 |
|
3149 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3150 User::WaitForRequest(requestStatus); |
|
3151 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3152 |
|
3153 contextFilter.iId = 0;// 1 - 8 |
|
3154 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3155 User::WaitForRequest(requestStatus); |
|
3156 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3157 |
|
3158 contextFilter.iId = 9;// 1 - 8 |
|
3159 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3160 User::WaitForRequest(requestStatus); |
|
3161 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3162 |
|
3163 AssertMockLtsyStatusL(); |
|
3164 SetContextStatusL(secContextId, RPacketContext::EStatusInactive); |
|
3165 |
|
3166 contextFilter.iId = 1;// 1 - 8 |
|
3167 packetPrimContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3168 User::WaitForRequest(requestStatus); |
|
3169 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3170 |
|
3171 contextFilter.iId = 0;// 1 - 8 |
|
3172 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3173 User::WaitForRequest(requestStatus); |
|
3174 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3175 |
|
3176 contextFilter.iId = 9;// 1 - 8 |
|
3177 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3178 User::WaitForRequest(requestStatus); |
|
3179 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3180 |
|
3181 AssertMockLtsyStatusL(); |
|
3182 SetContextStatusL(secContextId, RPacketContext::EStatusUnknown); |
|
3183 |
|
3184 contextFilter.iId = 1;// 1 - 8 |
|
3185 packetPrimContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3186 User::WaitForRequest(requestStatus); |
|
3187 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3188 |
|
3189 contextFilter.iId = 0;// 1 - 8 |
|
3190 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3191 User::WaitForRequest(requestStatus); |
|
3192 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3193 |
|
3194 contextFilter.iId = 9;// 1 - 8 |
|
3195 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3196 User::WaitForRequest(requestStatus); |
|
3197 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3198 |
|
3199 AssertMockLtsyStatusL(); |
|
3200 |
|
3201 //------------------------------------------------------------------------- |
|
3202 // Test B: Test passing wrong descriptor size to parameter in |
|
3203 // RPacketContext::AddPacketFilter |
|
3204 //------------------------------------------------------------------------- |
|
3205 |
|
3206 SetContextActiveL(secContextId); |
|
3207 |
|
3208 TBuf8<1> nullDescriptor; |
|
3209 packetContext.AddPacketFilter(requestStatus, nullDescriptor); |
|
3210 |
|
3211 User::WaitForRequest(requestStatus); |
|
3212 AssertMockLtsyStatusL(); |
|
3213 ASSERT_EQUALS(KErrGeneral, requestStatus.Int()); |
|
3214 |
|
3215 CleanupStack::PopAndDestroy(3); // packetContext, packetPrimContext, packetService |
|
3216 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3217 |
|
3218 } |
|
3219 |
|
3220 |
|
3221 /** |
|
3222 @SYMTestCaseID BA-CTSY-PKTQ-PCAPF-0004 |
|
3223 @SYMComponent telephony_ctsy |
|
3224 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketContext::AddPacketFilter |
|
3225 @SYMTestPriority High |
|
3226 @SYMTestActions Invokes multiple client requests to RPacketContext::AddPacketFilter |
|
3227 @SYMTestExpectedResults Pass |
|
3228 @SYMTestType CT |
|
3229 */ |
|
3230 void CCTsyPacketQoSFU::TestAddPacketFilter0004L() |
|
3231 { |
|
3232 OpenEtelServerL(EUseExtendedError); |
|
3233 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3234 OpenPhoneL(); |
|
3235 |
|
3236 RBuf8 data; |
|
3237 CleanupClosePushL(data); |
|
3238 |
|
3239 // Open second client |
|
3240 RTelServer telServer2; |
|
3241 TInt ret = telServer2.Connect(); |
|
3242 ASSERT_EQUALS(KErrNone, ret); |
|
3243 CleanupClosePushL(telServer2); |
|
3244 |
|
3245 RMobilePhone phone2; |
|
3246 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
3247 ASSERT_EQUALS(KErrNone, ret); |
|
3248 CleanupClosePushL(phone2); |
|
3249 |
|
3250 //------------------------------------------------------------------------- |
|
3251 // Test A: Test multiple clients requesting RPacketContext::AddPacketFilter |
|
3252 //------------------------------------------------------------------------- |
|
3253 |
|
3254 RPacketService packetService; |
|
3255 OpenPacketServiceL(packetService); |
|
3256 CleanupClosePushL(packetService); |
|
3257 |
|
3258 // Open new context |
|
3259 TInfoName contextId; |
|
3260 TInfoName secContextId; |
|
3261 RPacketContext packetPrimContext; |
|
3262 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3263 ASSERT_EQUALS(KErrNone, err); |
|
3264 CleanupClosePushL(packetPrimContext); |
|
3265 |
|
3266 RPacketContext packetContext; |
|
3267 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3268 ASSERT_EQUALS(KErrNone, err); |
|
3269 CleanupClosePushL(packetContext); |
|
3270 |
|
3271 RPacketService packetService2; |
|
3272 ret = packetService2.Open(phone2); |
|
3273 ASSERT_EQUALS(KErrNone, ret); |
|
3274 CleanupClosePushL(packetService2); |
|
3275 |
|
3276 // Open new context2 |
|
3277 TInfoName contextId2; |
|
3278 TInfoName secContextId2; |
|
3279 RPacketContext packetPrimContext2; |
|
3280 err = packetPrimContext2.OpenNewContext(packetService2, contextId2); |
|
3281 ASSERT_EQUALS(KErrNone, err); |
|
3282 CleanupClosePushL(packetPrimContext2); |
|
3283 |
|
3284 RPacketContext packetContext2; |
|
3285 err = packetContext2.OpenNewSecondaryContext(packetService2, contextId2, secContextId2); |
|
3286 ASSERT_EQUALS(KErrNone, err); |
|
3287 CleanupClosePushL(packetContext2); |
|
3288 |
|
3289 TRequestStatus requestStatus; |
|
3290 TRequestStatus requestStatus2; |
|
3291 |
|
3292 RPacketContext::TPacketFilterV2 contextFilter; |
|
3293 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
3294 contextFilter.iId = 1;// 1 - 8 |
|
3295 |
|
3296 RPacketContext::TContextConfigGPRS configGPRS; |
|
3297 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray = new ( ELeave ) CArrayFixFlat |
|
3298 <RPacketContext::TPacketFilterV2>( 1 );; |
|
3299 CleanupStack::PushL(filterArray); |
|
3300 filterArray->AppendL( contextFilter ); |
|
3301 |
|
3302 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3303 packetFilterData( configGPRS, 0, secContextId, filterArray ); |
|
3304 packetFilterData.SerialiseL(data); |
|
3305 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3306 |
|
3307 TMockLtsyData1<TInfoName > contexName(secContextId); |
|
3308 data.Close(); |
|
3309 contexName.SerialiseL(data); |
|
3310 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3311 |
|
3312 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3313 |
|
3314 RPacketContext::TPacketFilterV2 contextFilter2; |
|
3315 RPacketContext::TPacketFilterV2Pckg contextFilterPckg2(contextFilter2); |
|
3316 contextFilter2.iId = 2;// 1 - 8 |
|
3317 |
|
3318 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray2 = new ( ELeave ) CArrayFixFlat |
|
3319 <RPacketContext::TPacketFilterV2>( 1 );; |
|
3320 CleanupStack::PushL(filterArray2); |
|
3321 filterArray2->AppendL( contextFilter2 ); |
|
3322 |
|
3323 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3324 packetFilterData2( configGPRS, 0, secContextId2, filterArray2 ); |
|
3325 data.Close(); |
|
3326 packetFilterData2.SerialiseL(data); |
|
3327 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3328 |
|
3329 TMockLtsyData1<TInfoName > contexName2(secContextId2); |
|
3330 data.Close(); |
|
3331 contexName2.SerialiseL(data); |
|
3332 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3333 |
|
3334 packetContext2.AddPacketFilter(requestStatus2, contextFilterPckg2); |
|
3335 |
|
3336 User::WaitForRequest(requestStatus); |
|
3337 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3338 |
|
3339 User::WaitForRequest(requestStatus2); |
|
3340 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
3341 |
|
3342 AssertMockLtsyStatusL(); |
|
3343 |
|
3344 CleanupStack::PopAndDestroy(2); // filterArray2, filterArray |
|
3345 CleanupStack::PopAndDestroy(3); // packetContext2, packetPrimContext2, packetService2 |
|
3346 CleanupStack::PopAndDestroy(3); // packetContext, packetPrimContext, packetService |
|
3347 CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, data, this |
|
3348 } |
|
3349 |
|
3350 |
|
3351 /** |
|
3352 @SYMTestCaseID BA-CTSY-PKTQ-PCRPF-0001 |
|
3353 @SYMComponent telephony_ctsy |
|
3354 @SYMTestCaseDesc Test support in CTSY for RPacketContext::RemovePacketFilter |
|
3355 @SYMTestPriority High |
|
3356 @SYMTestActions Invokes RPacketContext::RemovePacketFilter |
|
3357 @SYMTestExpectedResults Pass |
|
3358 @SYMTestType CT |
|
3359 */ |
|
3360 void CCTsyPacketQoSFU::TestRemovePacketFilter0001L() |
|
3361 { |
|
3362 |
|
3363 OpenEtelServerL(EUseExtendedError); |
|
3364 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3365 OpenPhoneL(); |
|
3366 |
|
3367 RBuf8 data; |
|
3368 CleanupClosePushL(data); |
|
3369 |
|
3370 RPacketService packetService; |
|
3371 OpenPacketServiceL(packetService); |
|
3372 CleanupClosePushL(packetService); |
|
3373 |
|
3374 // Open new context |
|
3375 TInfoName contextId; |
|
3376 TInfoName secContextId; |
|
3377 RPacketContext packetPrimContext; |
|
3378 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3379 ASSERT_EQUALS(KErrNone, err); |
|
3380 CleanupClosePushL(packetPrimContext); |
|
3381 |
|
3382 RPacketContext packetContext; |
|
3383 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3384 ASSERT_EQUALS(KErrNone, err); |
|
3385 CleanupClosePushL(packetContext); |
|
3386 |
|
3387 TRequestStatus requestStatus; |
|
3388 |
|
3389 //------------------------------------------------------------------------- |
|
3390 // TEST E: Unsolicited completion of RPacketContext::RemovePacketFilter |
|
3391 // from LTSY. |
|
3392 //------------------------------------------------------------------------- |
|
3393 |
|
3394 iMockLTSY.NotifyTerminated(requestStatus); |
|
3395 //send completion |
|
3396 iMockLTSY.CompleteL(EPacketContextRemovePacketFilter, KErrNone); |
|
3397 // wait for completion |
|
3398 User::WaitForRequest(requestStatus); |
|
3399 AssertMockLtsyStatusL(); |
|
3400 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3401 |
|
3402 //------------------------------------------------------------------------- |
|
3403 // TEST C: Successful completion request of |
|
3404 // RPacketContext::RemovePacketFilter when result is not cached. |
|
3405 //------------------------------------------------------------------------- |
|
3406 |
|
3407 RPacketContext::TPacketFilterV2 contextFilter; |
|
3408 contextFilter.iId = 1;// 1 - 8 |
|
3409 |
|
3410 RPacketContext::TContextConfigGPRS configGPRS; |
|
3411 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray = new ( ELeave ) CArrayFixFlat |
|
3412 <RPacketContext::TPacketFilterV2>( 1 );; |
|
3413 CleanupStack::PushL(filterArray); |
|
3414 filterArray->AppendL( contextFilter ); |
|
3415 |
|
3416 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3417 packetFilterData( configGPRS, 0, secContextId, filterArray ); |
|
3418 packetFilterData.SerialiseL(data); |
|
3419 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3420 |
|
3421 TMockLtsyData1<TInfoName > contexName(secContextId); |
|
3422 data.Close(); |
|
3423 contexName.SerialiseL(data); |
|
3424 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3425 |
|
3426 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
3427 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3428 User::WaitForRequest(requestStatus); |
|
3429 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3430 |
|
3431 AssertMockLtsyStatusL(); |
|
3432 |
|
3433 packetContext.RemovePacketFilter(requestStatus, 1); |
|
3434 User::WaitForRequest(requestStatus); |
|
3435 AssertMockLtsyStatusL(); |
|
3436 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3437 |
|
3438 //------------------------------------------------------------------------- |
|
3439 // TEST D: RPacketContext::RemovePacketFilter again, this time CTSY |
|
3440 // will get result from the cache. |
|
3441 //------------------------------------------------------------------------- |
|
3442 |
|
3443 packetContext.RemovePacketFilter(requestStatus, 1); |
|
3444 User::WaitForRequest(requestStatus); |
|
3445 AssertMockLtsyStatusL(); |
|
3446 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3447 |
|
3448 CleanupStack::PopAndDestroy(4); // packetContext, packetPrimContext, packetService, filterArray |
|
3449 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3450 } |
|
3451 |
|
3452 |
|
3453 /** |
|
3454 @SYMTestCaseID BA-CTSY-PKTQ-PCRPF-0003 |
|
3455 @SYMComponent telephony_ctsy |
|
3456 @SYMTestCaseDesc Test support in CTSY for RPacketContext::RemovePacketFilter with bad parameter data |
|
3457 @SYMTestPriority High |
|
3458 @SYMTestActions Invokes RPacketContext::RemovePacketFilter with bad parameter data |
|
3459 @SYMTestExpectedResults Pass |
|
3460 @SYMTestType CT |
|
3461 */ |
|
3462 void CCTsyPacketQoSFU::TestRemovePacketFilter0003L() |
|
3463 { |
|
3464 OpenEtelServerL(EUseExtendedError); |
|
3465 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3466 OpenPhoneL(); |
|
3467 |
|
3468 RBuf8 data; |
|
3469 CleanupClosePushL(data); |
|
3470 |
|
3471 //------------------------------------------------------------------------- |
|
3472 // Test C: Test passing out of bounds parameters to |
|
3473 // RPacketContext::AddPacketFilter |
|
3474 //------------------------------------------------------------------------- |
|
3475 |
|
3476 RPacketService packetService; |
|
3477 OpenPacketServiceL(packetService); |
|
3478 CleanupClosePushL(packetService); |
|
3479 |
|
3480 // Open new context |
|
3481 TInfoName contextId; |
|
3482 TInfoName secContextId; |
|
3483 RPacketContext packetPrimContext; |
|
3484 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3485 ASSERT_EQUALS(KErrNone, err); |
|
3486 CleanupClosePushL(packetPrimContext); |
|
3487 |
|
3488 RPacketContext packetContext; |
|
3489 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3490 ASSERT_EQUALS(KErrNone, err); |
|
3491 CleanupClosePushL(packetContext); |
|
3492 |
|
3493 TRequestStatus requestStatus; |
|
3494 |
|
3495 packetContext.RemovePacketFilter(requestStatus, 0); |
|
3496 User::WaitForRequest(requestStatus); |
|
3497 AssertMockLtsyStatusL(); |
|
3498 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3499 |
|
3500 packetContext.RemovePacketFilter(requestStatus, 1); |
|
3501 User::WaitForRequest(requestStatus); |
|
3502 AssertMockLtsyStatusL(); |
|
3503 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3504 |
|
3505 packetContext.RemovePacketFilter(requestStatus, 9); |
|
3506 User::WaitForRequest(requestStatus); |
|
3507 AssertMockLtsyStatusL(); |
|
3508 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3509 |
|
3510 CleanupStack::PopAndDestroy(3); // packetService, packetPrimContext, packetContext |
|
3511 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3512 } |
|
3513 |
|
3514 |
|
3515 /** |
|
3516 @SYMTestCaseID BA-CTSY-PKTQ-PCGPFI-0001 |
|
3517 @SYMComponent telephony_ctsy |
|
3518 @SYMTestCaseDesc Test support in CTSY for RPacketContext::GetPacketFilterInfo |
|
3519 @SYMTestPriority High |
|
3520 @SYMTestActions Invokes RPacketContext::GetPacketFilterInfo |
|
3521 @SYMTestExpectedResults Pass |
|
3522 @SYMTestType CT |
|
3523 */ |
|
3524 void CCTsyPacketQoSFU::TestGetPacketFilterInfo0001L() |
|
3525 { |
|
3526 |
|
3527 OpenEtelServerL(EUseExtendedError); |
|
3528 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3529 OpenPhoneL(); |
|
3530 |
|
3531 RBuf8 data; |
|
3532 CleanupClosePushL(data); |
|
3533 |
|
3534 RPacketService packetService; |
|
3535 OpenPacketServiceL(packetService); |
|
3536 CleanupClosePushL(packetService); |
|
3537 |
|
3538 // Open new context |
|
3539 TInfoName contextId; |
|
3540 TInfoName secContextId; |
|
3541 RPacketContext packetPrimContext; |
|
3542 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3543 ASSERT_EQUALS(KErrNone, err); |
|
3544 CleanupClosePushL(packetPrimContext); |
|
3545 |
|
3546 RPacketContext packetContext; |
|
3547 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3548 ASSERT_EQUALS(KErrNone, err); |
|
3549 CleanupClosePushL(packetContext); |
|
3550 |
|
3551 TRequestStatus requestStatus; |
|
3552 |
|
3553 //------------------------------------------------------------------------- |
|
3554 // TEST C: Successful completion request of |
|
3555 // RPacketContext::GetPacketFilterInfo when result is not cached. |
|
3556 //------------------------------------------------------------------------- |
|
3557 RPacketContext::TPacketFilterV2 contextFilter; |
|
3558 contextFilter.iId = 1;// 1 - 8 |
|
3559 |
|
3560 RPacketContext::TContextConfigGPRS configGPRS; |
|
3561 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray = new ( ELeave ) CArrayFixFlat |
|
3562 <RPacketContext::TPacketFilterV2>( 1 );; |
|
3563 CleanupStack::PushL(filterArray); |
|
3564 filterArray->AppendL( contextFilter ); |
|
3565 |
|
3566 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3567 packetFilterData( configGPRS, 0, secContextId, filterArray ); |
|
3568 packetFilterData.SerialiseL(data); |
|
3569 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3570 |
|
3571 TMockLtsyData1<TInfoName > contexName(secContextId); |
|
3572 data.Close(); |
|
3573 contexName.SerialiseL(data); |
|
3574 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3575 |
|
3576 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
3577 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3578 User::WaitForRequest(requestStatus); |
|
3579 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3580 AssertMockLtsyStatusL(); |
|
3581 |
|
3582 RPacketContext::TPacketFilterV2 packetFilter; |
|
3583 RPacketContext::TPacketFilterV2Pckg filterInfoPckg(packetFilter); |
|
3584 packetContext.GetPacketFilterInfo(requestStatus, 0, filterInfoPckg); |
|
3585 User::WaitForRequest(requestStatus); |
|
3586 |
|
3587 AssertMockLtsyStatusL(); |
|
3588 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3589 ASSERT_EQUALS(contextFilter.iId , packetFilter.iId ); |
|
3590 ASSERT_EQUALS(contextFilter.iEvaluationPrecedenceIndex , packetFilter.iEvaluationPrecedenceIndex ); |
|
3591 ASSERT_EQUALS(0, memcmp(contextFilter.iSrcAddr, |
|
3592 packetFilter.iSrcAddr , |
|
3593 sizeof(RPacketContext::TIPAddress))); |
|
3594 ASSERT_EQUALS(0, memcmp(contextFilter.iSrcAddrSubnetMask, |
|
3595 packetFilter.iSrcAddrSubnetMask, |
|
3596 sizeof(RPacketContext::TIPAddress))); |
|
3597 ASSERT_EQUALS(contextFilter.iProtocolNumberOrNextHeader, packetFilter.iProtocolNumberOrNextHeader); |
|
3598 ASSERT_EQUALS(contextFilter.iSrcPortMin , packetFilter.iSrcPortMin ); |
|
3599 ASSERT_EQUALS(contextFilter.iSrcPortMax , packetFilter.iSrcPortMax ); |
|
3600 ASSERT_EQUALS(contextFilter.iDestPortMin , packetFilter.iDestPortMin ); |
|
3601 ASSERT_EQUALS(contextFilter.iDestPortMax , packetFilter.iDestPortMax ); |
|
3602 ASSERT_EQUALS(contextFilter.iIPSecSPI , packetFilter.iIPSecSPI ); |
|
3603 ASSERT_EQUALS(contextFilter.iTOSorTrafficClass , packetFilter.iTOSorTrafficClass ); |
|
3604 ASSERT_EQUALS(contextFilter.iFlowLabel , packetFilter.iFlowLabel ); |
|
3605 |
|
3606 //------------------------------------------------------------------------- |
|
3607 // TEST D: RPacketContext::GetPacketFilterInfo again, this time CTSY |
|
3608 // will get result from the cache. |
|
3609 //------------------------------------------------------------------------- |
|
3610 |
|
3611 packetContext.RemovePacketFilter(requestStatus, 1); |
|
3612 User::WaitForRequest(requestStatus); |
|
3613 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3614 |
|
3615 iMockLTSY.NotifyTerminated(requestStatus); |
|
3616 TBuf8<1> rejectionCode(1); |
|
3617 TMockLtsyData2< TInfoName, TBuf8<1> > modifyContextData(secContextId, rejectionCode); |
|
3618 data.Close(); |
|
3619 modifyContextData.SerialiseL(data); |
|
3620 iMockLTSY.CompleteL(EPacketContextModifyActiveContext, KErrNone, data); |
|
3621 User::WaitForRequest(requestStatus); |
|
3622 AssertMockLtsyStatusL(); |
|
3623 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3624 |
|
3625 contextFilter.iId = 2; |
|
3626 filterArray->Reset(); |
|
3627 filterArray->AppendL( contextFilter ); |
|
3628 |
|
3629 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3630 packetFilterData2( configGPRS, 0, secContextId, filterArray ); |
|
3631 data.Close(); |
|
3632 packetFilterData2.SerialiseL(data); |
|
3633 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3634 |
|
3635 data.Close(); |
|
3636 contexName.SerialiseL(data); |
|
3637 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3638 |
|
3639 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3640 User::WaitForRequest(requestStatus); |
|
3641 AssertMockLtsyStatusL(); |
|
3642 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3643 |
|
3644 packetContext.GetPacketFilterInfo(requestStatus, 0, filterInfoPckg); |
|
3645 User::WaitForRequest(requestStatus); |
|
3646 |
|
3647 AssertMockLtsyStatusL(); |
|
3648 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3649 ASSERT_EQUALS(contextFilter.iId , packetFilter.iId ); |
|
3650 ASSERT_EQUALS(contextFilter.iEvaluationPrecedenceIndex , packetFilter.iEvaluationPrecedenceIndex ); |
|
3651 ASSERT_EQUALS(0, memcmp(contextFilter.iSrcAddr, |
|
3652 packetFilter.iSrcAddr , |
|
3653 sizeof(RPacketContext::TIPAddress))); |
|
3654 ASSERT_EQUALS(0, memcmp(contextFilter.iSrcAddrSubnetMask, |
|
3655 packetFilter.iSrcAddrSubnetMask, |
|
3656 sizeof(RPacketContext::TIPAddress))); |
|
3657 ASSERT_EQUALS(contextFilter.iProtocolNumberOrNextHeader, packetFilter.iProtocolNumberOrNextHeader); |
|
3658 ASSERT_EQUALS(contextFilter.iSrcPortMin , packetFilter.iSrcPortMin ); |
|
3659 ASSERT_EQUALS(contextFilter.iSrcPortMax , packetFilter.iSrcPortMax ); |
|
3660 ASSERT_EQUALS(contextFilter.iDestPortMin , packetFilter.iDestPortMin ); |
|
3661 ASSERT_EQUALS(contextFilter.iDestPortMax , packetFilter.iDestPortMax ); |
|
3662 ASSERT_EQUALS(contextFilter.iIPSecSPI , packetFilter.iIPSecSPI ); |
|
3663 ASSERT_EQUALS(contextFilter.iTOSorTrafficClass , packetFilter.iTOSorTrafficClass ); |
|
3664 ASSERT_EQUALS(contextFilter.iFlowLabel , packetFilter.iFlowLabel ); |
|
3665 |
|
3666 CleanupStack::PopAndDestroy(4); // packetContext, packetPrimContext, packetService, filterArray |
|
3667 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3668 } |
|
3669 |
|
3670 |
|
3671 /** |
|
3672 @SYMTestCaseID BA-CTSY-PKTQ-PCGPFI-0003 |
|
3673 @SYMComponent telephony_ctsy |
|
3674 @SYMTestCaseDesc Test support in CTSY for RPacketContext::GetPacketFilterInfo with bad parameter data |
|
3675 @SYMTestPriority High |
|
3676 @SYMTestActions Invokes RPacketContext::GetPacketFilterInfo with bad parameter data |
|
3677 @SYMTestExpectedResults Pass |
|
3678 @SYMTestType CT |
|
3679 */ |
|
3680 void CCTsyPacketQoSFU::TestGetPacketFilterInfo0003L() |
|
3681 { |
|
3682 OpenEtelServerL(EUseExtendedError); |
|
3683 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3684 OpenPhoneL(); |
|
3685 |
|
3686 RBuf8 data; |
|
3687 CleanupClosePushL(data); |
|
3688 |
|
3689 RPacketService packetService; |
|
3690 OpenPacketServiceL(packetService); |
|
3691 CleanupClosePushL(packetService); |
|
3692 |
|
3693 // Open new context |
|
3694 TInfoName contextId; |
|
3695 TInfoName secContextId; |
|
3696 RPacketContext packetPrimContext; |
|
3697 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3698 ASSERT_EQUALS(KErrNone, err); |
|
3699 CleanupClosePushL(packetPrimContext); |
|
3700 |
|
3701 RPacketContext packetContext; |
|
3702 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3703 ASSERT_EQUALS(KErrNone, err); |
|
3704 CleanupClosePushL(packetContext); |
|
3705 |
|
3706 TRequestStatus requestStatus; |
|
3707 |
|
3708 //------------------------------------------------------------------------- |
|
3709 // Test C: Test passing out of bounds parameters to |
|
3710 // RPacketContext::GetPacketFilterInfo |
|
3711 //------------------------------------------------------------------------- |
|
3712 |
|
3713 RPacketContext::TPacketFilterV2 packetFilter; |
|
3714 RPacketContext::TPacketFilterV2Pckg filterInfoPckg(packetFilter); |
|
3715 |
|
3716 packetContext.GetPacketFilterInfo(requestStatus, 0, filterInfoPckg); |
|
3717 User::WaitForRequest(requestStatus); |
|
3718 |
|
3719 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3720 AssertMockLtsyStatusL(); |
|
3721 |
|
3722 //------------------------------------------------------------------------- |
|
3723 // Test A: Test passing wrong version of parameters to |
|
3724 // RPacketContext::GetPacketFilterInfo |
|
3725 //------------------------------------------------------------------------- |
|
3726 |
|
3727 TInt wrongPacketFilter; |
|
3728 TPckg<TInt> wrongFilterInfoPckg(wrongPacketFilter); |
|
3729 |
|
3730 packetContext.GetPacketFilterInfo(requestStatus, 0, wrongFilterInfoPckg); |
|
3731 User::WaitForRequest(requestStatus); |
|
3732 |
|
3733 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3734 AssertMockLtsyStatusL(); |
|
3735 |
|
3736 //------------------------------------------------------------------------- |
|
3737 // Test B: Test passing wrong descriptor size to parameter in |
|
3738 // RPacketContext::GetPacketFilterInfo |
|
3739 //------------------------------------------------------------------------- |
|
3740 TBuf8<1> nullDescriptor; |
|
3741 packetContext.GetPacketFilterInfo(requestStatus, 0, nullDescriptor); |
|
3742 User::WaitForRequest(requestStatus); |
|
3743 |
|
3744 ASSERT_EQUALS(KErrArgument, requestStatus.Int()); |
|
3745 AssertMockLtsyStatusL(); |
|
3746 |
|
3747 CleanupStack::PopAndDestroy(3); // packetContext, packetPrimContext, packetService |
|
3748 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3749 } |
|
3750 |
|
3751 |
|
3752 /** |
|
3753 @SYMTestCaseID BA-CTSY-PKTQ-PCGPFI-0004 |
|
3754 @SYMComponent telephony_ctsy |
|
3755 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RPacketContext::GetPacketFilterInfo |
|
3756 @SYMTestPriority High |
|
3757 @SYMTestActions Invokes multiple client requests to RPacketContext::GetPacketFilterInfo |
|
3758 @SYMTestExpectedResults Pass |
|
3759 @SYMTestType CT |
|
3760 */ |
|
3761 void CCTsyPacketQoSFU::TestGetPacketFilterInfo0004L() |
|
3762 { |
|
3763 OpenEtelServerL(EUseExtendedError); |
|
3764 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3765 OpenPhoneL(); |
|
3766 |
|
3767 RBuf8 data; |
|
3768 CleanupClosePushL(data); |
|
3769 |
|
3770 // Open second client |
|
3771 RTelServer telServer2; |
|
3772 TInt ret = telServer2.Connect(); |
|
3773 ASSERT_EQUALS(KErrNone, ret); |
|
3774 CleanupClosePushL(telServer2); |
|
3775 |
|
3776 RMobilePhone phone2; |
|
3777 ret = phone2.Open(iTelServer,KMmTsyPhoneName); |
|
3778 ASSERT_EQUALS(KErrNone, ret); |
|
3779 CleanupClosePushL(phone2); |
|
3780 |
|
3781 RPacketService packetService; |
|
3782 OpenPacketServiceL(packetService); |
|
3783 CleanupClosePushL(packetService); |
|
3784 |
|
3785 // Open new context |
|
3786 TInfoName contextId; |
|
3787 TInfoName secContextId; |
|
3788 RPacketContext packetPrimContext; |
|
3789 TInt err = packetPrimContext.OpenNewContext(packetService, contextId); |
|
3790 ASSERT_EQUALS(KErrNone, err); |
|
3791 CleanupClosePushL(packetPrimContext); |
|
3792 |
|
3793 RPacketContext packetContext; |
|
3794 err = packetContext.OpenNewSecondaryContext(packetService, contextId, secContextId); |
|
3795 ASSERT_EQUALS(KErrNone, err); |
|
3796 CleanupClosePushL(packetContext); |
|
3797 |
|
3798 TRequestStatus requestStatus; |
|
3799 |
|
3800 RPacketService packetService2; |
|
3801 ret = packetService2.Open(phone2); |
|
3802 ASSERT_EQUALS(KErrNone, ret); |
|
3803 CleanupClosePushL(packetService2); |
|
3804 |
|
3805 // Open new context |
|
3806 TInfoName contextId2; |
|
3807 TInfoName secContextId2; |
|
3808 RPacketContext packetPrimContext2; |
|
3809 err = packetPrimContext2.OpenNewContext(packetService2, contextId2); |
|
3810 ASSERT_EQUALS(KErrNone, err); |
|
3811 CleanupClosePushL(packetPrimContext2); |
|
3812 |
|
3813 RPacketContext packetContext2; |
|
3814 err = packetContext2.OpenNewSecondaryContext(packetService2, contextId2, secContextId2); |
|
3815 ASSERT_EQUALS(KErrNone, err); |
|
3816 CleanupClosePushL(packetContext2); |
|
3817 |
|
3818 TRequestStatus requestStatus2; |
|
3819 |
|
3820 //------------------------------------------------------------------------- |
|
3821 // Test A: Test multiple clients requesting RPacketContext::GetPacketFilterInfo |
|
3822 //------------------------------------------------------------------------- |
|
3823 |
|
3824 RPacketContext::TPacketFilterV2 contextFilter; |
|
3825 contextFilter.iId = 1;// 1 - 8 |
|
3826 |
|
3827 RPacketContext::TContextConfigGPRS configGPRS; |
|
3828 CArrayFixFlat< RPacketContext::TPacketFilterV2 >* filterArray = new ( ELeave ) CArrayFixFlat |
|
3829 <RPacketContext::TPacketFilterV2>( 1 );; |
|
3830 CleanupStack::PushL(filterArray); |
|
3831 filterArray->AppendL( contextFilter ); |
|
3832 |
|
3833 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3834 packetFilterData( configGPRS, 0, secContextId, filterArray ); |
|
3835 packetFilterData.SerialiseL(data); |
|
3836 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3837 |
|
3838 TMockLtsyData1<TInfoName > contexName(secContextId); |
|
3839 data.Close(); |
|
3840 contexName.SerialiseL(data); |
|
3841 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3842 |
|
3843 RPacketContext::TPacketFilterV2Pckg contextFilterPckg(contextFilter); |
|
3844 packetContext.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3845 User::WaitForRequest(requestStatus); |
|
3846 //ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 50101); |
|
3847 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3848 AssertMockLtsyStatusL(); |
|
3849 |
|
3850 contextFilter.iId = 2;// 1 - 8 |
|
3851 filterArray->Reset(); |
|
3852 filterArray->AppendL( contextFilter ); |
|
3853 |
|
3854 TMockLtsyContextData2< TInfoName, CArrayFixFlat< RPacketContext::TPacketFilterV2 >* > |
|
3855 packetFilterData2( configGPRS, 0, secContextId2, filterArray ); |
|
3856 data.Close(); |
|
3857 packetFilterData2.SerialiseL(data); |
|
3858 iMockLTSY.ExpectL(EPacketContextAddPacketFilter, data); |
|
3859 |
|
3860 TMockLtsyData1<TInfoName > contexName2(secContextId2); |
|
3861 data.Close(); |
|
3862 contexName2.SerialiseL(data); |
|
3863 iMockLTSY.CompleteL(EPacketContextSetConfig, KErrNone, data); |
|
3864 |
|
3865 packetContext2.AddPacketFilter(requestStatus, contextFilterPckg); |
|
3866 User::WaitForRequest(requestStatus); |
|
3867 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3868 AssertMockLtsyStatusL(); |
|
3869 |
|
3870 RPacketContext::TPacketFilterV2 packetFilter; |
|
3871 RPacketContext::TPacketFilterV2Pckg filterInfoPckg(packetFilter); |
|
3872 packetContext.GetPacketFilterInfo(requestStatus, 0, filterInfoPckg); |
|
3873 |
|
3874 RPacketContext::TPacketFilterV2 packetFilter2; |
|
3875 RPacketContext::TPacketFilterV2Pckg filterInfoPckg2(packetFilter2); |
|
3876 packetContext2.GetPacketFilterInfo(requestStatus2, 0, filterInfoPckg2); |
|
3877 |
|
3878 User::WaitForRequest(requestStatus); |
|
3879 ASSERT_EQUALS(KErrNone, requestStatus.Int()); |
|
3880 contextFilter.iId = 1;// 1 - 8 |
|
3881 ASSERT_EQUALS(contextFilterPckg, filterInfoPckg); |
|
3882 |
|
3883 User::WaitForRequest(requestStatus2); |
|
3884 ASSERT_EQUALS(KErrNone, requestStatus2.Int()); |
|
3885 contextFilter.iId = 2;// 1 - 8 |
|
3886 ASSERT_EQUALS(contextFilterPckg, filterInfoPckg2); |
|
3887 AssertMockLtsyStatusL(); |
|
3888 |
|
3889 CleanupStack::PopAndDestroy(4); // packetContext2, packetPrimContext2, packetService2, filterArray |
|
3890 CleanupStack::PopAndDestroy(3); // packetContext, packetPrimContext, packetService |
|
3891 CleanupStack::PopAndDestroy(4, this); // phone2, telServer2, data, this |
|
3892 } |
|
3893 |
|
3894 /** |
|
3895 @SYMTestCaseID BA-CTSY-PKTQ-PCDT-0001 |
|
3896 @SYMComponent telephony_ctsy |
|
3897 @SYMTestCaseDesc Test support in CTSY for RPacketContext::DeleteTFT |
|
3898 @SYMTestPriority High |
|
3899 @SYMTestActions Invokes RPacketContext::DeleteTFT |
|
3900 @SYMTestExpectedResults Pass |
|
3901 @SYMTestType CT |
|
3902 */ |
|
3903 void CCTsyPacketQoSFU::TestDeleteTFT0001L() |
|
3904 { |
|
3905 OpenEtelServerL(EUseExtendedError); |
|
3906 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3907 OpenPhoneL(); |
|
3908 |
|
3909 RBuf8 data; |
|
3910 CleanupClosePushL(data); |
|
3911 |
|
3912 RPacketService packetService; |
|
3913 OpenPacketServiceL(packetService); |
|
3914 CleanupClosePushL(packetService); |
|
3915 |
|
3916 // Open new context |
|
3917 TInfoName contextName; |
|
3918 RPacketContext packetContext; |
|
3919 packetContext.OpenNewContext(packetService, contextName); |
|
3920 CleanupClosePushL(packetContext); |
|
3921 |
|
3922 TRequestStatus requestStatus; |
|
3923 |
|
3924 packetContext.DeleteTFT(requestStatus); |
|
3925 User::WaitForRequest(requestStatus); |
|
3926 AssertMockLtsyStatusL(); |
|
3927 ASSERT_EQUALS(KErrNotSupported, requestStatus.Int()); |
|
3928 |
|
3929 AssertMockLtsyStatusL(); |
|
3930 CleanupStack::PopAndDestroy(2); |
|
3931 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3932 } |
|
3933 |
|
3934 |
|
3935 /** |
|
3936 @SYMTestCaseID BA-CTSY-PKTQ-QONQ-0001 |
|
3937 @SYMComponent telephony_ctsy |
|
3938 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::OpenNewQoS |
|
3939 @SYMTestPriority High |
|
3940 @SYMTestActions Invokes RPacketQoS::OpenNewQoS |
|
3941 @SYMTestExpectedResults Pass |
|
3942 @SYMTestType CT |
|
3943 */ |
|
3944 void CCTsyPacketQoSFU::TestOpenNewQoS0001L() |
|
3945 { |
|
3946 OpenEtelServerL(EUseExtendedError); |
|
3947 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
3948 OpenPhoneL(); |
|
3949 |
|
3950 RBuf8 data; |
|
3951 CleanupClosePushL(data); |
|
3952 |
|
3953 RPacketService packetService; |
|
3954 OpenPacketServiceL(packetService); |
|
3955 CleanupClosePushL(packetService); |
|
3956 |
|
3957 // Open new context |
|
3958 TInfoName contextName; |
|
3959 RPacketContext packetContext; |
|
3960 TInt err = packetContext.OpenNewContext(packetService, contextName); |
|
3961 ASSERT_EQUALS(KErrNone, err); |
|
3962 CleanupClosePushL(packetContext); |
|
3963 |
|
3964 //------------------------------------------------------------------------- |
|
3965 // TEST C: Successful completion request of |
|
3966 // RPacketQoS::OpenNewQoS when result is not cached. |
|
3967 //------------------------------------------------------------------------- |
|
3968 |
|
3969 RPacketQoS packetQoS; |
|
3970 TInfoName profileName; |
|
3971 err = packetQoS.OpenNewQoS(packetContext, profileName); |
|
3972 ASSERT_EQUALS(KErrNone, err); |
|
3973 packetQoS.Close(); |
|
3974 |
|
3975 //------------------------------------------------------------------------- |
|
3976 // TEST: Call OpenNewQoS without prior clothing |
|
3977 // after successful completion of previous call |
|
3978 //------------------------------------------------------------------------- |
|
3979 |
|
3980 err = packetQoS.OpenNewQoS(packetContext, profileName); |
|
3981 ASSERT_EQUALS(KErrNone, err); |
|
3982 TInfoName profileName2; |
|
3983 err = packetQoS.OpenNewQoS(packetContext, profileName2); |
|
3984 // never get here because of etel panic 11 (EEtelPanicHandleNotClosed) |
|
3985 ASSERT_TRUE( KErrNone != err ); |
|
3986 packetQoS.Close(); |
|
3987 |
|
3988 AssertMockLtsyStatusL(); |
|
3989 CleanupStack::PopAndDestroy(2); // packetContext, packetService |
|
3990 CleanupStack::PopAndDestroy(2, this); // data, this |
|
3991 |
|
3992 } |
|
3993 |
|
3994 |
|
3995 /** |
|
3996 @SYMTestCaseID BA-CTSY-PKTQ-QONQ-0003 |
|
3997 @SYMComponent telephony_ctsy |
|
3998 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::OpenNewQoS with bad parameter data |
|
3999 @SYMTestPriority High |
|
4000 @SYMTestActions Invokes RPacketQoS::OpenNewQoS with bad parameter data |
|
4001 @SYMTestExpectedResults Pass |
|
4002 @SYMTestType CT |
|
4003 */ |
|
4004 void CCTsyPacketQoSFU::TestOpenNewQoS0003L() |
|
4005 { |
|
4006 |
|
4007 OpenEtelServerL(EUseExtendedError); |
|
4008 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4009 OpenPhoneL(); |
|
4010 |
|
4011 RBuf8 data; |
|
4012 CleanupClosePushL(data); |
|
4013 |
|
4014 RPacketService packetService; |
|
4015 OpenPacketServiceL(packetService); |
|
4016 CleanupClosePushL(packetService); |
|
4017 |
|
4018 // Open new context |
|
4019 TInfoName contextName; |
|
4020 RPacketContext packetContext; |
|
4021 TInt err = packetContext.OpenNewContext(packetService, contextName); |
|
4022 ASSERT_EQUALS(KErrNone, err); |
|
4023 CleanupClosePushL(packetContext); |
|
4024 |
|
4025 //------------------------------------------------------------------------- |
|
4026 // Test B: Test passing wrong descriptor size to parameter in |
|
4027 // RPacketQoS::OpenNewQoS |
|
4028 //------------------------------------------------------------------------- |
|
4029 |
|
4030 TBuf<1> buf; |
|
4031 RPacketQoS packetQoS; |
|
4032 err = packetQoS.OpenNewQoS(packetContext, buf); |
|
4033 ASSERT_EQUALS(KErrOverflow, err); |
|
4034 packetQoS.Close(); |
|
4035 |
|
4036 AssertMockLtsyStatusL(); |
|
4037 CleanupStack::PopAndDestroy(2); // packetContext, packetService |
|
4038 CleanupStack::PopAndDestroy(2, this); // data, this |
|
4039 |
|
4040 } |
|
4041 |
|
4042 |
|
4043 /** |
|
4044 @SYMTestCaseID BA-CTSY-PKTQ-QOEQ-0001 |
|
4045 @SYMComponent telephony_ctsy |
|
4046 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::OpenExistingQoS |
|
4047 @SYMTestPriority High |
|
4048 @SYMTestActions Invokes RPacketQoS::OpenExistingQoS |
|
4049 @SYMTestExpectedResults Pass |
|
4050 @SYMTestType CT |
|
4051 */ |
|
4052 void CCTsyPacketQoSFU::TestOpenExistingQoS0001L() |
|
4053 { |
|
4054 |
|
4055 OpenEtelServerL(EUseExtendedError); |
|
4056 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4057 OpenPhoneL(); |
|
4058 |
|
4059 RBuf8 data; |
|
4060 CleanupClosePushL(data); |
|
4061 |
|
4062 RPacketService packetService; |
|
4063 OpenPacketServiceL(packetService); |
|
4064 CleanupClosePushL(packetService); |
|
4065 |
|
4066 // Open new context |
|
4067 TInfoName contextName; |
|
4068 RPacketContext packetContext; |
|
4069 TInt err = packetContext.OpenNewContext(packetService, contextName); |
|
4070 ASSERT_EQUALS(KErrNone, err); |
|
4071 CleanupClosePushL(packetContext); |
|
4072 |
|
4073 // Open new QoS |
|
4074 RPacketQoS packetQoS; |
|
4075 TInfoName profileName; |
|
4076 err = packetQoS.OpenNewQoS(packetContext, profileName); |
|
4077 ASSERT_EQUALS(KErrNone, err); |
|
4078 CleanupClosePushL(packetQoS); |
|
4079 |
|
4080 //------------------------------------------------------------------------- |
|
4081 // TEST C: Successful completion request of |
|
4082 // RPacketQoS::OpenExistingQoS when result is not cached. |
|
4083 //------------------------------------------------------------------------- |
|
4084 |
|
4085 RPacketQoS existingQoS; |
|
4086 err = existingQoS.OpenExistingQoS(packetContext, profileName); |
|
4087 ASSERT_EQUALS(KErrNone, err); |
|
4088 existingQoS.Close(); |
|
4089 |
|
4090 AssertMockLtsyStatusL(); |
|
4091 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
4092 CleanupStack::PopAndDestroy(2, this); // data, this |
|
4093 |
|
4094 } |
|
4095 |
|
4096 |
|
4097 /** |
|
4098 @SYMTestCaseID BA-CTSY-PKTQ-QOEQ-0003 |
|
4099 @SYMComponent telephony_ctsy |
|
4100 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::OpenExistingQoS with bad parameter data |
|
4101 @SYMTestPriority High |
|
4102 @SYMTestActions Invokes RPacketQoS::OpenExistingQoS with bad parameter data |
|
4103 @SYMTestExpectedResults Pass |
|
4104 @SYMTestType CT |
|
4105 */ |
|
4106 void CCTsyPacketQoSFU::TestOpenExistingQoS0003L() |
|
4107 { |
|
4108 |
|
4109 OpenEtelServerL(EUseExtendedError); |
|
4110 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4111 OpenPhoneL(); |
|
4112 |
|
4113 RBuf8 data; |
|
4114 CleanupClosePushL(data); |
|
4115 |
|
4116 RPacketService packetService; |
|
4117 OpenPacketServiceL(packetService); |
|
4118 CleanupClosePushL(packetService); |
|
4119 |
|
4120 // Open new context |
|
4121 TInfoName contextName; |
|
4122 RPacketContext packetContext; |
|
4123 TInt err = packetContext.OpenNewContext(packetService, contextName); |
|
4124 ASSERT_EQUALS(KErrNone, err); |
|
4125 CleanupClosePushL(packetContext); |
|
4126 |
|
4127 // Open new QoS |
|
4128 RPacketQoS packetQoS; |
|
4129 TInfoName profileName; |
|
4130 err = packetQoS.OpenNewQoS(packetContext, profileName); |
|
4131 ASSERT_EQUALS(KErrNone, err); |
|
4132 CleanupClosePushL(packetQoS); |
|
4133 |
|
4134 //------------------------------------------------------------------------- |
|
4135 // Test passing out of bounds parameters to |
|
4136 // RPacketQoS::OpenExistingQoS |
|
4137 //------------------------------------------------------------------------- |
|
4138 |
|
4139 TInfoName name; |
|
4140 |
|
4141 RPacketQoS existingQoS; |
|
4142 name.Copy(_L("What's up")); |
|
4143 err = existingQoS.OpenExistingQoS(packetContext, name); |
|
4144 ASSERT_EQUALS(KErrNotFound, err); |
|
4145 existingQoS.Close(); |
|
4146 |
|
4147 name.Copy(_L(":")); |
|
4148 err = existingQoS.OpenExistingQoS(packetContext, name); |
|
4149 ASSERT_EQUALS(KErrNotFound, err); |
|
4150 existingQoS.Close(); |
|
4151 |
|
4152 name.Copy(_L("What's up:")); |
|
4153 err = existingQoS.OpenExistingQoS(packetContext, name); |
|
4154 ASSERT_EQUALS(KErrNotFound, err); |
|
4155 existingQoS.Close(); |
|
4156 |
|
4157 //------------------------------------------------------------------------- |
|
4158 // Test passing wrong descriptor size to parameter in |
|
4159 // RPacketQoS::OpenExistingQoS |
|
4160 //------------------------------------------------------------------------- |
|
4161 |
|
4162 TBuf<1> buf; |
|
4163 err = existingQoS.OpenExistingQoS(packetContext, buf); |
|
4164 ASSERT_EQUALS(KErrNotFound, err); |
|
4165 existingQoS.Close(); |
|
4166 |
|
4167 AssertMockLtsyStatusL(); |
|
4168 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
4169 CleanupStack::PopAndDestroy(2, this); // data, this |
|
4170 |
|
4171 } |
|
4172 |
|
4173 /** |
|
4174 @SYMTestCaseID BA-CTSY-PKTQ-QOEQ-0004 |
|
4175 @SYMComponent telephony_ctsy |
|
4176 @SYMTestCaseDesc Test support in CTSY for RPacketQoS::OpenExistingQoS with out of bounds parameters |
|
4177 @SYMTestPriority High |
|
4178 @SYMTestActions Invokes RPacketQoS::OpenExistingQoS with out of bounds parameters |
|
4179 @SYMTestExpectedResults Pass |
|
4180 @SYMTestType CT |
|
4181 */ |
|
4182 void CCTsyPacketQoSFU::TestOpenExistingQoS0004L() |
|
4183 { |
|
4184 |
|
4185 OpenEtelServerL(EUseExtendedError); |
|
4186 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
4187 OpenPhoneL(); |
|
4188 |
|
4189 RBuf8 data; |
|
4190 CleanupClosePushL(data); |
|
4191 |
|
4192 RPacketService packetService; |
|
4193 OpenPacketServiceL(packetService); |
|
4194 CleanupClosePushL(packetService); |
|
4195 |
|
4196 // Open new context |
|
4197 TInfoName contextName; |
|
4198 RPacketContext packetContext; |
|
4199 TInt err = packetContext.OpenNewContext(packetService, contextName); |
|
4200 ASSERT_EQUALS(KErrNone, err); |
|
4201 CleanupClosePushL(packetContext); |
|
4202 |
|
4203 // Open new QoS |
|
4204 RPacketQoS packetQoS; |
|
4205 TInfoName profileName; |
|
4206 err = packetQoS.OpenNewQoS(packetContext, profileName); |
|
4207 ASSERT_EQUALS(KErrNone, err); |
|
4208 CleanupClosePushL(packetQoS); |
|
4209 |
|
4210 //------------------------------------------------------------------------- |
|
4211 // Test passing out of bounds parameters to |
|
4212 // RPacketQoS::OpenExistingQoS |
|
4213 //------------------------------------------------------------------------- |
|
4214 |
|
4215 TInfoName name; |
|
4216 |
|
4217 RPacketQoS existingQoS; |
|
4218 name.Copy(_L(":")); |
|
4219 name.Append(profileName); |
|
4220 |
|
4221 err = existingQoS.OpenExistingQoS(packetContext, name); |
|
4222 ASSERT_EQUALS(KErrNotFound, err); |
|
4223 |
|
4224 existingQoS.Close(); |
|
4225 |
|
4226 AssertMockLtsyStatusL(); |
|
4227 |
|
4228 CleanupStack::PopAndDestroy(3); // packetQoS, packetContext, packetService |
|
4229 CleanupStack::PopAndDestroy(2, this); // data, this |
|
4230 |
|
4231 } |
|
4232 |
|
4233 |
|
4234 template< class T > |
|
4235 void CCTsyPacketQoSFU::ChangeProfileDataL(RPacketContext& aPacketContext, RPacketQoS& aPacketQoS, |
|
4236 TInfoName& aContextName, RBuf8& aData) |
|
4237 { |
|
4238 RBuf8 profileParamData1; |
|
4239 CleanupClosePushL(profileParamData1); |
|
4240 |
|
4241 RBuf8 profileParamData2; |
|
4242 CleanupClosePushL(profileParamData2); |
|
4243 |
|
4244 // call packetQoS.SetProfileParameters() |
|
4245 //---------------------------------------------------------------------------- |
|
4246 TRequestStatus requestSetProfile; |
|
4247 |
|
4248 T qosRequested; |
|
4249 TPckg< T > pckgQoSRequested(qosRequested); |
|
4250 |
|
4251 RPacketContext::TContextStatus contextStatus; |
|
4252 aPacketContext.GetStatus(contextStatus); |
|
4253 |
|
4254 RPacketContext::TContextConfigGPRS contextConfig; |
|
4255 TPckg< RPacketContext::TContextConfigGPRS > pckgContextConfig = |
|
4256 ( TPckg< RPacketContext::TContextConfigGPRS > ) contextConfig; |
|
4257 |
|
4258 aPacketContext.GetConfig(requestSetProfile, pckgContextConfig); |
|
4259 User::WaitForRequest(requestSetProfile); |
|
4260 |
|
4261 TInfoName primaryContextName; |
|
4262 |
|
4263 TContextParams contextParams; |
|
4264 contextParams.iContextName = aContextName; |
|
4265 contextParams.iContextType = contextConfig.iNWIContext; |
|
4266 contextParams.iPdpType = contextConfig.iPdpType; |
|
4267 contextParams.iPrimaryContextName = primaryContextName; |
|
4268 contextParams.iContextStatus = contextStatus; |
|
4269 |
|
4270 TMockLtsyData2<TContextParams, T> |
|
4271 expExpect(contextParams, qosRequested); |
|
4272 expExpect.SerialiseL(profileParamData1); |
|
4273 |
|
4274 TMockLtsyData1< TInfoName > mockLTSYData(aContextName); |
|
4275 mockLTSYData.SerialiseL(profileParamData2); |
|
4276 |
|
4277 iMockLTSY.ExpectL(EPacketQoSSetProfileParams, profileParamData1); |
|
4278 iMockLTSY.CompleteL(EPacketQoSSetProfileParams, KErrNone, profileParamData2); |
|
4279 |
|
4280 aPacketQoS.SetProfileParameters(requestSetProfile, pckgQoSRequested); |
|
4281 |
|
4282 User::WaitForRequest(requestSetProfile); |
|
4283 AssertMockLtsyStatusL(); |
|
4284 ASSERT_EQUALS(KErrNone, requestSetProfile.Int()); |
|
4285 //---------------------------------------------------------------------------- |
|
4286 |
|
4287 // call iMockLTSY.CompleteL(EPacketQoSNotifyProfileChanged, KErrNone, data); |
|
4288 //---------------------------------------------------------------------------- |
|
4289 TPacketQoSGPRSNegotiated profileCompleteQoSGPRS; |
|
4290 TPacketQoSR99_R4Negotiated profileQoSR99_R4; |
|
4291 TPacketQoSR5Negotiated profileQoSR5; |
|
4292 |
|
4293 switch(qosRequested.ExtensionId()) |
|
4294 { |
|
4295 case TPacketDataConfigBase::KConfigGPRS: |
|
4296 { |
|
4297 profileCompleteQoSGPRS.iPrecedence = RPacketQoS::EPriorityHighPrecedence; |
|
4298 profileCompleteQoSGPRS.iDelay = RPacketQoS::EDelayClass3; |
|
4299 profileCompleteQoSGPRS.iReliability = RPacketQoS::EReliabilityClass2; |
|
4300 profileCompleteQoSGPRS.iPeakThroughput = RPacketQoS::EPeakThroughput16000; |
|
4301 profileCompleteQoSGPRS.iMeanThroughput = RPacketQoS::EMeanThroughput100000; |
|
4302 } |
|
4303 break; |
|
4304 case TPacketDataConfigBase::KConfigRel99Rel4: |
|
4305 { |
|
4306 profileQoSR99_R4.iTrafficClass = RPacketQoS::ETrafficClassStreaming; |
|
4307 profileQoSR99_R4.iDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired; |
|
4308 profileQoSR99_R4.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; |
|
4309 profileQoSR99_R4.iMaxSDUSize = 0x100; |
|
4310 profileQoSR99_R4.iMaxRate.iUplinkRate = 10000; |
|
4311 profileQoSR99_R4.iMaxRate.iDownlinkRate = 10000; |
|
4312 profileQoSR99_R4.iBER = RPacketQoS::EBEROnePerHundredThousand; |
|
4313 profileQoSR99_R4.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerTenThousand; |
|
4314 profileQoSR99_R4.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; |
|
4315 profileQoSR99_R4.iTransferDelay = 1000; |
|
4316 profileQoSR99_R4.iGuaranteedRate.iUplinkRate = 1000; |
|
4317 profileQoSR99_R4.iGuaranteedRate.iDownlinkRate = 1000; |
|
4318 } |
|
4319 break; |
|
4320 case TPacketDataConfigBase::KConfigRel5: |
|
4321 { |
|
4322 profileQoSR5.iSignallingIndication = ETrue; |
|
4323 profileQoSR5.iSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorSpeech; |
|
4324 profileQoSR5.iTrafficClass = RPacketQoS::ETrafficClassStreaming; |
|
4325 profileQoSR5.iDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired; |
|
4326 profileQoSR5.iDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; |
|
4327 profileQoSR5.iMaxSDUSize = 0x100; |
|
4328 profileQoSR5.iMaxRate.iUplinkRate = 10000; |
|
4329 profileQoSR5.iMaxRate.iDownlinkRate = 10000; |
|
4330 profileQoSR5.iBER = RPacketQoS::EBEROnePerHundredThousand; |
|
4331 profileQoSR5.iSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerTenThousand; |
|
4332 profileQoSR5.iTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; |
|
4333 profileQoSR5.iTransferDelay = 1000; |
|
4334 profileQoSR5.iGuaranteedRate.iUplinkRate = 1000; |
|
4335 profileQoSR5.iGuaranteedRate.iDownlinkRate = 1000; |
|
4336 } |
|
4337 break; |
|
4338 default: |
|
4339 break; |
|
4340 } |
|
4341 |
|
4342 TMockLtsyPacketQoSData1< TInfoName > mockData(profileCompleteQoSGPRS, |
|
4343 profileQoSR99_R4, |
|
4344 profileQoSR5, |
|
4345 aContextName); |
|
4346 aData.Close(); |
|
4347 mockData.SerialiseL(aData); |
|
4348 |
|
4349 TRequestStatus mockLtsyStatus; |
|
4350 iMockLTSY.NotifyTerminated(mockLtsyStatus); |
|
4351 iMockLTSY.CompleteL(EPacketQoSNotifyProfileChanged, KErrNone, aData); |
|
4352 User::WaitForRequest(mockLtsyStatus); |
|
4353 ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int()); |
|
4354 //---------------------------------------------------------------------------- |
|
4355 |
|
4356 CleanupStack::PopAndDestroy(2); |
|
4357 } |