24
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// EtelPacketMbmsContext.cpp
|
|
15 |
// This contains EtelPacket TestCase
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
// Symbian OS includes
|
|
20 |
#include <e32base.h>
|
|
21 |
#include <etelpckt.h>
|
|
22 |
#include "pcktretrieve.h"
|
|
23 |
#include <pcktcs.h>
|
|
24 |
#include "Te_EtelPacketTestStepBase.h"
|
|
25 |
#include "testdef.h"
|
|
26 |
#include "Te_EtelPacketMbmsContext.h"
|
|
27 |
#include "Te_etelpckt_defs.h"
|
|
28 |
|
|
29 |
// constructor
|
|
30 |
CTestMbmsContext::CTestMbmsContext()
|
|
31 |
{
|
|
32 |
// store the name of this test case
|
|
33 |
SetTestStepName(_L("MBMS_CONTEXT"));
|
|
34 |
}
|
|
35 |
|
|
36 |
// destructor
|
|
37 |
CTestMbmsContext::~CTestMbmsContext()
|
|
38 |
{
|
|
39 |
}
|
|
40 |
|
|
41 |
TVerdict CTestMbmsContext::doTestStepPreambleL()
|
|
42 |
{
|
|
43 |
CTestStepEtelPacket::doTestStepPreambleL();
|
|
44 |
TInt ret=iPhone.Open(iTelServer,DPCKTTSY_PHONE_NAME);
|
|
45 |
if(ret != KErrNone)
|
|
46 |
{
|
|
47 |
INFO_PRINTF1(_L("Failed to open phone"));
|
|
48 |
User::Leave(ret);
|
|
49 |
}
|
|
50 |
ret=iPcktService.Open(iPhone);
|
|
51 |
if(ret != KErrNone)
|
|
52 |
{
|
|
53 |
INFO_PRINTF1(_L("Failed to open packet service"));
|
|
54 |
User::Leave(ret);
|
|
55 |
}
|
|
56 |
iTestScheduler=new (ELeave) CActiveScheduler;
|
|
57 |
CActiveScheduler::Install(iTestScheduler);
|
|
58 |
return TestStepResult();
|
|
59 |
}
|
|
60 |
|
|
61 |
TVerdict CTestMbmsContext::doTestStepPostambleL()
|
|
62 |
{
|
|
63 |
delete iTestScheduler;
|
|
64 |
iPcktService.Close();
|
|
65 |
iPhone.Close();
|
|
66 |
CTestStepEtelPacket::doTestStepPostambleL();
|
|
67 |
return TestStepResult();
|
|
68 |
}
|
|
69 |
|
|
70 |
enum TVerdict CTestMbmsContext::doTestStepL( void )
|
|
71 |
/**
|
|
72 |
* Test step to check MBMS service availability functionality
|
|
73 |
*/
|
|
74 |
{
|
|
75 |
TestOpenMbmsContextL();
|
|
76 |
TestInitialiseMbmsContextL();
|
|
77 |
TestMbmsConfigurationL();
|
|
78 |
TestActivateMbmsContextL();
|
|
79 |
TestMbmsServiceStatusL();
|
|
80 |
TestMbmsUpdateSessionL();
|
|
81 |
TestMbmsGetSessionListL();
|
|
82 |
TestDeactivateMbmsContextL();
|
|
83 |
return TestStepResult();
|
|
84 |
}
|
|
85 |
|
|
86 |
void CTestMbmsContext::TestOpenMbmsContextL()
|
|
87 |
{
|
|
88 |
/*
|
|
89 |
* Verify whether a MBMS context is opened successfully.
|
|
90 |
*/
|
|
91 |
TInt retMbmsContext;
|
|
92 |
TName contextName;
|
|
93 |
|
|
94 |
retMbmsContext = iMbmsContext.OpenNewContext(iPcktService, contextName);
|
|
95 |
if(retMbmsContext != KErrNone)
|
|
96 |
{
|
|
97 |
INFO_PRINTF1(_L("Failed to open packet context"));
|
|
98 |
User::Leave(retMbmsContext);
|
|
99 |
}
|
|
100 |
INFO_PRINTF1(_L("Open a MBMS context - Completed"));
|
|
101 |
}
|
|
102 |
|
|
103 |
void CTestMbmsContext::TestMbmsConfigurationL()
|
|
104 |
{
|
|
105 |
/**
|
|
106 |
* Set the MBMS context configuration successfully
|
|
107 |
*/
|
|
108 |
TRequestStatus mbmsConfigStatus;
|
|
109 |
RPacketMbmsContext::TContextConfigMbmsV1 mbmsContextConfig;
|
|
110 |
mbmsContextConfig.iTmgi.SetMCC(DPCKTTSY_MBMS_MCC_ONE);
|
|
111 |
mbmsContextConfig.iTmgi.SetMNC(DPCKTTSY_MBMS_MNC_ONE);
|
|
112 |
mbmsContextConfig.iTmgi.SetServiceId(DPCKTTSY_MBMS_SERVICEID_ONE);
|
|
113 |
mbmsContextConfig.iMbmsAccessBearer = DPCKTTSY_MBMS_ACCESSBEARER_ONE;
|
|
114 |
mbmsContextConfig.iMbmsServicePriority = DPCKTTSY_MBMS_SERVICEPRIORITY_ONE;
|
|
115 |
mbmsContextConfig.iMbmsServiceMode = DPCKTTSY_MBMS_SERVICEMODE_ONE;
|
|
116 |
mbmsContextConfig.iMbmsSessionFlag = DPCKTTSY_MBMS_SESSION_FLAG_TRUE;
|
|
117 |
RPacketMbmsContext::TContextConfigMbmsV1Pckg iMbmsContextConfigPckg(mbmsContextConfig);
|
|
118 |
|
|
119 |
iMbmsContext.SetConfig(mbmsConfigStatus, iMbmsContextConfigPckg);
|
|
120 |
User::WaitForRequest(mbmsConfigStatus);
|
|
121 |
TESTL(mbmsConfigStatus == KErrNone);
|
|
122 |
INFO_PRINTF1(_L("MBMS context set configurations - Completed"));
|
|
123 |
|
|
124 |
/**
|
|
125 |
* Set the MBMS context configuration successfully
|
|
126 |
*/
|
|
127 |
TRequestStatus mbmsConfigStatusCancel;
|
|
128 |
iMbmsContext.SetConfig(mbmsConfigStatusCancel, iMbmsContextConfigPckg);
|
|
129 |
iMbmsContext.CancelAsyncRequest(EPacketContextSetConfig);
|
|
130 |
User::WaitForRequest(mbmsConfigStatusCancel);
|
|
131 |
TESTL(mbmsConfigStatusCancel == KErrCancel);
|
|
132 |
INFO_PRINTF1(_L("Cancel MBMS context set configurations - CANCELLED"));
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Set MBMS context configuration with invalid inputs
|
|
136 |
*/
|
|
137 |
mbmsContextConfig.iTmgi.SetMCC(DPCKTTSY_MBMS_MCC_INVALID);
|
|
138 |
mbmsContextConfig.iTmgi.SetMNC(DPCKTTSY_MBMS_MNC_INVALID);
|
|
139 |
mbmsContextConfig.iTmgi.SetServiceId(DPCKTTSY_MBMS_SERVICEID_INVALID);
|
|
140 |
mbmsContextConfig.iMbmsAccessBearer = DPCKTTSY_MBMS_ACCESSBEARER_INVALID;
|
|
141 |
mbmsContextConfig.iMbmsSessionFlag = DPCKTTSY_MBMS_SESSION_FLAG_TRUE;
|
|
142 |
mbmsContextConfig.iMbmsServiceMode = DPCKTTSY_MBMS_SERVICEMODE_INVALID;
|
|
143 |
|
|
144 |
iMbmsContext.SetConfig(mbmsConfigStatus, iMbmsContextConfigPckg);
|
|
145 |
User::WaitForRequest(mbmsConfigStatus);
|
|
146 |
TESTL(mbmsConfigStatus == KErrCorrupt);
|
|
147 |
INFO_PRINTF1(_L("MBMS set context invalid configurations - Completed"));
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Get MBMS context configuration.
|
|
151 |
*/
|
|
152 |
RPacketMbmsContext::TContextConfigMbmsV1 mbmsGetContextConfig;
|
|
153 |
RPacketMbmsContext::TContextConfigMbmsV1Pckg mbmsGetContextConfigPckg(mbmsGetContextConfig);
|
|
154 |
iMbmsContext.GetConfig(mbmsConfigStatus, mbmsGetContextConfigPckg);
|
|
155 |
User::WaitForRequest(mbmsConfigStatus);
|
|
156 |
mbmsGetContextConfig = mbmsGetContextConfigPckg();
|
|
157 |
TESTL(mbmsGetContextConfig.iTmgi.GetMCC() == DPCKTTSY_MBMS_MCC_ONE);
|
|
158 |
TESTL(mbmsGetContextConfig.iTmgi.GetMNC() == DPCKTTSY_MBMS_MNC_ONE);
|
|
159 |
TESTL(mbmsGetContextConfig.iTmgi.GetServiceId() == DPCKTTSY_MBMS_SERVICEID_ONE);
|
|
160 |
TESTL(mbmsGetContextConfig.iMbmsAccessBearer == DPCKTTSY_MBMS_ACCESSBEARER_ONE);
|
|
161 |
TESTL(mbmsGetContextConfig.iMbmsServicePriority == DPCKTTSY_MBMS_SERVICEPRIORITY_ONE);
|
|
162 |
TESTL(mbmsGetContextConfig.iMbmsServiceMode == DPCKTTSY_MBMS_SERVICEMODE_ONE);
|
|
163 |
TESTL(mbmsGetContextConfig.iMbmsSessionFlag = DPCKTTSY_MBMS_SESSION_FLAG_TRUE);
|
|
164 |
TESTL(mbmsConfigStatus == KErrNone);
|
|
165 |
INFO_PRINTF1(_L("MBMS get context configurations - Completed"));
|
|
166 |
}
|
|
167 |
|
|
168 |
void CTestMbmsContext::TestActivateMbmsContextL()
|
|
169 |
{
|
|
170 |
/**
|
|
171 |
* Activate MBMS context.
|
|
172 |
*/
|
|
173 |
TRequestStatus activateStatus;
|
|
174 |
iMbmsContext.Activate(activateStatus);
|
|
175 |
User::WaitForRequest(activateStatus);
|
|
176 |
TESTL(activateStatus == KErrNone);
|
|
177 |
INFO_PRINTF1(_L("MBMS context activation - Completed"));
|
|
178 |
}
|
|
179 |
|
|
180 |
void CTestMbmsContext::TestMbmsServiceStatusL()
|
|
181 |
{
|
|
182 |
/**
|
|
183 |
* Verify the status of the service being received
|
|
184 |
*/
|
|
185 |
TRequestStatus activateStatus;
|
|
186 |
RPacketMbmsContext::TContextStatus contextStatus;
|
|
187 |
iMbmsContext.NotifyStatusChange(activateStatus,contextStatus);
|
|
188 |
User::WaitForRequest(activateStatus);
|
|
189 |
TESTL(contextStatus == DPCKTTSY_CONTEXT_STATUS2);
|
|
190 |
TESTL(activateStatus == KErrNone);
|
|
191 |
INFO_PRINTF1(_L("MBMS context status notification - Completed"));
|
|
192 |
|
|
193 |
/**
|
|
194 |
* Receive notification on status change of a MBMS service
|
|
195 |
*/
|
|
196 |
TInt retStatus = iMbmsContext.GetStatus(contextStatus);
|
|
197 |
TESTL(contextStatus == DPCKTTSY_CONTEXT_STATUS1);
|
|
198 |
TESTL(retStatus == KErrNone);
|
|
199 |
INFO_PRINTF1(_L("Get MBMS context status - Completed"));
|
|
200 |
|
|
201 |
/**
|
|
202 |
* Cancel MBMS status notification on status change.
|
|
203 |
*/
|
|
204 |
iMbmsContext.NotifyStatusChange(activateStatus,contextStatus);
|
|
205 |
iMbmsContext.CancelAsyncRequest(EPacketContextNotifyStatusChange);
|
|
206 |
User::WaitForRequest(activateStatus);
|
|
207 |
TESTL( activateStatus == KErrCancel);
|
|
208 |
INFO_PRINTF1(_L("MBMS context status notification cancellation - CANCELLED"));
|
|
209 |
}
|
|
210 |
|
|
211 |
void CTestMbmsContext::TestMbmsUpdateSessionL()
|
|
212 |
{
|
|
213 |
/**
|
|
214 |
* Add MBMS session
|
|
215 |
*/
|
|
216 |
TRequestStatus sessionStatus;
|
|
217 |
TUint sessionId = DPCKTTSY_MBMS_SESSIONID_ONE;
|
|
218 |
iMbmsContext.UpdateMbmsSessionList(sessionStatus, EAddEntries, sessionId);
|
|
219 |
User::WaitForRequest(sessionStatus);
|
|
220 |
TESTL(sessionStatus == KErrNone);
|
|
221 |
INFO_PRINTF1(_L("Add MBMS session - Completed"));
|
|
222 |
|
|
223 |
/**
|
|
224 |
* Test cancelling the UpdateMbmsSessionList API
|
|
225 |
*/
|
|
226 |
TRequestStatus sessionStatusCancel;
|
|
227 |
sessionId = DPCKTTSY_MBMS_SESSIONID_ONE;
|
|
228 |
iMbmsContext.UpdateMbmsSessionList(sessionStatusCancel, EAddEntries, sessionId);
|
|
229 |
iMbmsContext.CancelAsyncRequest(EPacketContextUpdateMbmsSessionList);
|
|
230 |
User::WaitForRequest(sessionStatusCancel);
|
|
231 |
TESTL(sessionStatusCancel == KErrCancel);
|
|
232 |
INFO_PRINTF1(_L("Cancel UpdateMbmsSessionList - CANCELLED"));
|
|
233 |
|
|
234 |
/**
|
|
235 |
* Remove MBMS session
|
|
236 |
*/
|
|
237 |
iMbmsContext.UpdateMbmsSessionList(sessionStatus, ERemoveEntries, sessionId);
|
|
238 |
User::WaitForRequest(sessionStatus);
|
|
239 |
TESTL(sessionStatus == KErrNone);
|
|
240 |
INFO_PRINTF1(_L("Remove MBMS session - Completed"));
|
|
241 |
|
|
242 |
/**
|
|
243 |
* Remove an invalid MBMS session
|
|
244 |
*/
|
|
245 |
sessionId = DPCKTTSY_MBMS_SESSIONID_INVALID;
|
|
246 |
iMbmsContext.UpdateMbmsSessionList(sessionStatus, ERemoveEntries, sessionId);
|
|
247 |
User::WaitForRequest(sessionStatus);
|
|
248 |
TESTL(sessionStatus == KErrNotFound);
|
|
249 |
INFO_PRINTF1(_L("Remove invalid MBMS session - Completed"));
|
|
250 |
|
|
251 |
/**
|
|
252 |
* Remove all MBMS sessions
|
|
253 |
*/
|
|
254 |
iMbmsContext.UpdateMbmsSessionList(sessionStatus, ERemoveAllEntries);
|
|
255 |
User::WaitForRequest(sessionStatus);
|
|
256 |
TESTL(sessionStatus == KErrNone);
|
|
257 |
INFO_PRINTF1(_L("Remove all MBMS sessions - Completed"));
|
|
258 |
|
|
259 |
/**
|
|
260 |
* Remove all MBMS sessions completes with error.
|
|
261 |
*/
|
|
262 |
sessionId = DPCKTTSY_MBMS_SESSIONID_ONE;
|
|
263 |
iMbmsContext.UpdateMbmsSessionList(sessionStatus, ERemoveAllEntries, sessionId);
|
|
264 |
User::WaitForRequest(sessionStatus);
|
|
265 |
TESTL(sessionStatus == KErrMbmsImpreciseServiceEntries);
|
|
266 |
INFO_PRINTF1(_L("Failure scenario - Remove all MBMS sessions - Completed"));
|
|
267 |
}
|
|
268 |
|
|
269 |
void CTestMbmsContext::TestDeactivateMbmsContextL()
|
|
270 |
{
|
|
271 |
/**
|
|
272 |
* Deactivate a MBMS context.
|
|
273 |
*/
|
|
274 |
TRequestStatus mbmsDeactivateStatus;
|
|
275 |
iMbmsContext.Deactivate(mbmsDeactivateStatus);
|
|
276 |
User::WaitForRequest(mbmsDeactivateStatus);
|
|
277 |
TESTL(mbmsDeactivateStatus == KErrNone);
|
|
278 |
INFO_PRINTF1(_L("MBMS context deactivation - Completed"));
|
|
279 |
|
|
280 |
/**
|
|
281 |
* Delete the context
|
|
282 |
*/
|
|
283 |
TRequestStatus mbmsDeleteStatus;
|
|
284 |
iMbmsContext.Delete(mbmsDeleteStatus);
|
|
285 |
User::WaitForRequest(mbmsDeleteStatus);
|
|
286 |
TESTL(mbmsDeleteStatus == KErrNone);
|
|
287 |
INFO_PRINTF1(_L("MBMS context deleted - Completed"));
|
|
288 |
|
|
289 |
/**
|
|
290 |
* Close the context
|
|
291 |
*/
|
|
292 |
iMbmsContext.Close();
|
|
293 |
}
|
|
294 |
|
|
295 |
void CTestMbmsContext::TestInitialiseMbmsContextL()
|
|
296 |
{
|
|
297 |
/**
|
|
298 |
* Initialise MBMS context.
|
|
299 |
*/
|
|
300 |
RPacketMbmsContext::TDataChannelV2 dataChannel;
|
|
301 |
RPacketMbmsContext::TDataChannelV2Pckg dataChannelPckg(dataChannel);
|
|
302 |
TRequestStatus mbmsInitContextStatus;
|
|
303 |
iMbmsContext.InitialiseContext(mbmsInitContextStatus, dataChannelPckg);
|
|
304 |
User::WaitForRequest(mbmsInitContextStatus);
|
|
305 |
TESTL(dataChannel.iCsy == DPCKTTSY_CSY_ASYNC);
|
|
306 |
TESTL(dataChannel.iPort == DPCKTTSY_PORT_ASYNC);
|
|
307 |
TESTL(dataChannel.iChannelId == DPCKTTSY_CHANNEL_ID);
|
|
308 |
TESTL(mbmsInitContextStatus == KErrNone);
|
|
309 |
INFO_PRINTF1(_L("MBMS Initialise context - Completed"));
|
|
310 |
}
|
|
311 |
|
|
312 |
void CTestMbmsContext::TestMbmsGetSessionListL()
|
|
313 |
{
|
|
314 |
__UHEAP_MARK;
|
|
315 |
TInt ret(KErrNone);
|
|
316 |
TRequestStatus reqStatus;
|
|
317 |
TUint sessionId1=1000, sessionId2=2000, sessionId3=3000;
|
|
318 |
|
|
319 |
/**
|
|
320 |
* Test serialization
|
|
321 |
*/
|
|
322 |
RPacketMbmsContext::CMbmsSession* mbmsSession = RPacketMbmsContext::CMbmsSession::NewL();
|
|
323 |
CleanupStack::PushL(mbmsSession);
|
|
324 |
TESTL(mbmsSession->ExtensionId() == KETelExtPcktV1);
|
|
325 |
mbmsSession->iSessionIdList.Append(sessionId1);
|
|
326 |
mbmsSession->iSessionIdList.Append(sessionId2);
|
|
327 |
mbmsSession->iSessionIdList.Append(sessionId3);
|
|
328 |
HBufC8* buff = HBufC8::NewL(15);
|
|
329 |
mbmsSession->ExternalizeL(buff);
|
|
330 |
CleanupStack::PushL(buff);
|
|
331 |
RPacketMbmsContext::CMbmsSession* mbmsSessionCopy = RPacketMbmsContext::CMbmsSession::NewL();
|
|
332 |
CleanupStack::PushL(mbmsSessionCopy);
|
|
333 |
|
|
334 |
TBuf8<256> buffBig;
|
|
335 |
buffBig=*buff;
|
|
336 |
|
|
337 |
/**
|
|
338 |
* Memory overflow test for Internalize function
|
|
339 |
*/
|
|
340 |
TInt err=KErrNone;
|
|
341 |
TInt len=0;
|
|
342 |
do
|
|
343 |
{
|
|
344 |
buffBig.SetLength(len);
|
|
345 |
TRAP(err, mbmsSessionCopy->InternalizeL(buffBig));
|
|
346 |
if(err == KErrOverflow)
|
|
347 |
{
|
|
348 |
len++;
|
|
349 |
}
|
|
350 |
else
|
|
351 |
{
|
|
352 |
TESTL(err == KErrNone);
|
|
353 |
break;
|
|
354 |
}
|
|
355 |
}
|
|
356 |
while(len < 100); //just in case, set a limit to finish the loop.
|
|
357 |
TESTL(len<100);
|
|
358 |
TRAP(ret,mbmsSessionCopy->InternalizeL(buffBig));
|
|
359 |
TEST(ret==KErrNone);
|
|
360 |
TESTL(mbmsSessionCopy->iSessionIdList.Count() == mbmsSession->iSessionIdList.Count());
|
|
361 |
TESTL(mbmsSessionCopy->iSessionIdList[0] == mbmsSession->iSessionIdList[0]);
|
|
362 |
TESTL(mbmsSessionCopy->iSessionIdList[1] == mbmsSession->iSessionIdList[1]);
|
|
363 |
TESTL(mbmsSessionCopy->iSessionIdList[2] == mbmsSession->iSessionIdList[2]);
|
|
364 |
CleanupStack::PopAndDestroy(mbmsSessionCopy);
|
|
365 |
CleanupStack::PopAndDestroy(buff);
|
|
366 |
CleanupStack::PopAndDestroy(mbmsSession);
|
|
367 |
INFO_PRINTF1(_L("Test serialization of sessions - Completed"));
|
|
368 |
INFO_PRINTF1(_L("OOM test for Internalize API - Completed"));
|
|
369 |
|
|
370 |
/**
|
|
371 |
* Retrieve a list of session ids of a MBMS service
|
|
372 |
*/
|
|
373 |
RPacketMbmsContext::CMbmsSession* mbmsSession1 = RPacketMbmsContext::CMbmsSession::NewL();
|
|
374 |
CleanupStack::PushL(mbmsSession1);
|
|
375 |
CTestMbmsSession* testMbmsSession = CTestMbmsSession::NewLC(iMbmsContext,*mbmsSession1, this);
|
|
376 |
testMbmsSession->Start();
|
|
377 |
CActiveScheduler::Start();
|
|
378 |
TEST(testMbmsSession->iRetrieve != NULL);
|
|
379 |
if(testMbmsSession->iRetrieve )
|
|
380 |
{
|
|
381 |
TESTL(mbmsSession1->iSessionIdList.Count() == DPCKTTSY_MBMS_CONTEXT_SESSION_ID_COUNT);
|
|
382 |
TESTL(mbmsSession1->iSessionIdList[0] == DPCKTTSY_MBMS_CONTEXT_SESSION_ID_ONE);
|
|
383 |
TESTL(mbmsSession1->iSessionIdList[1] == DPCKTTSY_MBMS_CONTEXT_SESSION_ID_TWO);
|
|
384 |
TESTL(mbmsSession1->iSessionIdList[2] == DPCKTTSY_MBMS_CONTEXT_SESSION_ID_THREE);
|
|
385 |
}
|
|
386 |
INFO_PRINTF1(_L("Retrieve a list of sessions IDs of a MBMS service - Completed"));
|
|
387 |
|
|
388 |
/**
|
|
389 |
* Test cancellation of retrieval of sessions
|
|
390 |
*/
|
|
391 |
testMbmsSession->Start();
|
|
392 |
testMbmsSession->iCanceller->Call();
|
|
393 |
CActiveScheduler::Start();
|
|
394 |
INFO_PRINTF1(_L("Cancel retrieval of MBMS sessions - Completed"));
|
|
395 |
|
|
396 |
CleanupStack::PopAndDestroy(testMbmsSession);
|
|
397 |
CleanupStack::PopAndDestroy(mbmsSession1);
|
|
398 |
iPcktService.Close();
|
|
399 |
iPhone.Close();
|
|
400 |
__UHEAP_MARKEND;
|
|
401 |
}
|
|
402 |
//
|
|
403 |
CTestMbmsSession* CTestMbmsSession::NewLC(RPacketMbmsContext& aPcktMbmsContext,RPacketMbmsContext::CMbmsSession& aSessionIdList, CTestMbmsContext* aTestMbmsContext)
|
|
404 |
{
|
|
405 |
CTestMbmsSession* self = new(ELeave) CTestMbmsSession(aPcktMbmsContext, aSessionIdList, aTestMbmsContext);
|
|
406 |
CleanupStack::PushL(self);
|
|
407 |
self->ConstructL();
|
|
408 |
return self;
|
|
409 |
}
|
|
410 |
|
|
411 |
CTestMbmsSession::CTestMbmsSession(RPacketMbmsContext& aPcktMbmsContext, RPacketMbmsContext::CMbmsSession& aSessionIdList, CTestMbmsContext* aTestMbmsContext)
|
|
412 |
: CActive(EPriorityHigh), iSessionIdList(aSessionIdList), iPcktMbmsContext(aPcktMbmsContext), iTestMbmsContext(aTestMbmsContext)
|
|
413 |
{
|
|
414 |
}
|
|
415 |
|
|
416 |
TInt CTestMbmsSession::RunError(TInt /*aError*/)
|
|
417 |
{
|
|
418 |
return KErrNone;
|
|
419 |
}
|
|
420 |
|
|
421 |
void CTestMbmsSession::ConstructL()
|
|
422 |
{
|
|
423 |
CActiveScheduler::Add(this);
|
|
424 |
iRetrieve=CRetrievePcktMbmsSessionList::NewL(iPcktMbmsContext, iSessionIdList);
|
|
425 |
iCanceller=new (ELeave) CTestCanceller(this);
|
|
426 |
}
|
|
427 |
|
|
428 |
CTestMbmsSession::~CTestMbmsSession()
|
|
429 |
{
|
|
430 |
delete iCanceller;
|
|
431 |
delete iRetrieve;
|
|
432 |
}
|
|
433 |
|
|
434 |
void CTestMbmsSession::Start()
|
|
435 |
{
|
|
436 |
iRetrieve->Start(iStatus);
|
|
437 |
//Test the CompleteIfInUse case of Start API
|
|
438 |
TRequestStatus tmpStatus;
|
|
439 |
iRetrieve->Start(tmpStatus);
|
|
440 |
User::WaitForRequest(tmpStatus);
|
|
441 |
iTestMbmsContext->TEST(tmpStatus.Int() == KErrInUse);
|
|
442 |
SetActive();
|
|
443 |
}
|
|
444 |
|
|
445 |
void CTestMbmsSession::RunL()
|
|
446 |
{
|
|
447 |
CActiveScheduler::Stop();
|
|
448 |
}
|
|
449 |
|
|
450 |
void CTestMbmsSession::DoCancel()
|
|
451 |
{
|
|
452 |
iRetrieve->Cancel();
|
|
453 |
}
|
|
454 |
|
|
455 |
|