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 "cctsyucasembms024.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* CCTsyUCaseMbms024::CreateSuiteL(const TDesC& aName)
|
|
37 |
{
|
|
38 |
SUB_SUITE;
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms024, CCtsyIntegrationTestMbms0001L );
|
|
40 |
END_SUITE;
|
|
41 |
}
|
|
42 |
|
|
43 |
//
|
|
44 |
// Actual test cases
|
|
45 |
//
|
|
46 |
|
|
47 |
/**
|
|
48 |
* @SYMTestCaseID BA-CTSY-INT-MB-0042
|
|
49 |
* @SYMFssID BA/CTSY/MB-0042
|
|
50 |
* @SYMTestCaseDesc MBMS local context Closure.
|
|
51 |
* @SYMTestPriority High
|
|
52 |
* @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
|
|
53 |
* @SYMTestExpectedResults Pass - MBMS context is Closed.
|
|
54 |
* @SYMTestType CIT
|
|
55 |
* @SYMTestCaseDependencies live/manual
|
|
56 |
*
|
|
57 |
* Reason for test: Verify that MBMS context is closed successfully.
|
|
58 |
*
|
|
59 |
* @return - none
|
|
60 |
*/
|
|
61 |
void CCTsyUCaseMbms024::CCtsyIntegrationTestMbms0001L()
|
|
62 |
{
|
|
63 |
|
|
64 |
//
|
|
65 |
// SET UP
|
|
66 |
//
|
|
67 |
|
|
68 |
OpenEtelServerL( EUseExtendedError );
|
|
69 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
70 |
OpenPhoneL();
|
|
71 |
|
|
72 |
RPacketService packetService;
|
|
73 |
OpenPacketServiceL( packetService );
|
|
74 |
CleanupClosePushL( packetService );
|
|
75 |
|
|
76 |
RBuf8 expectData;
|
|
77 |
CleanupClosePushL(expectData);
|
|
78 |
|
|
79 |
RBuf8 data;
|
|
80 |
CleanupClosePushL(data);
|
|
81 |
|
|
82 |
// Open new context
|
|
83 |
TInfoName contextId;
|
|
84 |
TInfoName hostCid;
|
|
85 |
RPacketMbmsContext packetMbmsContext;
|
|
86 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
87 |
CleanupClosePushL( packetMbmsContext );
|
|
88 |
|
|
89 |
// post RPacketMbmsContext::NotifyStatusChange
|
|
90 |
TRequestStatus requestStatus;
|
|
91 |
RPacketContext::TContextStatus contextStatus;
|
|
92 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
93 |
|
|
94 |
TInt status = InitMbmsContextL(packetMbmsContext, contextId);
|
|
95 |
ASSERT_EQUALS( KErrNone, status );
|
|
96 |
|
|
97 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusInactive
|
|
98 |
User::WaitForRequest(requestStatus);
|
|
99 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
100 |
ASSERT_EQUALS(RPacketContext::EStatusInactive, contextStatus);
|
|
101 |
|
|
102 |
AssertMockLtsyStatusL();
|
|
103 |
|
|
104 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusInactive
|
|
105 |
packetMbmsContext.GetStatus(contextStatus);
|
|
106 |
ASSERT_EQUALS( RPacketContext::EStatusInactive, contextStatus );
|
|
107 |
|
|
108 |
// set configuration
|
|
109 |
RPacketMbmsContext::TContextConfigMbmsV1 setConfig;
|
|
110 |
setConfig.iMbmsAccessBearer = E2GBearer;
|
|
111 |
setConfig.iMbmsServiceMode = KBroadcast;
|
|
112 |
setConfig.iMbmsServicePriority = EMbmsLowServicePriority;
|
|
113 |
setConfig.iMbmsSessionFlag = EFalse;
|
|
114 |
|
|
115 |
status = SetMbmsConfigL(packetMbmsContext,contextId, setConfig);
|
|
116 |
ASSERT_EQUALS( KErrNone, status );
|
|
117 |
|
|
118 |
TMockLtsyData1 <TInfoName > expData( contextId );
|
|
119 |
expData.SerialiseL( expectData );
|
|
120 |
|
|
121 |
// re-post notify
|
|
122 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
123 |
|
|
124 |
// activate context
|
|
125 |
status = SetMbmsActiveL(packetMbmsContext, setConfig, contextId );
|
|
126 |
ASSERT_EQUALS( KErrNone, status );
|
|
127 |
|
|
128 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusActivating
|
|
129 |
User::WaitForRequest(requestStatus);
|
|
130 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
131 |
ASSERT_EQUALS(RPacketContext::EStatusActivating, contextStatus);
|
|
132 |
|
|
133 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusActive
|
|
134 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
135 |
User::WaitForRequest(requestStatus);
|
|
136 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
137 |
ASSERT_EQUALS(RPacketContext::EStatusActive, contextStatus);
|
|
138 |
|
|
139 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusActive
|
|
140 |
packetMbmsContext.GetStatus(contextStatus);
|
|
141 |
ASSERT_EQUALS( RPacketContext::EStatusActive, contextStatus );
|
|
142 |
|
|
143 |
// Ensure MBMS context count is greater than 0
|
|
144 |
TInt count;
|
|
145 |
TInt maxAllowed;
|
|
146 |
|
|
147 |
packetService.EnumerateMbmsActiveServiceList(requestStatus, count, maxAllowed);
|
|
148 |
User::WaitForRequest( requestStatus );
|
|
149 |
ASSERT_EQUALS(KErrNone, status);
|
|
150 |
ASSERT_TRUE(0 < count);
|
|
151 |
|
|
152 |
// re-post notify
|
|
153 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
154 |
// Deactivate context
|
|
155 |
status = SetMbmsDeactiveL(packetMbmsContext, contextId);
|
|
156 |
ASSERT_EQUALS(KErrNone, status);
|
|
157 |
|
|
158 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusDeactivating
|
|
159 |
User::WaitForRequest(requestStatus);
|
|
160 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
161 |
ASSERT_EQUALS(RPacketContext::EStatusDeactivating, contextStatus);
|
|
162 |
|
|
163 |
// re-post notify
|
|
164 |
packetMbmsContext.NotifyStatusChange(requestStatus, contextStatus);
|
|
165 |
|
|
166 |
// Ensure RPacketContext::NotifyStatusChange completes MBMS context status RPacketContext::EStatusInactive
|
|
167 |
User::WaitForRequest(requestStatus);
|
|
168 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
169 |
ASSERT_EQUALS(RPacketContext::EStatusInactive, contextStatus);
|
|
170 |
|
|
171 |
// Ensure RPacketContext::GetStatus returns status RPacketContext::EStatusInactive
|
|
172 |
packetMbmsContext.GetStatus(contextStatus);
|
|
173 |
ASSERT_EQUALS( RPacketContext::EStatusInactive, contextStatus );
|
|
174 |
|
|
175 |
|
|
176 |
//
|
|
177 |
// SET UP END
|
|
178 |
//
|
|
179 |
|
|
180 |
//
|
|
181 |
// TEST START
|
|
182 |
//
|
|
183 |
|
|
184 |
// The Client requests Close MBMS context from ETEL API.
|
|
185 |
packetMbmsContext.Close( );
|
|
186 |
|
|
187 |
// Ensure MBMS context count is 0
|
|
188 |
packetService.EnumerateMbmsActiveServiceList(requestStatus, count, maxAllowed);
|
|
189 |
|
|
190 |
User::WaitForRequest( requestStatus );
|
|
191 |
ASSERT_EQUALS(KErrNone, status);
|
|
192 |
ASSERT_EQUALS(0 , count);
|
|
193 |
|
|
194 |
|
|
195 |
//
|
|
196 |
// TEST END
|
|
197 |
//
|
|
198 |
|
|
199 |
AssertMockLtsyStatusL();
|
|
200 |
|
|
201 |
CleanupStack::PopAndDestroy( 5 ); // packetMbmsContext, packetService, expectData, data, this
|
|
202 |
}
|
|
203 |
|