|
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 "cctsyucasembms020.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* CCTsyUCaseMbms020::CreateSuiteL(const TDesC& aName)
|
|
|
37 |
{
|
|
|
38 |
SUB_SUITE;
|
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms020, CCtsyIntegrationTestMbms0001L);
|
|
|
40 |
END_SUITE;
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
//
|
|
|
44 |
// Actual test cases
|
|
|
45 |
//
|
|
|
46 |
|
|
|
47 |
/**
|
|
|
48 |
* @SYMTestCaseID BA-CTSY-INT-MB-0036
|
|
|
49 |
* @SYMFssID BA/CTSY/MB-0036
|
|
|
50 |
* @SYMTestCaseDesc MBMS is currently used
|
|
|
51 |
* @SYMTestPriority High
|
|
|
52 |
* @SYMTestActions RPacketContext::InitialiseContext, RPacketContext::SetConfig, RPacketService::NotifyDynamicCapsChange, RPacketService::GetDynamicCaps, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketContext::Deactivate
|
|
|
53 |
* @SYMTestExpectedResults Pass - Client gets correct capability
|
|
|
54 |
* @SYMTestType CIT
|
|
|
55 |
* @SYMTestCaseDependencies live/manual
|
|
|
56 |
*
|
|
|
57 |
* Reason for test: Verify that client get correct capability.
|
|
|
58 |
*
|
|
|
59 |
* @return - none
|
|
|
60 |
*/
|
|
|
61 |
void CCTsyUCaseMbms020::CCtsyIntegrationTestMbms0001L()
|
|
|
62 |
{
|
|
|
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 |
TInfoName contextId;
|
|
|
78 |
RPacketMbmsContext mbmsContext;
|
|
|
79 |
mbmsContext.OpenNewContext( packetService, contextId );
|
|
|
80 |
CleanupClosePushL( mbmsContext );
|
|
|
81 |
|
|
|
82 |
RBuf8 data;
|
|
|
83 |
CleanupClosePushL(data);
|
|
|
84 |
|
|
|
85 |
RBuf8 expectData;
|
|
|
86 |
CleanupClosePushL(expectData);
|
|
|
87 |
|
|
|
88 |
// initialisation of the context
|
|
|
89 |
TInt status = InitMbmsContextL(mbmsContext, contextId);
|
|
|
90 |
ASSERT_EQUALS(KErrNone, status);
|
|
|
91 |
|
|
|
92 |
// data for SetConfig
|
|
|
93 |
TRequestStatus requestStatus;
|
|
|
94 |
RPacketMbmsContext::TContextConfigMbmsV1 setConfig;
|
|
|
95 |
setConfig.iTmgi.SetServiceId(1);
|
|
|
96 |
setConfig.iTmgi.SetMCC(111);
|
|
|
97 |
setConfig.iTmgi.SetMNC(111);
|
|
|
98 |
setConfig.iMbmsAccessBearer = E3GBearer;
|
|
|
99 |
setConfig.iMbmsServicePriority = EMbmsHighServicePriority;
|
|
|
100 |
setConfig.iMbmsServiceMode = KBroadcast;
|
|
|
101 |
setConfig.iMbmsSessionFlag = ETrue;
|
|
|
102 |
|
|
|
103 |
// configure context
|
|
|
104 |
status = SetMbmsConfigL(mbmsContext, contextId, setConfig);
|
|
|
105 |
ASSERT_EQUALS(KErrNone, status);
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
// add sessions
|
|
|
109 |
TInt maxSessions( 1 );
|
|
|
110 |
|
|
|
111 |
TMockLtsyData1 <TInfoName > expData( contextId );
|
|
|
112 |
expData.SerialiseL( expectData );
|
|
|
113 |
|
|
|
114 |
TMockLtsyData1 <TInfoName> outData( contextId );
|
|
|
115 |
outData.SerialiseL( data );
|
|
|
116 |
|
|
|
117 |
for( TInt i = 0; i < maxSessions; i++ )
|
|
|
118 |
{
|
|
|
119 |
TMbmsSessionId session(i);
|
|
|
120 |
|
|
|
121 |
iMockLTSY.ExpectL(EPacketContextUpdateMbmsSessionList, expectData);
|
|
|
122 |
iMockLTSY.CompleteL(EPacketContextUpdateMbmsSessionList, KErrNone, data);
|
|
|
123 |
mbmsContext.UpdateMbmsSessionList(requestStatus, EAddEntries, session);
|
|
|
124 |
|
|
|
125 |
User::WaitForRequest( requestStatus );
|
|
|
126 |
ASSERT_EQUALS( KErrNone, requestStatus.Int() ) ;
|
|
|
127 |
}
|
|
|
128 |
|
|
|
129 |
// Activate MBMS context
|
|
|
130 |
status = SetMbmsActiveL(mbmsContext, setConfig, contextId);
|
|
|
131 |
ASSERT_EQUALS(KErrNone, status);
|
|
|
132 |
|
|
|
133 |
RPacketService::TStatus sendStatus = RPacketService::EStatusActive;
|
|
|
134 |
TBool isResumed = EFalse;
|
|
|
135 |
TInt err = SetPacketServiceStatusL(sendStatus, isResumed);
|
|
|
136 |
ASSERT_EQUALS(KErrNone, err);
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
RPacketService::TStatus attachStatus;
|
|
|
140 |
TInt ret = packetService.GetStatus(attachStatus);
|
|
|
141 |
ASSERT_EQUALS(KErrNone, ret);
|
|
|
142 |
ASSERT_EQUALS(RPacketService::EStatusActive, attachStatus);
|
|
|
143 |
|
|
|
144 |
// Ensure MBMS Context status is Active
|
|
|
145 |
RPacketContext::TContextStatus expectedStatus = RPacketContext::EStatusActive;
|
|
|
146 |
RPacketContext::TContextStatus contextStatus;
|
|
|
147 |
ret = mbmsContext.GetStatus(contextStatus);
|
|
|
148 |
ASSERT_EQUALS(KErrNone, ret);
|
|
|
149 |
ASSERT_EQUALS((TInt)expectedStatus, (TInt)contextStatus);
|
|
|
150 |
|
|
|
151 |
// Add a session
|
|
|
152 |
CFilteringActiveScheduler scheduler;
|
|
|
153 |
CActiveScheduler::Install(&scheduler);
|
|
|
154 |
|
|
|
155 |
RPacketMbmsContext::CMbmsSession* session = RPacketMbmsContext::CMbmsSession::NewL();
|
|
|
156 |
CleanupStack::PushL(session);
|
|
|
157 |
|
|
|
158 |
CRetrievePcktMbmsSessionList* sessionList = CRetrievePcktMbmsSessionList::NewL(mbmsContext, *session);
|
|
|
159 |
CleanupStack::PushL(sessionList);
|
|
|
160 |
|
|
|
161 |
CActiveRetriever::ResetRequestsNumber();
|
|
|
162 |
CActiveRetriever retriever(*sessionList);
|
|
|
163 |
|
|
|
164 |
scheduler.AddRetrieverL(retriever);
|
|
|
165 |
|
|
|
166 |
sessionList->Start( retriever.Status() );
|
|
|
167 |
retriever.Activate();
|
|
|
168 |
scheduler.StartScheduler();
|
|
|
169 |
ASSERT_EQUALS(KErrNone, retriever.iStatus.Int());
|
|
|
170 |
|
|
|
171 |
// ensure there is session added to a MBMS context
|
|
|
172 |
for( TUint i = 0; i < session->iSessionIdList.Count(); i++)
|
|
|
173 |
{
|
|
|
174 |
TMbmsSessionId sessionId = session->iSessionIdList[i];
|
|
|
175 |
ASSERT_EQUALS( sessionId, i);
|
|
|
176 |
}
|
|
|
177 |
|
|
|
178 |
ASSERT_EQUALS(0, CActiveRetriever::ResetRequestsNumber());
|
|
|
179 |
AssertMockLtsyStatusL();
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
|
183 |
//
|
|
|
184 |
// SET UP END
|
|
|
185 |
//
|
|
|
186 |
|
|
|
187 |
//
|
|
|
188 |
// TEST START
|
|
|
189 |
//
|
|
|
190 |
|
|
|
191 |
// Network sends MBMS Notification to handset indicating MBMS service delivery about to start.
|
|
|
192 |
// post notify RPacketContext::NotifyStatusChange
|
|
|
193 |
mbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
|
194 |
|
|
|
195 |
// post RPacketService::NotifyDynamicCapsChange
|
|
|
196 |
RPacketService::TDynamicCapsFlags caps;
|
|
|
197 |
TRequestStatus dynamicCapsStatus;
|
|
|
198 |
packetService.NotifyDynamicCapsChange(dynamicCapsStatus, caps);
|
|
|
199 |
|
|
|
200 |
TContextMisc completeMisc;
|
|
|
201 |
completeMisc.iStatus = RPacketContext::EStatusReceiving;
|
|
|
202 |
TMockLtsyData2 <TInfoName, TContextMisc>ltsyData1(contextId, completeMisc);
|
|
|
203 |
ltsyData1.SerialiseL(data);
|
|
|
204 |
TRequestStatus mockLtsyStatus;
|
|
|
205 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
|
206 |
|
|
|
207 |
iMockLTSY.CompleteL(EPacketContextNotifyStatusChange , KErrNone, data);
|
|
|
208 |
User::WaitForRequest(mockLtsyStatus);
|
|
|
209 |
User::WaitForRequest(requestStatus);
|
|
|
210 |
|
|
|
211 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusReceiving
|
|
|
212 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
|
213 |
ASSERT_EQUALS(completeMisc.iStatus, contextStatus);
|
|
|
214 |
AssertMockLtsyStatusL();
|
|
|
215 |
|
|
|
216 |
// Check RPacketContext::GetStatus returns RPacketContext::EStatusReceiving
|
|
|
217 |
expectedStatus = RPacketContext::EStatusReceiving;
|
|
|
218 |
ret = mbmsContext.GetStatus(contextStatus);
|
|
|
219 |
ASSERT_EQUALS(KErrNone, ret);
|
|
|
220 |
ASSERT_EQUALS((TInt)expectedStatus, (TInt)contextStatus);
|
|
|
221 |
|
|
|
222 |
// Ensure RPacketService::NotifyDynamicCapsChange doens't return RPacketService::KCapsMBMS
|
|
|
223 |
User::WaitForRequest(dynamicCapsStatus);
|
|
|
224 |
ASSERT_EQUALS(KErrNone, dynamicCapsStatus.Int());
|
|
|
225 |
ASSERT_TRUE(RPacketService::KCapsMBMS & caps);
|
|
|
226 |
|
|
|
227 |
// Ensure GetDynamicCaps capabilities return RPacketService::KCapsMBMS caps
|
|
|
228 |
packetService.GetDynamicCaps(caps);
|
|
|
229 |
ASSERT_TRUE(RPacketService::KCapsMBMS & caps);
|
|
|
230 |
|
|
|
231 |
AssertMockLtsyStatusL();
|
|
|
232 |
|
|
|
233 |
// deactivate context
|
|
|
234 |
status = SetMbmsDeactiveL(mbmsContext, contextId);
|
|
|
235 |
ASSERT_EQUALS(KErrNone, status);
|
|
|
236 |
|
|
|
237 |
// delete context
|
|
|
238 |
status = SetMbmsDeleteL(mbmsContext, contextId);
|
|
|
239 |
ASSERT_EQUALS(KErrNone, status);
|
|
|
240 |
|
|
|
241 |
// close context
|
|
|
242 |
mbmsContext.Close( );
|
|
|
243 |
|
|
|
244 |
|
|
|
245 |
//
|
|
|
246 |
// TEST END
|
|
|
247 |
//
|
|
|
248 |
|
|
|
249 |
AssertMockLtsyStatusL();
|
|
|
250 |
CActiveScheduler::Install(NULL);
|
|
|
251 |
CleanupStack::PopAndDestroy( 7, this ); // sessionList, session, expectData, data, mbmsContext, packetService, this
|
|
|
252 |
}
|
|
|
253 |
|