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 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file The TEFUnit integration test suite for MBMS Context support in the Common TSY.
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include "cctsyucasembms022.h"
|
|
21 |
#include "cctsyactiveretriever.h"
|
|
22 |
#include <etel.h>
|
|
23 |
#include <etelmm.h>
|
|
24 |
#include <et_clsvr.h>
|
|
25 |
#include <ctsy/mmtsy_names.h>
|
|
26 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
27 |
#include "tmockltsydata.h"
|
|
28 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
29 |
|
|
30 |
#include <pcktcs.h>
|
|
31 |
#include <pcktlist.h>
|
|
32 |
#include "pcktretrieve.h"
|
|
33 |
#include "CMmCommonStaticUtility.h"
|
|
34 |
#include <ctsy/serviceapi/mmtsy_defaults.h>
|
|
35 |
|
|
36 |
CTestSuite* CCTsyUCaseMbms022::CreateSuiteL(const TDesC& aName)
|
|
37 |
{
|
|
38 |
SUB_SUITE;
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms022, CCtsyIntegrationTestMbms0001L );
|
|
40 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms022, CCtsyIntegrationTestMbms0002L );
|
|
41 |
END_SUITE;
|
|
42 |
}
|
|
43 |
|
|
44 |
//
|
|
45 |
// Actual test cases
|
|
46 |
//
|
|
47 |
|
|
48 |
/**
|
|
49 |
* @SYMTestCaseID BA-CTSY-INT-MB-0038
|
|
50 |
* @SYMFssID BA/CTSY/MB-0038
|
|
51 |
* @SYMTestCaseDesc MBMS local context Deactivation
|
|
52 |
* @SYMTestPriority High
|
|
53 |
* @SYMTestActions RPacketContext::SetConfig, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketService::EnumerateNifs, RPacketService::GetContextNameInNif, RPacketService::GetNifInfo, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate
|
|
54 |
* @SYMTestExpectedResults Pass - MBMS context deactivation succeeded.
|
|
55 |
* @SYMTestType CIT
|
|
56 |
* @SYMTestCaseDependencies live/manual
|
|
57 |
*
|
|
58 |
* Reason for test: Verify that MBMS context deactivation succeeded.
|
|
59 |
*
|
|
60 |
* @return - none
|
|
61 |
*/
|
|
62 |
void CCTsyUCaseMbms022::CCtsyIntegrationTestMbms0001L()
|
|
63 |
{
|
|
64 |
|
|
65 |
//
|
|
66 |
// SET UP
|
|
67 |
//
|
|
68 |
|
|
69 |
OpenEtelServerL( EUseExtendedError );
|
|
70 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
71 |
OpenPhoneL();
|
|
72 |
|
|
73 |
RPacketService packetService;
|
|
74 |
OpenPacketServiceL( packetService );
|
|
75 |
CleanupClosePushL( packetService );
|
|
76 |
|
|
77 |
RBuf8 expectData;
|
|
78 |
CleanupClosePushL(expectData);
|
|
79 |
|
|
80 |
RBuf8 data;
|
|
81 |
CleanupClosePushL(data);
|
|
82 |
|
|
83 |
// Open new context
|
|
84 |
TInfoName contextId;
|
|
85 |
TInfoName hostCid;
|
|
86 |
RPacketMbmsContext packetMbmsContext;
|
|
87 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
88 |
CleanupClosePushL( packetMbmsContext );
|
|
89 |
|
|
90 |
// post RPacketMbmsContext::NotifyStatusChange
|
|
91 |
TRequestStatus requestStatus;
|
|
92 |
RPacketContext::TContextStatus contextStatus;
|
|
93 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
94 |
|
|
95 |
TInt status = InitMbmsContextL(packetMbmsContext, contextId);
|
|
96 |
ASSERT_EQUALS( KErrNone, status );
|
|
97 |
|
|
98 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusInactive
|
|
99 |
User::WaitForRequest(requestStatus);
|
|
100 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
101 |
ASSERT_EQUALS(RPacketContext::EStatusInactive, contextStatus);
|
|
102 |
|
|
103 |
AssertMockLtsyStatusL();
|
|
104 |
|
|
105 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusInactive
|
|
106 |
packetMbmsContext.GetStatus(contextStatus);
|
|
107 |
ASSERT_EQUALS( RPacketContext::EStatusInactive, contextStatus );
|
|
108 |
|
|
109 |
// set configuration
|
|
110 |
RPacketMbmsContext::TContextConfigMbmsV1 setConfig;
|
|
111 |
setConfig.iMbmsAccessBearer = E2GBearer;
|
|
112 |
setConfig.iMbmsServiceMode = KBroadcast;
|
|
113 |
setConfig.iMbmsServicePriority = EMbmsLowServicePriority;
|
|
114 |
setConfig.iMbmsSessionFlag = EFalse;
|
|
115 |
|
|
116 |
status = SetMbmsConfigL(packetMbmsContext,contextId, setConfig);
|
|
117 |
ASSERT_EQUALS( KErrNone, status );
|
|
118 |
|
|
119 |
TMockLtsyData1 <TInfoName > expData( contextId );
|
|
120 |
expData.SerialiseL( expectData );
|
|
121 |
|
|
122 |
// re-post notify
|
|
123 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
124 |
|
|
125 |
// activate context
|
|
126 |
status = SetMbmsActiveL(packetMbmsContext, setConfig, contextId );
|
|
127 |
ASSERT_EQUALS( KErrNone, status );
|
|
128 |
|
|
129 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusActivating
|
|
130 |
User::WaitForRequest(requestStatus);
|
|
131 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
132 |
ASSERT_EQUALS(RPacketContext::EStatusActivating, contextStatus);
|
|
133 |
|
|
134 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusActive
|
|
135 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
136 |
User::WaitForRequest(requestStatus);
|
|
137 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
138 |
ASSERT_EQUALS(RPacketContext::EStatusActive, contextStatus);
|
|
139 |
|
|
140 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusActive
|
|
141 |
packetMbmsContext.GetStatus(contextStatus);
|
|
142 |
ASSERT_EQUALS( RPacketContext::EStatusActive, contextStatus );
|
|
143 |
|
|
144 |
// Ensure MBMS context count is greater than 0
|
|
145 |
TInt count;
|
|
146 |
TInt maxAllowed;
|
|
147 |
|
|
148 |
packetService.EnumerateMbmsActiveServiceList(requestStatus, count, maxAllowed);
|
|
149 |
User::WaitForRequest( requestStatus );
|
|
150 |
ASSERT_EQUALS(KErrNone, status);
|
|
151 |
ASSERT_TRUE(0 < count);
|
|
152 |
|
|
153 |
|
|
154 |
//
|
|
155 |
// SET UP END
|
|
156 |
//
|
|
157 |
|
|
158 |
//
|
|
159 |
// TEST START
|
|
160 |
//
|
|
161 |
|
|
162 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
163 |
|
|
164 |
// The Client requests Deactivate MBMS context (via RPacketContext) from ETEL API.
|
|
165 |
// Deactivate context
|
|
166 |
TMockLtsyData1< TInfoName > ltsyData1(contextId);
|
|
167 |
ltsyData1.SerialiseL(data);
|
|
168 |
TRequestStatus deactivateStatus;
|
|
169 |
|
|
170 |
iMockLTSY.ExpectL( EPacketContextDeactivate, data );
|
|
171 |
iMockLTSY.CompleteL(EPacketContextDeactivate, KErrNone, data);
|
|
172 |
|
|
173 |
packetMbmsContext.Deactivate( deactivateStatus );
|
|
174 |
User::WaitForRequest( deactivateStatus );
|
|
175 |
ASSERT_EQUALS(KErrNone, deactivateStatus.Int());
|
|
176 |
|
|
177 |
// CTSY completes pending NotifyStatusChange with status = EStatusDeactivating.
|
|
178 |
User::WaitForRequest(requestStatus);
|
|
179 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
180 |
ASSERT_EQUALS(RPacketContext::EStatusDeactivating, contextStatus);
|
|
181 |
|
|
182 |
// re-post notify
|
|
183 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
184 |
|
|
185 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusInactive
|
|
186 |
User::WaitForRequest(requestStatus);
|
|
187 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
188 |
ASSERT_EQUALS(RPacketContext::EStatusInactive, contextStatus);
|
|
189 |
|
|
190 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusInactive
|
|
191 |
packetMbmsContext.GetStatus(contextStatus);
|
|
192 |
ASSERT_EQUALS( RPacketContext::EStatusInactive, contextStatus );
|
|
193 |
|
|
194 |
AssertMockLtsyStatusL();
|
|
195 |
ASSERT_EQUALS(KErrNone, status);
|
|
196 |
|
|
197 |
//
|
|
198 |
// TEST END
|
|
199 |
//
|
|
200 |
|
|
201 |
AssertMockLtsyStatusL();
|
|
202 |
CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, expectData, data, this
|
|
203 |
}
|
|
204 |
|
|
205 |
|
|
206 |
/**
|
|
207 |
* @SYMTestCaseID BA-CTSY-INT-MB-0039
|
|
208 |
* @SYMFssID BA/CTSY/MB-0039
|
|
209 |
* @SYMTestCaseDesc MBMS local context Deactivation
|
|
210 |
* @SYMTestPriority High
|
|
211 |
* @SYMTestActions RPacketContext::SetConfig, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketService::EnumerateNifs, RPacketService::GetContextNameInNif, RPacketService::GetNifInfo, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate
|
|
212 |
* @SYMTestExpectedResults Pass - MBMS context deactivation fails.
|
|
213 |
* @SYMTestType CIT
|
|
214 |
* @SYMTestCaseDependencies live/manual
|
|
215 |
*
|
|
216 |
* Reason for test: Verify that MBMS context deactivation failed.
|
|
217 |
*
|
|
218 |
* @return - none
|
|
219 |
*/
|
|
220 |
void CCTsyUCaseMbms022::CCtsyIntegrationTestMbms0002L()
|
|
221 |
{
|
|
222 |
|
|
223 |
//
|
|
224 |
// SET UP
|
|
225 |
//
|
|
226 |
|
|
227 |
OpenEtelServerL( EUseExtendedError );
|
|
228 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
229 |
OpenPhoneL();
|
|
230 |
|
|
231 |
RPacketService packetService;
|
|
232 |
OpenPacketServiceL( packetService );
|
|
233 |
CleanupClosePushL( packetService );
|
|
234 |
|
|
235 |
RBuf8 expectData;
|
|
236 |
CleanupClosePushL(expectData);
|
|
237 |
|
|
238 |
RBuf8 data;
|
|
239 |
CleanupClosePushL(data);
|
|
240 |
|
|
241 |
// Open new context
|
|
242 |
TInfoName contextId;
|
|
243 |
TInfoName hostCid;
|
|
244 |
RPacketMbmsContext packetMbmsContext;
|
|
245 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
246 |
CleanupClosePushL( packetMbmsContext );
|
|
247 |
|
|
248 |
// post RPacketMbmsContext::NotifyStatusChange
|
|
249 |
TRequestStatus requestStatus;
|
|
250 |
RPacketContext::TContextStatus contextStatus;
|
|
251 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
252 |
|
|
253 |
TInt status = InitMbmsContextL(packetMbmsContext, contextId);
|
|
254 |
ASSERT_EQUALS( KErrNone, status );
|
|
255 |
|
|
256 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusInactive
|
|
257 |
User::WaitForRequest(requestStatus);
|
|
258 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
259 |
ASSERT_EQUALS(RPacketContext::EStatusInactive, contextStatus);
|
|
260 |
|
|
261 |
AssertMockLtsyStatusL();
|
|
262 |
|
|
263 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusInactive
|
|
264 |
packetMbmsContext.GetStatus(contextStatus);
|
|
265 |
ASSERT_EQUALS( RPacketContext::EStatusInactive, contextStatus );
|
|
266 |
|
|
267 |
// set configuration
|
|
268 |
RPacketMbmsContext::TContextConfigMbmsV1 setConfig;
|
|
269 |
setConfig.iMbmsAccessBearer = E2GBearer;
|
|
270 |
setConfig.iMbmsServiceMode = KBroadcast;
|
|
271 |
setConfig.iMbmsServicePriority = EMbmsLowServicePriority;
|
|
272 |
setConfig.iMbmsSessionFlag = EFalse;
|
|
273 |
|
|
274 |
status = SetMbmsConfigL(packetMbmsContext,contextId, setConfig);
|
|
275 |
ASSERT_EQUALS( KErrNone, status );
|
|
276 |
|
|
277 |
TMockLtsyData1 <TInfoName > expData( contextId );
|
|
278 |
expData.SerialiseL( expectData );
|
|
279 |
|
|
280 |
// re-post notify
|
|
281 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
282 |
|
|
283 |
// activate context
|
|
284 |
status = SetMbmsActiveL(packetMbmsContext, setConfig, contextId );
|
|
285 |
ASSERT_EQUALS( KErrNone, status );
|
|
286 |
|
|
287 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusActivating
|
|
288 |
User::WaitForRequest(requestStatus);
|
|
289 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
290 |
ASSERT_EQUALS(RPacketContext::EStatusActivating, contextStatus);
|
|
291 |
|
|
292 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusActive
|
|
293 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
294 |
User::WaitForRequest(requestStatus);
|
|
295 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
296 |
ASSERT_EQUALS(RPacketContext::EStatusActive, contextStatus);
|
|
297 |
|
|
298 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusActive
|
|
299 |
packetMbmsContext.GetStatus(contextStatus);
|
|
300 |
ASSERT_EQUALS( RPacketContext::EStatusActive, contextStatus );
|
|
301 |
|
|
302 |
// Ensure MBMS context count is greater than 0
|
|
303 |
TInt count;
|
|
304 |
TInt maxAllowed;
|
|
305 |
|
|
306 |
packetService.EnumerateMbmsActiveServiceList(requestStatus, count, maxAllowed);
|
|
307 |
User::WaitForRequest( requestStatus );
|
|
308 |
ASSERT_EQUALS(KErrNone, status);
|
|
309 |
ASSERT_TRUE(0 < count);
|
|
310 |
|
|
311 |
//
|
|
312 |
// SET UP END
|
|
313 |
//
|
|
314 |
|
|
315 |
//
|
|
316 |
// TEST START
|
|
317 |
//
|
|
318 |
|
|
319 |
|
|
320 |
// The Client requests Deactivate MBMS context (via RPacketContext) from ETEL API.
|
|
321 |
// Deactivate context
|
|
322 |
TMockLtsyData1< TInfoName > ltsyData1(contextId);
|
|
323 |
ltsyData1.SerialiseL(data);
|
|
324 |
TRequestStatus deactivateStatus;
|
|
325 |
|
|
326 |
iMockLTSY.ExpectL( EPacketContextDeactivate, data );
|
|
327 |
iMockLTSY.CompleteL(EPacketContextDeactivate, KErrGeneral, data);
|
|
328 |
|
|
329 |
packetMbmsContext.Deactivate( deactivateStatus );
|
|
330 |
User::WaitForRequest( deactivateStatus );
|
|
331 |
ASSERT_EQUALS(KErrGeneral, deactivateStatus.Int());
|
|
332 |
|
|
333 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusActive
|
|
334 |
packetMbmsContext.GetStatus(contextStatus);
|
|
335 |
ASSERT_EQUALS( RPacketContext::EStatusActive, contextStatus );
|
|
336 |
|
|
337 |
AssertMockLtsyStatusL();
|
|
338 |
|
|
339 |
//
|
|
340 |
// TEST END
|
|
341 |
//
|
|
342 |
|
|
343 |
AssertMockLtsyStatusL();
|
|
344 |
CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, expectData, data, this
|
|
345 |
}
|
|
346 |
|