24
|
1 |
// Copyright (c) 2002-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 |
// This program is designed the test of the .
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "Te_SimPacket.h"
|
|
23 |
|
|
24 |
//******************************************************************************
|
|
25 |
// Context Configuration
|
|
26 |
//******************************************************************************
|
|
27 |
#define SIMTSY_PDP_TYPE1 RPacketContext::EPdpTypePPP
|
|
28 |
#define SIMTSY_ACCESS_POINT1 _L8("ACME INTERNET PROVIDERS LTD")
|
|
29 |
#define SIMTSY_PDP_ADDRESS1 _L8("i-MODE GATEWAY")
|
|
30 |
#define SIMTSY_COMPRESSION1 RPacketContext::KPdpDataCompression
|
|
31 |
#define SIMTSY_ANONYMOUS_ACCESS1 RPacketContext::ENotRequired
|
|
32 |
#define SIMTSY_EGPRS_REQUIRED TRUE
|
|
33 |
|
|
34 |
#define SIMTSY_PDP_TYPE2 RPacketContext::EPdpTypeIPv6
|
|
35 |
#define SIMTSY_ACCESS_POINT2 _L8("SYMBIAN EMPLOYEE INTRANET")
|
|
36 |
#define SIMTSY_PDP_ADDRESS2 _L8("A WAP PORTAL")
|
|
37 |
#define SIMTSY_COMPRESSION2 RPacketContext::KPdpHeaderCompression
|
|
38 |
#define SIMTSY_ANONYMOUS_ACCESS2 RPacketContext::ERequired
|
|
39 |
|
|
40 |
#define SIMTSY_CSY _L("LOOPBACK.CSY")
|
|
41 |
#define SIMTSY_PORT _L("LOOPBACK::0")
|
|
42 |
|
|
43 |
#define SIM_PACKET_SERVICE_CAPS (RPacketService::KCapsSuspendSupported | \
|
|
44 |
RPacketService::KCapsMSClassSupported |\
|
|
45 |
RPacketService::KCapsCDMA2000HighSpeedDataSupported |\
|
|
46 |
RPacketService::KCapsNetworkAvailabilitySupported | \
|
|
47 |
RPacketService::KCapsProtocolPPPSupported)
|
|
48 |
|
|
49 |
#define SIM_PACKET_SERVICE_OPTION RPacketContext::KHighSpeedCDMA2000Data
|
|
50 |
#define SIM_PACKET_PROTOCOL RPacketContext::EPdpTypePPP
|
|
51 |
#define SIM_DEFAULT_PARAM RPacketContext::KHighSpeedCDMA2000Data
|
|
52 |
|
|
53 |
// CHAP authentication
|
|
54 |
#define SIM_PACKET_CONTEXT_PROTOCOL1 RPacketContext::EProtocolCHAP
|
|
55 |
#define SIM_PACKET_CONTEXT_USERNAME1 _L8("USER1")
|
|
56 |
#define SIM_PACKET_CONTEXT_PASSWORD1 _L8("PASSWORD1")
|
|
57 |
#define SIM_PACKET_CONTEXT_CHALLENGE1 _L8("CHALLENGE1")
|
|
58 |
#define SIM_PACKET_CONTEXT_RESPONSE1 _L8("RESPONSE1")
|
|
59 |
#define SIM_PACKET_CONTEXT_PRIMARYSERVER1 _L8("PRIMARYSERVER1")
|
|
60 |
#define SIM_PACKET_CONTEXT_SECONDARYSERVER1 _L8("SECONDARYSERVER1")
|
|
61 |
#define SIM_PACKET_CONTEXT_ID1 1
|
|
62 |
|
|
63 |
// PAP authentication
|
|
64 |
#define SIM_PACKET_CONTEXT_PROTOCOL2 RPacketContext::EProtocolPAP
|
|
65 |
#define SIM_PACKET_CONTEXT_USERNAME2 _L("USER2")
|
|
66 |
#define SIM_PACKET_CONTEXT_PASSWORD2 _L("PASSWORD2")
|
|
67 |
#define SIM_PACKET_CONTEXT_CHALLENGE2 _L("NULL")
|
|
68 |
#define SIM_PACKET_CONTEXT_RESPONSE2 _L("NULL")
|
|
69 |
#define SIM_PACKET_CONTEXT_PRIMARYSERVER2 _L("PRIMARYSERVER2")
|
|
70 |
#define SIM_PACKET_CONTEXT_SECONDARYSERVER2 _L("SECONDARYSERVER2")
|
|
71 |
#define SIM_PACKET_CONTEXT_ID2 2
|
|
72 |
|
|
73 |
//MBMS information
|
|
74 |
#define SIM_PACKET_MBMS_TESTNUMBER 0
|
|
75 |
#define SIM_PACKET_MBMS_SESSIONID 2
|
|
76 |
#define SIM_PACKET_MBMS_SERVICEID 1155
|
|
77 |
#define SIM_PACKET_MBMS_MNCID 1122
|
|
78 |
#define SIM_PACKET_MBMS_MCCID 1234
|
|
79 |
|
|
80 |
//******************************************************************************
|
|
81 |
|
|
82 |
static TInt NTRasThreadFunction(TAny* /*aThreadData*/)
|
|
83 |
/**
|
|
84 |
* Does 'durty' work to start NT RAS session
|
|
85 |
* @note It sets
|
|
86 |
* iRate = EBps38400;
|
|
87 |
* iDataBits = EData8;
|
|
88 |
* iStopBits = EStop1 ;
|
|
89 |
* iParity = EParityNone;
|
|
90 |
* be sure that your NT comport has the same settings.
|
|
91 |
*/
|
|
92 |
{
|
|
93 |
_LIT(KCsyName,"LOOPBACK.CSY");
|
|
94 |
_LIT(KPortName,"LOOPBACK::1");
|
|
95 |
|
|
96 |
_LIT8(KServerText,"SERVER");
|
|
97 |
|
|
98 |
CTrapCleanup* cleanup;
|
|
99 |
if ((cleanup=CTrapCleanup::New())==NULL)
|
|
100 |
return KErrGeneral;
|
|
101 |
|
|
102 |
RCommServ commServ;
|
|
103 |
TInt r=commServ.Connect();
|
|
104 |
r=commServ.LoadCommModule(KCsyName);
|
|
105 |
if( KErrNone == r)
|
|
106 |
{
|
|
107 |
RComm comm;
|
|
108 |
r=comm.Open(commServ,KPortName,ECommShared);
|
|
109 |
if( KErrNone == r)
|
|
110 |
{
|
|
111 |
TBuf8<6> readBuf;
|
|
112 |
TRequestStatus stat0;
|
|
113 |
comm.Read(stat0,readBuf);
|
|
114 |
User::WaitForRequest(stat0) ;
|
|
115 |
|
|
116 |
comm.Write(stat0,KServerText);
|
|
117 |
User::WaitForRequest(stat0) ;
|
|
118 |
}
|
|
119 |
comm.Close() ;
|
|
120 |
}
|
|
121 |
commServ.Close() ;
|
|
122 |
delete cleanup;
|
|
123 |
return r;
|
|
124 |
}
|
|
125 |
|
|
126 |
TInt StartNTRasSimulation()
|
|
127 |
/**
|
|
128 |
* Starts virual, because of lookback serial driver,
|
|
129 |
* NT RAS session
|
|
130 |
*/
|
|
131 |
{
|
|
132 |
const TInt KStackSize=0x8000;
|
|
133 |
const TInt KHeapSize=0x8000;
|
|
134 |
const TInt KMaxHeapSize=0x80000;
|
|
135 |
TInt res = KErrNone ;
|
|
136 |
_LIT(KNtRasName,"NTRasEmulation");
|
|
137 |
|
|
138 |
RThread t;
|
|
139 |
res=t.Create(KNtRasName,NTRasThreadFunction,
|
|
140 |
KStackSize,KHeapSize,KMaxHeapSize,NULL);
|
|
141 |
t.Resume();
|
|
142 |
t.Close();
|
|
143 |
|
|
144 |
return res;
|
|
145 |
}
|
|
146 |
|
|
147 |
//------------------------------------------------------------------
|
|
148 |
// ** TEST SimPacket STEPS ***
|
|
149 |
|
|
150 |
//------------------------------------------------------------------
|
|
151 |
|
|
152 |
CGprsDefaultContextParamsTest::CGprsDefaultContextParamsTest()
|
|
153 |
/** Each test step initialises it's own name
|
|
154 |
*/
|
|
155 |
{
|
|
156 |
// store the name of this test case
|
|
157 |
// this is the name that is used by the script file
|
|
158 |
SetTestStepName(_L("GprsDefaultContextParamsTest"));
|
|
159 |
}
|
|
160 |
//------------------------------------------------------------------
|
|
161 |
|
|
162 |
TVerdict CGprsDefaultContextParamsTest::doTestStepL( void )
|
|
163 |
/**
|
|
164 |
* This tests the default context params
|
|
165 |
*/
|
|
166 |
{
|
|
167 |
SetSimtsyTestNumberL(0);
|
|
168 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
169 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
170 |
|
|
171 |
// Some default params to set, does not matter what it is.
|
|
172 |
// The default params used are defined at the beginning of this file
|
|
173 |
|
|
174 |
TESTL(iPacketService.Open(iPhone) == KErrNone);
|
|
175 |
|
|
176 |
RPacketContext::TContextConfigGPRS setDefaultParams;
|
|
177 |
TPckg<RPacketContext::TContextConfigGPRS> setcontextConfigPckg(setDefaultParams);
|
|
178 |
|
|
179 |
setDefaultParams.iPdpType = SIMTSY_PDP_TYPE1;
|
|
180 |
setDefaultParams.iAccessPointName = SIMTSY_ACCESS_POINT1;
|
|
181 |
setDefaultParams.iPdpAddress = SIMTSY_PDP_ADDRESS1;
|
|
182 |
setDefaultParams.iPdpCompression = SIMTSY_COMPRESSION1;
|
|
183 |
setDefaultParams.iAnonymousAccessReqd = SIMTSY_ANONYMOUS_ACCESS1;
|
|
184 |
setDefaultParams.iUseEdge = SIMTSY_EGPRS_REQUIRED;
|
|
185 |
setDefaultParams.iProtocolConfigOption.iAuthInfo.iProtocol = SIM_PACKET_CONTEXT_PROTOCOL1;
|
|
186 |
setDefaultParams.iProtocolConfigOption.iAuthInfo.iUsername = SIM_PACKET_CONTEXT_USERNAME1;
|
|
187 |
setDefaultParams.iProtocolConfigOption.iAuthInfo.iPassword = SIM_PACKET_CONTEXT_PASSWORD1;
|
|
188 |
setDefaultParams.iProtocolConfigOption.iChallenge = SIM_PACKET_CONTEXT_CHALLENGE1;
|
|
189 |
setDefaultParams.iProtocolConfigOption.iResponse = SIM_PACKET_CONTEXT_RESPONSE1;
|
|
190 |
setDefaultParams.iProtocolConfigOption.iDnsAddresses.iPrimaryDns = SIM_PACKET_CONTEXT_PRIMARYSERVER1;
|
|
191 |
setDefaultParams.iProtocolConfigOption.iDnsAddresses.iSecondaryDns = SIM_PACKET_CONTEXT_SECONDARYSERVER1;
|
|
192 |
setDefaultParams.iProtocolConfigOption.iId = SIM_PACKET_CONTEXT_ID1;
|
|
193 |
|
|
194 |
TESTL(iPacketService.SetDefaultContextParams(setcontextConfigPckg) == KErrNone);
|
|
195 |
|
|
196 |
RPacketContext::TContextConfigGPRS getDefaultParams;
|
|
197 |
TPckg<RPacketContext::TContextConfigGPRS> getcontextConfigPckg(getDefaultParams);
|
|
198 |
|
|
199 |
TESTL(iPacketService.GetDefaultContextParams(getcontextConfigPckg) == KErrNone);
|
|
200 |
TestConfigParamsL(setDefaultParams, getDefaultParams);
|
|
201 |
|
|
202 |
iPacketService.Close();
|
|
203 |
iPhone.Close();
|
|
204 |
User::After(100000L);
|
|
205 |
return TestStepResult();
|
|
206 |
}
|
|
207 |
//------------------------------------------------------------------
|
|
208 |
|
|
209 |
CQoSTest::CQoSTest()
|
|
210 |
/** Each test step initialises it's own name
|
|
211 |
*/
|
|
212 |
{
|
|
213 |
// store the name of this test case
|
|
214 |
// this is the name that is used by the script file
|
|
215 |
SetTestStepName(_L("QoSTest"));
|
|
216 |
}
|
|
217 |
//------------------------------------------------------------------
|
|
218 |
|
|
219 |
TVerdict CQoSTest::doTestStepL( void )
|
|
220 |
/**
|
|
221 |
* This tests the static GPRS caps.
|
|
222 |
*/
|
|
223 |
{
|
|
224 |
SetSimtsyTestNumberL(0);
|
|
225 |
TBuf<30> contextName;
|
|
226 |
TBuf<30> profileName;
|
|
227 |
TRequestStatus stat1;
|
|
228 |
TRequestStatus stat2;
|
|
229 |
RPacketQoS qoS;
|
|
230 |
RPacketQoS::TQoSCapsGPRS staticQoSCaps;
|
|
231 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
232 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
233 |
|
|
234 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
235 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
236 |
qoS.OpenNewQoS(iPacketContext[0], profileName);
|
|
237 |
|
|
238 |
TPckg<RPacketQoS::TQoSCapsGPRS> staticQoSCapsPkg(staticQoSCaps);
|
|
239 |
qoS.GetProfileCapabilities(stat1, staticQoSCapsPkg);
|
|
240 |
User::WaitForRequest(stat1);
|
|
241 |
TESTL(stat1.Int() == KErrNone);
|
|
242 |
TESTL(staticQoSCaps.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
|
|
243 |
|
|
244 |
TESTL(staticQoSCaps.iPrecedence == RPacketQoS::EPriorityMediumPrecedence);
|
|
245 |
TESTL(staticQoSCaps.iDelay == RPacketQoS::EDelayClass2 );
|
|
246 |
TESTL(staticQoSCaps.iReliability == RPacketQoS::EReliabilityClass2);
|
|
247 |
TESTL(staticQoSCaps.iPeak == RPacketQoS::EPeakThroughput64000);
|
|
248 |
TESTL(staticQoSCaps.iMean == RPacketQoS::EMeanThroughput100);
|
|
249 |
|
|
250 |
RPacketQoS::TQoSGPRSNegotiated negotiatedQoS;
|
|
251 |
RPacketQoS::TQoSGPRSRequested SetQoS;
|
|
252 |
RPacketQoS::TQoSGPRSNegotiated comparenegotiatedQoS;
|
|
253 |
RPacketQoS::TQoSGPRSRequested notifyQoS;
|
|
254 |
// Setting to Best effort.
|
|
255 |
comparenegotiatedQoS.iPrecedence = RPacketQoS::EPriorityMediumPrecedence;
|
|
256 |
comparenegotiatedQoS.iDelay = RPacketQoS::EDelayClass2;
|
|
257 |
comparenegotiatedQoS.iReliability = RPacketQoS::EReliabilityClass2;
|
|
258 |
comparenegotiatedQoS.iPeakThroughput = RPacketQoS::EPeakThroughput64000;
|
|
259 |
comparenegotiatedQoS.iMeanThroughput = RPacketQoS::EMeanThroughput100;
|
|
260 |
TPckg<RPacketQoS::TQoSGPRSNegotiated> negotiatedQoSPkg(negotiatedQoS);
|
|
261 |
qoS.GetProfileParameters(stat1, negotiatedQoSPkg);
|
|
262 |
User::WaitForRequest(stat1);
|
|
263 |
TESTL(stat1.Int() == KErrNone);
|
|
264 |
TestConfigParamsL(negotiatedQoS, comparenegotiatedQoS);
|
|
265 |
|
|
266 |
// Set to anything just to test that it can be done..
|
|
267 |
SetQoS.iReqPrecedence = RPacketQoS::EPriorityMediumPrecedence;
|
|
268 |
SetQoS.iMinPrecedence = RPacketQoS::EPriorityLowPrecedence;
|
|
269 |
SetQoS.iReqDelay = RPacketQoS::EDelayClass2;
|
|
270 |
SetQoS.iMinDelay = RPacketQoS::EDelayClass1;
|
|
271 |
SetQoS.iReqReliability = RPacketQoS::EReliabilityClass2;
|
|
272 |
SetQoS.iMinReliability = RPacketQoS::EReliabilityClass1;
|
|
273 |
SetQoS.iReqPeakThroughput = RPacketQoS::EPeakThroughput64000;
|
|
274 |
SetQoS.iMinPeakThroughput = RPacketQoS::EPeakThroughput16000;
|
|
275 |
SetQoS.iReqMeanThroughput = RPacketQoS::EMeanThroughput2000;
|
|
276 |
SetQoS.iMinMeanThroughput = RPacketQoS::EMeanThroughput200;
|
|
277 |
|
|
278 |
|
|
279 |
TPckg<RPacketQoS::TQoSGPRSRequested> SetQoSPkg(SetQoS);
|
|
280 |
TPckg<RPacketQoS::TQoSGPRSRequested> notifyQoSPkg(notifyQoS);
|
|
281 |
qoS.NotifyProfileChanged(stat2, notifyQoSPkg);
|
|
282 |
qoS.SetProfileParameters(stat1, SetQoSPkg);
|
|
283 |
User::WaitForRequest(stat2);
|
|
284 |
User::WaitForRequest(stat1);
|
|
285 |
TESTL(stat2.Int() == KErrNone);
|
|
286 |
TESTL(stat1.Int() == KErrNone);
|
|
287 |
|
|
288 |
qoS.Close();
|
|
289 |
iPacketContext[0].Close();
|
|
290 |
iPacketService.Close();
|
|
291 |
iPhone.Close();
|
|
292 |
return TestStepResult();
|
|
293 |
}
|
|
294 |
//------------------------------------------------------------------
|
|
295 |
|
|
296 |
CGprsUnSupportedTest::CGprsUnSupportedTest()
|
|
297 |
/** Each test step initialises it's own name
|
|
298 |
*/
|
|
299 |
{
|
|
300 |
// store the name of this test case
|
|
301 |
// this is the name that is used by the script file
|
|
302 |
SetTestStepName(_L("GprsUnSupportedTest"));
|
|
303 |
}
|
|
304 |
//------------------------------------------------------------------
|
|
305 |
|
|
306 |
TVerdict CGprsUnSupportedTest::doTestStepL( void )
|
|
307 |
/**
|
|
308 |
* Tests all unsupported GPRS API calls to the TSY.
|
|
309 |
*/
|
|
310 |
{
|
|
311 |
SetSimtsyTestNumberL(0);
|
|
312 |
TRequestStatus stat1;
|
|
313 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
314 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
315 |
|
|
316 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
317 |
iPacketService.RejectActivationRequest(stat1);
|
|
318 |
User::WaitForRequest(stat1);
|
|
319 |
TESTL(stat1.Int()== KErrNotSupported);
|
|
320 |
|
|
321 |
iPacketService.RejectActivationRequest(stat1);
|
|
322 |
iPacketService.CancelAsyncRequest(EPacketRejectActivationRequest);
|
|
323 |
User::WaitForRequest(stat1);
|
|
324 |
TESTL(stat1.Int() == KErrNotSupported);
|
|
325 |
|
|
326 |
RPacketService::TMSClass msClass;
|
|
327 |
iPacketService.NotifyMSClassChange(stat1, msClass);
|
|
328 |
User::WaitForRequest(stat1);
|
|
329 |
TESTL(stat1.Int() == KErrNotSupported);
|
|
330 |
|
|
331 |
RPacketService::TAttachMode attachMode = RPacketService::EAttachWhenPossible;
|
|
332 |
TESTL(iPacketService.SetAttachMode(attachMode) == KErrNotSupported);
|
|
333 |
TESTL(iPacketService.GetAttachMode(attachMode) == KErrNone);
|
|
334 |
RPacketService::TRegistrationStatus registrationStatus = RPacketService::ERegisteredRoaming;
|
|
335 |
iPacketService.GetNtwkRegStatus(stat1, registrationStatus);
|
|
336 |
User::WaitForRequest(stat1);
|
|
337 |
TESTL(stat1.Int() == KErrNone);
|
|
338 |
/* //This test should not be here as this method is supported
|
|
339 |
iPacketService.NotifyChangeOfNtwkRegStatus(stat1, registrationStatus);
|
|
340 |
User::WaitForRequest(stat1);
|
|
341 |
TESTL(stat1.Int() == KErrNotSupported);
|
|
342 |
*/
|
|
343 |
iPacketService.Close();
|
|
344 |
iPhone.Close();
|
|
345 |
return TestStepResult();
|
|
346 |
}
|
|
347 |
|
|
348 |
/** Each test step initialises its own name
|
|
349 |
*/
|
|
350 |
CTestDynamicCaps::CTestDynamicCaps()
|
|
351 |
{
|
|
352 |
// store the name of this test case
|
|
353 |
// this is the name that is used by the script file
|
|
354 |
SetTestStepName(_L("TestDynamicCaps"));
|
|
355 |
}
|
|
356 |
|
|
357 |
/**
|
|
358 |
* Tests the dynamic capabilities APIs: RPacketService::GetDynamicCaps and RPacketService::NotifyDynamicCapsChange
|
|
359 |
* @return Test step verdict.
|
|
360 |
*/
|
|
361 |
TVerdict CTestDynamicCaps::doTestStepL()
|
|
362 |
{
|
|
363 |
SetSimtsyTestNumberL(0);
|
|
364 |
|
|
365 |
// Initialise and open the packet service...
|
|
366 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
367 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
368 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
369 |
|
|
370 |
//
|
|
371 |
// test GetDynamicCaps
|
|
372 |
//
|
|
373 |
RPacketService::TDynamicCapsFlags dynCapsFlags;
|
|
374 |
TEST(iPacketService.GetDynamicCaps(dynCapsFlags) == KErrNone);
|
|
375 |
TEST(dynCapsFlags == RPacketService::KCapsEGPRS);
|
|
376 |
|
|
377 |
//
|
|
378 |
// test NotifyDynamicCapsChange
|
|
379 |
//
|
|
380 |
TRequestStatus requestStatus;
|
|
381 |
dynCapsFlags = 0;
|
|
382 |
iPacketService.NotifyDynamicCapsChange(requestStatus, dynCapsFlags);
|
|
383 |
User::WaitForRequest(requestStatus);
|
|
384 |
TEST(requestStatus == KErrNone);
|
|
385 |
TEST(dynCapsFlags == RPacketService::KCapsHSDPA);
|
|
386 |
|
|
387 |
//
|
|
388 |
// test cancellation of NotifyDynamicCapsChange
|
|
389 |
//
|
|
390 |
iPacketService.NotifyDynamicCapsChange(requestStatus, dynCapsFlags);
|
|
391 |
iPacketService.CancelAsyncRequest(EPacketNotifyDynamicCapsChange);
|
|
392 |
User::WaitForRequest(requestStatus);
|
|
393 |
TEST(requestStatus == KErrCancel);
|
|
394 |
|
|
395 |
iPacketService.Close();
|
|
396 |
iPhone.Close();
|
|
397 |
return TestStepResult();
|
|
398 |
}
|
|
399 |
|
|
400 |
//------------------------------------------------------------------
|
|
401 |
|
|
402 |
CGprsContextAttachTest::CGprsContextAttachTest()
|
|
403 |
/** Each test step initialises it's own name
|
|
404 |
*/
|
|
405 |
{
|
|
406 |
// store the name of this test case
|
|
407 |
// this is the name that is used by the script file
|
|
408 |
SetTestStepName(_L("GprsContextAttachTest"));
|
|
409 |
}
|
|
410 |
//------------------------------------------------------------------
|
|
411 |
|
|
412 |
TVerdict CGprsContextAttachTest::doTestStepL( void )
|
|
413 |
/**
|
|
414 |
* This tests the context attach and detach
|
|
415 |
*/
|
|
416 |
{
|
|
417 |
SetSimtsyTestNumberL(0);
|
|
418 |
TRequestStatus stat1;
|
|
419 |
TRequestStatus stat2;
|
|
420 |
TBuf<50> contextName;
|
|
421 |
RPacketContext::TContextStatus contextStatus;
|
|
422 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
423 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
424 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
425 |
StartNTRasSimulation() ;
|
|
426 |
|
|
427 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
428 |
|
|
429 |
iPacketContext[0].NotifyStatusChange(stat1, contextStatus);
|
|
430 |
iPacketContext[0].CancelAsyncRequest(EPacketContextNotifyStatusChange);
|
|
431 |
User::WaitForRequest(stat1);
|
|
432 |
TESTL(stat1.Int() == KErrCancel);
|
|
433 |
|
|
434 |
iPacketContext[0].NotifyStatusChange(stat1, contextStatus);
|
|
435 |
iPacketContext[0].Activate(stat2);
|
|
436 |
|
|
437 |
User::WaitForRequest(stat1);
|
|
438 |
TESTL(stat1.Int() == KErrNone);
|
|
439 |
TESTL(contextStatus == RPacketContext::EStatusActivating);
|
|
440 |
|
|
441 |
iPacketContext[0].NotifyStatusChange(stat1, contextStatus);
|
|
442 |
User::WaitForRequest(stat2);
|
|
443 |
TESTL(stat2.Int()== KErrNone);
|
|
444 |
|
|
445 |
User::WaitForRequest(stat1);
|
|
446 |
TESTL(stat1.Int() == KErrNone);
|
|
447 |
TESTL(contextStatus == RPacketContext::EStatusActive);
|
|
448 |
|
|
449 |
iPacketContext[0].NotifyStatusChange(stat1, contextStatus);
|
|
450 |
|
|
451 |
// need a few seconds between activating and deactivating - allow NTRAS server to respond
|
|
452 |
User::After(100000L);
|
|
453 |
iPacketContext[0].Deactivate(stat2);
|
|
454 |
User::WaitForRequest(stat1);
|
|
455 |
TESTL(stat1.Int() == KErrNone);
|
|
456 |
TESTL(contextStatus == RPacketContext::EStatusDeactivating);
|
|
457 |
|
|
458 |
iPacketContext[0].NotifyStatusChange(stat1, contextStatus);
|
|
459 |
User::WaitForRequest(stat2);
|
|
460 |
TESTL(stat2.Int() == KErrNone);
|
|
461 |
|
|
462 |
User::WaitForRequest(stat1);
|
|
463 |
TESTL(stat1.Int() == KErrNone);
|
|
464 |
TESTL(contextStatus == RPacketContext::EStatusInactive);
|
|
465 |
|
|
466 |
iPacketContext[0].Close();
|
|
467 |
iPacketService.Close();
|
|
468 |
iPhone.Close();
|
|
469 |
return TestStepResult();
|
|
470 |
}
|
|
471 |
//------------------------------------------------------------------
|
|
472 |
|
|
473 |
CGprsContextDeleteTest::CGprsContextDeleteTest()
|
|
474 |
/** Each test step initialises it's own name
|
|
475 |
*/
|
|
476 |
{
|
|
477 |
// store the name of this test case
|
|
478 |
// this is the name that is used by the script file
|
|
479 |
SetTestStepName(_L("GprsContextDeleteTest"));
|
|
480 |
}
|
|
481 |
//------------------------------------------------------------------
|
|
482 |
|
|
483 |
TVerdict CGprsContextDeleteTest::doTestStepL( void )
|
|
484 |
/**
|
|
485 |
* This tests the context delete.
|
|
486 |
*/
|
|
487 |
{
|
|
488 |
SetSimtsyTestNumberL(0);
|
|
489 |
TRequestStatus stat1;
|
|
490 |
TBuf<30> contextName;
|
|
491 |
RPacketContext::TContextStatus contextStatus;
|
|
492 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
493 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
494 |
|
|
495 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
496 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
497 |
|
|
498 |
iPacketContext[0].Delete(stat1);
|
|
499 |
User::WaitForRequest(stat1);
|
|
500 |
TESTL(stat1.Int() == KErrNone);
|
|
501 |
|
|
502 |
iPacketContext[0].Activate(stat1);
|
|
503 |
User::WaitForRequest(stat1);
|
|
504 |
|
|
505 |
TESTL(stat1.Int() == KErrNotReady);
|
|
506 |
TESTL(iPacketContext[0].GetStatus(contextStatus) == KErrNone);
|
|
507 |
TESTL(contextStatus == RPacketContext::EStatusDeleted);
|
|
508 |
|
|
509 |
iPacketContext[0].Close();
|
|
510 |
iPacketService.Close();
|
|
511 |
iPhone.Close();
|
|
512 |
return TestStepResult();
|
|
513 |
}
|
|
514 |
//------------------------------------------------------------------
|
|
515 |
|
|
516 |
CGprsContextLoanComport::CGprsContextLoanComport()
|
|
517 |
/** Each test step initialises it's own name
|
|
518 |
*/
|
|
519 |
{
|
|
520 |
// store the name of this test case
|
|
521 |
// this is the name that is used by the script file
|
|
522 |
SetTestStepName(_L("GprsContextLoanComport"));
|
|
523 |
}
|
|
524 |
//------------------------------------------------------------------
|
|
525 |
|
|
526 |
TVerdict CGprsContextLoanComport::doTestStepL( void )
|
|
527 |
/**
|
|
528 |
* This tests the comport loan.
|
|
529 |
*/
|
|
530 |
{
|
|
531 |
SetSimtsyTestNumberL(0);
|
|
532 |
TRequestStatus stat1;
|
|
533 |
TBuf<30> contextName;
|
|
534 |
RCall::TCommPort dataPort;
|
|
535 |
StartNTRasSimulation() ;
|
|
536 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
537 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
538 |
|
|
539 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
540 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
541 |
|
|
542 |
iPacketContext[0].RecoverCommPort(stat1);
|
|
543 |
User::WaitForRequest(stat1);
|
|
544 |
TESTL(stat1.Int() == KErrEtelPortNotLoanedToClient);
|
|
545 |
|
|
546 |
//!!!!
|
|
547 |
iPacketContext[0].LoanCommPort(stat1, dataPort);
|
|
548 |
User::WaitForRequest(stat1);
|
|
549 |
TESTL(stat1.Int() == KErrEtelCallNotActive);
|
|
550 |
|
|
551 |
iPacketContext[0].Activate(stat1);
|
|
552 |
User::WaitForRequest(stat1);
|
|
553 |
TESTL(stat1.Int() == KErrNone);
|
|
554 |
|
|
555 |
iPacketContext[0].LoanCommPort(stat1, dataPort);
|
|
556 |
User::WaitForRequest(stat1);
|
|
557 |
TESTL(stat1.Int() == KErrNone);
|
|
558 |
|
|
559 |
iPacketContext[0].Activate(stat1);
|
|
560 |
User::WaitForRequest(stat1);
|
|
561 |
TESTL(stat1.Int() == KErrEtelCallAlreadyActive);
|
|
562 |
|
|
563 |
iPacketContext[0].RecoverCommPort(stat1);
|
|
564 |
User::WaitForRequest(stat1);
|
|
565 |
TESTL(stat1.Int() == KErrNone);
|
|
566 |
|
|
567 |
iPacketContext[0].Deactivate(stat1);
|
|
568 |
User::WaitForRequest(stat1);
|
|
569 |
TESTL(stat1.Int() == KErrNone);
|
|
570 |
|
|
571 |
iPacketContext[0].Close();
|
|
572 |
iPacketService.Close();
|
|
573 |
iPhone.Close();
|
|
574 |
return TestStepResult();
|
|
575 |
}
|
|
576 |
//------------------------------------------------------------------
|
|
577 |
|
|
578 |
CGprsContextUnSupportedTest::CGprsContextUnSupportedTest()
|
|
579 |
/** Each test step initialises it's own name
|
|
580 |
*/
|
|
581 |
{
|
|
582 |
// store the name of this test case
|
|
583 |
// this is the name that is used by the script file
|
|
584 |
SetTestStepName(_L("GprsContextUnSupportedTest"));
|
|
585 |
}
|
|
586 |
//------------------------------------------------------------------
|
|
587 |
|
|
588 |
TVerdict CGprsContextUnSupportedTest::doTestStepL( void )
|
|
589 |
/**
|
|
590 |
* This tests all GPRS context API calls.
|
|
591 |
*/
|
|
592 |
{
|
|
593 |
SetSimtsyTestNumberL(0);
|
|
594 |
TRequestStatus stat1;
|
|
595 |
TBuf<30> contextName;
|
|
596 |
RPacketContext::TDataVolume volume;
|
|
597 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
598 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
599 |
|
|
600 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
601 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
602 |
|
|
603 |
TESTL(iPacketContext[0].GetDataVolumeTransferred(volume) == KErrNotSupported);
|
|
604 |
iPacketContext[0].NotifyDataTransferred(stat1, volume);
|
|
605 |
User::WaitForRequest(stat1);
|
|
606 |
TESTL(stat1.Int() == KErrNotSupported);
|
|
607 |
|
|
608 |
iPacketContext[0].Close();
|
|
609 |
iPacketService.Close();
|
|
610 |
iPhone.Close();
|
|
611 |
return TestStepResult();
|
|
612 |
}
|
|
613 |
//------------------------------------------------------------------
|
|
614 |
|
|
615 |
CGprsCancelTest::CGprsCancelTest()
|
|
616 |
/** Each test step initialises it's own name
|
|
617 |
*/
|
|
618 |
{
|
|
619 |
// store the name of this test case
|
|
620 |
// this is the name that is used by the script file
|
|
621 |
SetTestStepName(_L("GprsCancelTest"));
|
|
622 |
}
|
|
623 |
//------------------------------------------------------------------
|
|
624 |
|
|
625 |
TVerdict CGprsCancelTest::doTestStepL( void )
|
|
626 |
/**
|
|
627 |
* This test will call all GPRS API calls
|
|
628 |
* that can be canceled with an outstanding request
|
|
629 |
* to the phone.
|
|
630 |
*/
|
|
631 |
{
|
|
632 |
SetSimtsyTestNumberL(0);
|
|
633 |
TRequestStatus stat;
|
|
634 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
635 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
636 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
637 |
|
|
638 |
iPacketService.Attach(stat);
|
|
639 |
iPacketService.CancelAsyncRequest(EPacketAttach);
|
|
640 |
User::WaitForRequest(stat);
|
|
641 |
TESTL((stat.Int() == KErrCancel) || (stat.Int() == KErrNone));
|
|
642 |
|
|
643 |
iPacketService.Detach(stat);
|
|
644 |
iPacketService.CancelAsyncRequest(EPacketDetach);
|
|
645 |
User::WaitForRequest(stat);
|
|
646 |
TESTL((stat.Int() == KErrCancel)||(stat.Int() == KErrNone));
|
|
647 |
|
|
648 |
RPacketService::TMSClass currentClass;
|
|
649 |
RPacketService::TMSClass maxClass;
|
|
650 |
|
|
651 |
iPacketService.GetMSClass(stat, currentClass, maxClass);
|
|
652 |
iPacketService.CancelAsyncRequest(EPacketGetMSClass);
|
|
653 |
User::WaitForRequest(stat);
|
|
654 |
TESTL((stat.Int() == KErrCancel)||(stat.Int() == KErrNone));
|
|
655 |
|
|
656 |
currentClass = RPacketService::EMSClassSuspensionRequired;
|
|
657 |
iPacketService.SetMSClass(stat, currentClass);
|
|
658 |
iPacketService.CancelAsyncRequest(EPacketSetMSClass);
|
|
659 |
User::WaitForRequest(stat);
|
|
660 |
TESTL((stat.Int() == KErrCancel)||(stat.Int() == KErrNone));
|
|
661 |
|
|
662 |
iPacketService.Close();
|
|
663 |
iPhone.Close();
|
|
664 |
return TestStepResult();
|
|
665 |
}
|
|
666 |
//------------------------------------------------------------------
|
|
667 |
|
|
668 |
CGprsAttachTest::CGprsAttachTest()
|
|
669 |
/** Each test step initialises it's own name
|
|
670 |
*/
|
|
671 |
{
|
|
672 |
// store the name of this test case
|
|
673 |
// this is the name that is used by the script file
|
|
674 |
SetTestStepName(_L("GprsAttachTest"));
|
|
675 |
}
|
|
676 |
//------------------------------------------------------------------
|
|
677 |
|
|
678 |
TVerdict CGprsAttachTest::doTestStepL( void )
|
|
679 |
/**
|
|
680 |
* This tests the attach and detach.
|
|
681 |
*/
|
|
682 |
{
|
|
683 |
SetSimtsyTestNumberL(0);
|
|
684 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
685 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
686 |
TRequestStatus stat1;
|
|
687 |
RPacketService::TStatus status;
|
|
688 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
689 |
iPacketService.Attach(stat1);
|
|
690 |
User::WaitForRequest(stat1);
|
|
691 |
TESTL(stat1.Int() == KErrNone);
|
|
692 |
iPacketService.GetStatus(status);
|
|
693 |
TESTL(status == RPacketService::EStatusAttached);
|
|
694 |
iPacketService.Detach(stat1);
|
|
695 |
User::WaitForRequest(stat1);
|
|
696 |
TESTL(stat1.Int() == KErrNone);
|
|
697 |
iPacketService.GetStatus(status);
|
|
698 |
TESTL(status == RPacketService::EStatusUnattached);
|
|
699 |
iPacketService.Close();
|
|
700 |
iPhone.Close();
|
|
701 |
return TestStepResult();
|
|
702 |
}
|
|
703 |
//------------------------------------------------------------------
|
|
704 |
|
|
705 |
CGprsNotificationTest::CGprsNotificationTest()
|
|
706 |
/** Each test step initialises it's own name
|
|
707 |
*/
|
|
708 |
{
|
|
709 |
// store the name of this test case
|
|
710 |
// this is the name that is used by the script file
|
|
711 |
SetTestStepName(_L("GprsNotificationTest"));
|
|
712 |
}
|
|
713 |
//------------------------------------------------------------------
|
|
714 |
|
|
715 |
TVerdict CGprsNotificationTest::doTestStepL( void )
|
|
716 |
/**
|
|
717 |
* Tests Notify Context added, Tests Notify status
|
|
718 |
*/
|
|
719 |
{
|
|
720 |
SetSimtsyTestNumberL(1);
|
|
721 |
TRequestStatus stat1,stat2,stat3;
|
|
722 |
TBuf<20> context= _L("");
|
|
723 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
724 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
725 |
|
|
726 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
727 |
TBuf<40> contextId;
|
|
728 |
|
|
729 |
iPacketService.NotifyContextAdded(stat1, contextId);
|
|
730 |
iPacketService.CancelAsyncRequest(EPacketNotifyContextAdded);
|
|
731 |
User::WaitForRequest(stat1);
|
|
732 |
TESTL(stat1.Int()== KErrCancel);
|
|
733 |
iPacketService.NotifyContextAdded(stat1, contextId);
|
|
734 |
|
|
735 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, context) == KErrNone);
|
|
736 |
User::WaitForRequest(stat1);
|
|
737 |
TESTL(stat1.Int() == KErrNone);
|
|
738 |
|
|
739 |
RPacketService::TStatus gprsStatus;
|
|
740 |
iPacketService.NotifyStatusChange(stat2, gprsStatus);
|
|
741 |
iPacketService.CancelAsyncRequest(EPacketNotifyStatusChange);
|
|
742 |
User::WaitForRequest(stat2);
|
|
743 |
TESTL(stat2.Int() == KErrCancel);
|
|
744 |
|
|
745 |
iPacketService.NotifyStatusChange(stat2, gprsStatus);
|
|
746 |
iPacketService.Attach(stat1);
|
|
747 |
User::WaitForRequest(stat1);
|
|
748 |
TESTL(stat1.Int() == KErrNone);
|
|
749 |
User::WaitForRequest(stat2);
|
|
750 |
TESTL(stat2.Int() == KErrNone);
|
|
751 |
TESTL(gprsStatus == RPacketService::EStatusAttached);
|
|
752 |
|
|
753 |
iPacketService.NotifyStatusChange(stat3, gprsStatus);
|
|
754 |
iPacketService.Detach(stat1);
|
|
755 |
User::WaitForRequest(stat1);
|
|
756 |
TESTL(stat1.Int() == KErrNone);
|
|
757 |
User::WaitForRequest(stat3);
|
|
758 |
TESTL(stat3.Int() == KErrNone);
|
|
759 |
TESTL(gprsStatus == RPacketService::EStatusUnattached);
|
|
760 |
|
|
761 |
iPacketContext[0].Close();
|
|
762 |
iPacketService.Close();
|
|
763 |
iPhone.Close();
|
|
764 |
return TestStepResult();
|
|
765 |
}
|
|
766 |
//------------------------------------------------------------------
|
|
767 |
|
|
768 |
CGprsMsClassTest::CGprsMsClassTest()
|
|
769 |
/** Each test step initialises it's own name
|
|
770 |
*/
|
|
771 |
{
|
|
772 |
// store the name of this test case
|
|
773 |
// this is the name that is used by the script file
|
|
774 |
SetTestStepName(_L("GprsMsClassTest"));
|
|
775 |
}
|
|
776 |
//------------------------------------------------------------------
|
|
777 |
|
|
778 |
TVerdict CGprsMsClassTest::doTestStepL( void )
|
|
779 |
/**
|
|
780 |
* This tests the MS Class.
|
|
781 |
*/
|
|
782 |
{
|
|
783 |
SetSimtsyTestNumberL(0);
|
|
784 |
TRequestStatus stat1;
|
|
785 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
786 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
787 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
788 |
|
|
789 |
RPacketService::TMSClass currentClass;
|
|
790 |
RPacketService::TMSClass maxClass;
|
|
791 |
iPacketService.GetMSClass(stat1, currentClass, maxClass);
|
|
792 |
User::WaitForRequest(stat1);
|
|
793 |
TESTL(stat1.Int() == KErrNone);
|
|
794 |
|
|
795 |
iPacketService.SetMSClass(stat1, currentClass);
|
|
796 |
User::WaitForRequest(stat1);
|
|
797 |
TESTL(stat1.Int() == KErrNone);
|
|
798 |
TESTL(currentClass == RPacketService::EMSClassSuspensionRequired);
|
|
799 |
TESTL(maxClass == RPacketService::EMSClassSuspensionRequired);
|
|
800 |
|
|
801 |
iPacketService.Close();
|
|
802 |
iPhone.Close();
|
|
803 |
return TestStepResult();
|
|
804 |
}
|
|
805 |
//------------------------------------------------------------------
|
|
806 |
|
|
807 |
CGprsContextConfigTest::CGprsContextConfigTest()
|
|
808 |
/** Each test step initialises it's own name
|
|
809 |
*/
|
|
810 |
{
|
|
811 |
// store the name of this test case
|
|
812 |
// this is the name that is used by the script file
|
|
813 |
SetTestStepName(_L("GprsContextConfigTest"));
|
|
814 |
}
|
|
815 |
//------------------------------------------------------------------
|
|
816 |
|
|
817 |
TVerdict CGprsContextConfigTest::doTestStepL( void )
|
|
818 |
/**
|
|
819 |
* Test context config.
|
|
820 |
*/
|
|
821 |
{
|
|
822 |
SetSimtsyTestNumberL(0);
|
|
823 |
TRequestStatus stat1;
|
|
824 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
825 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
826 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
827 |
TBuf<30> contextName;
|
|
828 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
829 |
TESTL(iPacketContext[1].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
830 |
|
|
831 |
RPacketContext::TContextConfigGPRS Getparams;
|
|
832 |
RPacketContext::TContextConfigGPRS Setparams;
|
|
833 |
Setparams.iPdpType = SIMTSY_PDP_TYPE2;
|
|
834 |
Setparams.iAccessPointName = SIMTSY_ACCESS_POINT2;
|
|
835 |
Setparams.iPdpAddress = SIMTSY_PDP_ADDRESS2;
|
|
836 |
Setparams.iPdpCompression = SIMTSY_COMPRESSION2;
|
|
837 |
Setparams.iAnonymousAccessReqd = SIMTSY_ANONYMOUS_ACCESS2;
|
|
838 |
Setparams.iUseEdge = SIMTSY_EGPRS_REQUIRED;
|
|
839 |
|
|
840 |
TPckg<RPacketContext::TContextConfigGPRS> GetcontextConfigPckg(Getparams);
|
|
841 |
iPacketContext[0].GetConfig(stat1, GetcontextConfigPckg);
|
|
842 |
User::WaitForRequest(stat1);
|
|
843 |
TESTL(stat1.Int() == KErrNone);
|
|
844 |
Setparams = Getparams;
|
|
845 |
|
|
846 |
TPckg<RPacketContext::TContextConfigGPRS> SetcontextConfigPckg(Setparams);
|
|
847 |
iPacketContext[0].SetConfig(stat1, SetcontextConfigPckg);
|
|
848 |
User::WaitForRequest(stat1);
|
|
849 |
TESTL(stat1.Int() == KErrNone);
|
|
850 |
iPacketContext[1].SetConfig(stat1, SetcontextConfigPckg);
|
|
851 |
User::WaitForRequest(stat1);
|
|
852 |
TESTL(stat1.Int() == KErrNone);
|
|
853 |
iPacketContext[0].GetConfig(stat1, SetcontextConfigPckg);
|
|
854 |
User::WaitForRequest(stat1);
|
|
855 |
TESTL(stat1.Int() == KErrNone);
|
|
856 |
TRequestStatus stat;
|
|
857 |
iPacketContext[0].SetConfig(stat, SetcontextConfigPckg);
|
|
858 |
iPacketContext[0].CancelAsyncRequest(EPacketContextSetConfig);
|
|
859 |
User::WaitForRequest(stat);
|
|
860 |
TESTL(stat.Int() == KErrCancel || stat.Int() == KErrNone);
|
|
861 |
//!!!!
|
|
862 |
iPacketContext[0].GetConfig(stat, GetcontextConfigPckg);
|
|
863 |
iPacketContext[0].CancelAsyncRequest(EPacketContextGetConfig);
|
|
864 |
User::WaitForRequest(stat);
|
|
865 |
TESTL(stat.Int() == KErrCancel || stat.Int() == KErrNone);
|
|
866 |
|
|
867 |
|
|
868 |
Setparams.iPdpType = RPacketContext::TProtocolType(20); // Set out of range
|
|
869 |
TPckg<RPacketContext::TContextConfigGPRS> errorPackage(Setparams);
|
|
870 |
iPacketContext[0].SetConfig(stat1, errorPackage);
|
|
871 |
User::WaitForRequest(stat1);
|
|
872 |
TESTL(stat1.Int() == KErrCorrupt);
|
|
873 |
|
|
874 |
|
|
875 |
iPacketContext[0].Close();
|
|
876 |
iPacketContext[1].Close();
|
|
877 |
iPacketService.Close();
|
|
878 |
iPhone.Close();
|
|
879 |
return TestStepResult();
|
|
880 |
}
|
|
881 |
//------------------------------------------------------------------
|
|
882 |
|
|
883 |
CGprsContextConfigNotificationsTest::CGprsContextConfigNotificationsTest()
|
|
884 |
/** Each test step initialises it's own name
|
|
885 |
*/
|
|
886 |
{
|
|
887 |
// store the name of this test case
|
|
888 |
// this is the name that is used by the script file
|
|
889 |
SetTestStepName(_L("GprsContextConfigNotificationsTest"));
|
|
890 |
}
|
|
891 |
//------------------------------------------------------------------
|
|
892 |
|
|
893 |
TVerdict CGprsContextConfigNotificationsTest::doTestStepL( void )
|
|
894 |
/**
|
|
895 |
* Test context notifications.
|
|
896 |
*/
|
|
897 |
{
|
|
898 |
SetSimtsyTestNumberL(0);
|
|
899 |
TRequestStatus stat1, stat2;
|
|
900 |
TBuf<30> contextName;
|
|
901 |
RPacketContext::TContextConfigGPRS params, notifyParams;
|
|
902 |
TPckg<RPacketContext::TContextConfigGPRS> contextConfigPckg(params);
|
|
903 |
TPckg<RPacketContext::TContextConfigGPRS> notifyContextConfigPckg(notifyParams);
|
|
904 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
905 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
906 |
|
|
907 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
908 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
909 |
TESTL(iPacketContext[1].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
910 |
iPacketContext[0].NotifyConfigChanged(stat1, notifyContextConfigPckg);
|
|
911 |
iPacketContext[0].CancelAsyncRequest(EPacketContextNotifyConfigChanged);
|
|
912 |
User::WaitForRequest(stat1);
|
|
913 |
TESTL(stat1.Int() == KErrCancel);
|
|
914 |
|
|
915 |
iPacketContext[0].GetConfig(stat1, contextConfigPckg);
|
|
916 |
User::WaitForRequest(stat1);
|
|
917 |
TESTL(stat1.Int() == KErrNone);
|
|
918 |
iPacketContext[0].NotifyConfigChanged(stat1, notifyContextConfigPckg);
|
|
919 |
|
|
920 |
iPacketContext[0].SetConfig(stat2, contextConfigPckg);
|
|
921 |
User::WaitForRequest(stat2);
|
|
922 |
TESTL(stat2.Int() == KErrNone);
|
|
923 |
|
|
924 |
User::WaitForRequest(stat1);
|
|
925 |
TESTL(stat1.Int() == KErrNone);
|
|
926 |
TestConfigParamsL(params, notifyParams);
|
|
927 |
|
|
928 |
iPacketContext[0].Close();
|
|
929 |
iPacketContext[1].Close();
|
|
930 |
iPacketService.Close();
|
|
931 |
iPhone.Close();
|
|
932 |
User::After(1000000); // to allow the next text to be able to see the contexts as closed
|
|
933 |
return TestStepResult();
|
|
934 |
}
|
|
935 |
//------------------------------------------------------------------
|
|
936 |
|
|
937 |
COpenGprsMaxContextsTest::COpenGprsMaxContextsTest()
|
|
938 |
/** Each test step initialises it's own name
|
|
939 |
*/
|
|
940 |
{
|
|
941 |
// store the name of this test case
|
|
942 |
// this is the name that is used by the script file
|
|
943 |
SetTestStepName(_L("OpenGprsMaxContextsTest"));
|
|
944 |
}
|
|
945 |
//------------------------------------------------------------------
|
|
946 |
|
|
947 |
TVerdict COpenGprsMaxContextsTest::doTestStepL( void )
|
|
948 |
/**
|
|
949 |
* Tests enumerate contexts, open new context, open existing context.
|
|
950 |
*/
|
|
951 |
{
|
|
952 |
SetSimtsyTestNumberL(0);
|
|
953 |
TRequestStatus stat1;
|
|
954 |
TBuf<20> contextName = _L("");
|
|
955 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
956 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
957 |
|
|
958 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
959 |
TInt countContexts;
|
|
960 |
TInt maxAllowedContexts;
|
|
961 |
//!!!
|
|
962 |
iPacketService.EnumerateContexts(stat1, countContexts, maxAllowedContexts);
|
|
963 |
User::WaitForRequest(stat1);
|
|
964 |
TESTL(countContexts == 0);
|
|
965 |
|
|
966 |
TESTL(maxAllowedContexts == 11);
|
|
967 |
|
|
968 |
TInt i = 0;
|
|
969 |
RPacketService::TContextInfo contextinfo;
|
|
970 |
|
|
971 |
for(i = 0; i < maxAllowedContexts;i++)
|
|
972 |
{
|
|
973 |
RPacketContext contextPacket;
|
|
974 |
TBuf<30> tmpContextName;
|
|
975 |
tmpContextName = _L("PRIMARY");
|
|
976 |
tmpContextName.AppendNum(i+1);
|
|
977 |
TESTL(iPacketContext[i].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
978 |
iPacketService.GetContextInfo(stat1, i, contextinfo);
|
|
979 |
User::WaitForRequest(stat1);
|
|
980 |
TESTL(contextinfo.iName == tmpContextName);
|
|
981 |
TESTL(contextinfo.iStatus == RPacketContext::EStatusInactive);
|
|
982 |
TESTL(contextPacket.OpenExistingContext(iPacketService, contextName) == KErrNone);
|
|
983 |
TESTL(contextName == tmpContextName);
|
|
984 |
contextPacket.Close();
|
|
985 |
iPhone.Close();
|
|
986 |
}
|
|
987 |
|
|
988 |
iPacketService.GetContextInfo(stat1, i+1, contextinfo);
|
|
989 |
User::WaitForRequest(stat1);
|
|
990 |
TESTL(stat1.Int() == KErrArgument);
|
|
991 |
for(i = 0; i < maxAllowedContexts;i++)
|
|
992 |
{
|
|
993 |
iPacketContext[i].Close();
|
|
994 |
}
|
|
995 |
iPacketService.Close();
|
|
996 |
iPhone.Close();
|
|
997 |
return TestStepResult();
|
|
998 |
}
|
|
999 |
|
|
1000 |
//------------------------------------------------------------------
|
|
1001 |
|
|
1002 |
CGprsContextConfigArbitraryAddressTest::CGprsContextConfigArbitraryAddressTest()
|
|
1003 |
/** Each test step initialises it's own name
|
|
1004 |
*/
|
|
1005 |
{
|
|
1006 |
// store the name of this test case
|
|
1007 |
// this is the name that is used by the script file
|
|
1008 |
SetTestStepName(_L("GprsContextConfigArbitraryAddressTest"));
|
|
1009 |
}
|
|
1010 |
//------------------------------------------------------------------
|
|
1011 |
|
|
1012 |
TVerdict CGprsContextConfigArbitraryAddressTest::doTestStepL()
|
|
1013 |
/**
|
|
1014 |
* Test context config.
|
|
1015 |
*/
|
|
1016 |
{
|
|
1017 |
SetSimtsyTestNumberL(0);
|
|
1018 |
TRequestStatus stat1;
|
|
1019 |
RPacketContext::TContextConfigGPRS getParams;
|
|
1020 |
RPacketContext::TContextConfigGPRS setParams;
|
|
1021 |
|
|
1022 |
// Loading configuration from File
|
|
1023 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1024 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1025 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1026 |
TBuf<30> contextName;
|
|
1027 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
1028 |
|
|
1029 |
// Getting the Actual Configuration
|
|
1030 |
TPckg<RPacketContext::TContextConfigGPRS> getContextConfigPckg(getParams);
|
|
1031 |
iPacketContext[0].GetConfig(stat1, getContextConfigPckg);
|
|
1032 |
User::WaitForRequest(stat1);
|
|
1033 |
TESTL(stat1.Int() == KErrNone);
|
|
1034 |
setParams = getParams;
|
|
1035 |
|
|
1036 |
// Hacking the PdpAddress with an Arbitrary String (doesn't need to be a proper IP)
|
|
1037 |
setParams.iPdpAddress = _L8("ARBITRARY ADDRESS");
|
|
1038 |
|
|
1039 |
// Setting the New Configuration checking that it is accepted (no "KErrCorrupt")
|
|
1040 |
TPckg<RPacketContext::TContextConfigGPRS> setContextConfigPckg(setParams);
|
|
1041 |
iPacketContext[0].SetConfig(stat1, setContextConfigPckg);
|
|
1042 |
User::WaitForRequest(stat1);
|
|
1043 |
TESTL(stat1.Int() != KErrCorrupt && stat1.Int() == KErrNone);
|
|
1044 |
|
|
1045 |
// Getting the Configuration
|
|
1046 |
iPacketContext[0].GetConfig(stat1, setContextConfigPckg);
|
|
1047 |
User::WaitForRequest(stat1);
|
|
1048 |
TESTL(stat1.Int() == KErrNone);
|
|
1049 |
|
|
1050 |
// Checking the Configuration was correctly changed by Sim.tsy
|
|
1051 |
TESTL(setParams.iPdpAddress.Compare(getParams.iPdpAddress) == 0);
|
|
1052 |
|
|
1053 |
iPacketContext[0].Close();
|
|
1054 |
iPacketService.Close();
|
|
1055 |
iPhone.Close();
|
|
1056 |
return TestStepResult();
|
|
1057 |
}
|
|
1058 |
|
|
1059 |
//------------------------------------------------------------------
|
|
1060 |
|
|
1061 |
CMbmsOpenNewContextTest::CMbmsOpenNewContextTest()
|
|
1062 |
/** Each test step initialises it's own name
|
|
1063 |
*/
|
|
1064 |
{
|
|
1065 |
// store the name of this test case
|
|
1066 |
// this is the name that is used by the script file
|
|
1067 |
SetTestStepName(_L("EtelPcktMbmsCap1"));
|
|
1068 |
}
|
|
1069 |
//------------------------------------------------------------------
|
|
1070 |
|
|
1071 |
TVerdict CMbmsOpenNewContextTest::doTestStepL( void )
|
|
1072 |
/**
|
|
1073 |
* Tests creation of new MBMS context activation using
|
|
1074 |
* OpenNewContext of RPacketMbmsContext
|
|
1075 |
*/
|
|
1076 |
{
|
|
1077 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1078 |
TRequestStatus reqStatus;
|
|
1079 |
TBuf<20> contextName = _L("");
|
|
1080 |
|
|
1081 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1082 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1083 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1084 |
|
|
1085 |
TInt ret= iPacketMbmsContext.OpenNewContext(iPacketService, contextName);
|
|
1086 |
TEST(ret == KErrNone); //OpenNewContext will not use any capabilities.
|
|
1087 |
|
|
1088 |
iPacketMbmsContext.Close();
|
|
1089 |
iPacketService.Close();
|
|
1090 |
iPhone.Close();
|
|
1091 |
|
|
1092 |
return TestStepResult();
|
|
1093 |
}
|
|
1094 |
|
|
1095 |
|
|
1096 |
//-------------------------------------------------------------------------
|
|
1097 |
|
|
1098 |
CMbmsUpdateSessionTest::CMbmsUpdateSessionTest()
|
|
1099 |
/** Each test step initialises it's own name
|
|
1100 |
*/
|
|
1101 |
{
|
|
1102 |
// store the name of this test case
|
|
1103 |
// this is the name that is used by the script file
|
|
1104 |
SetTestStepName(_L("EtelPcktMbmsCap2"));
|
|
1105 |
}
|
|
1106 |
//------------------------------------------------------------------
|
|
1107 |
|
|
1108 |
TVerdict CMbmsUpdateSessionTest::doTestStepL( void )
|
|
1109 |
/**
|
|
1110 |
* Tests creation of new MBMS context activation and
|
|
1111 |
* tests the update session functionality of the MBMS context using the
|
|
1112 |
* API MbmsUpdateSessionTest of RPacketMbmsContext
|
|
1113 |
*/
|
|
1114 |
{
|
|
1115 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1116 |
TRequestStatus reqStatus;
|
|
1117 |
TBuf<20> contextName = _L("");
|
|
1118 |
|
|
1119 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1120 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1121 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1122 |
|
|
1123 |
TInt ret= iPacketMbmsContext.OpenNewContext(iPacketService, contextName);
|
|
1124 |
TESTL(ret == KErrNone);
|
|
1125 |
|
|
1126 |
RPacketMbmsContext::TContextConfigMbmsV1 contextConfig;
|
|
1127 |
TPckg<RPacketMbmsContext::TContextConfigMbmsV1> contextConfigPckg(contextConfig);
|
|
1128 |
|
|
1129 |
//Get configuration for the MBMS
|
|
1130 |
iPacketMbmsContext.GetConfig(reqStatus, contextConfigPckg);
|
|
1131 |
User::WaitForRequest(reqStatus);
|
|
1132 |
|
|
1133 |
RPacketContext::TContextStatus contextStatus;
|
|
1134 |
TRequestStatus notifyStatusRequest;
|
|
1135 |
iPacketMbmsContext.NotifyStatusChange(notifyStatusRequest, contextStatus);
|
|
1136 |
|
|
1137 |
// Activate the MBMS context
|
|
1138 |
iPacketMbmsContext.Activate(reqStatus);
|
|
1139 |
User::WaitForRequest(reqStatus);
|
|
1140 |
|
|
1141 |
User::WaitForRequest(notifyStatusRequest);//completes NotifyStatusChange with state “ctivating”
|
|
1142 |
|
|
1143 |
/** Session is added to the activated services table */
|
|
1144 |
TMbmsAction aAction=EAddEntries;
|
|
1145 |
TUint sessionid=SIM_PACKET_MBMS_SESSIONID;
|
|
1146 |
TRequestStatus updateSessionRequest;
|
|
1147 |
iPacketMbmsContext.UpdateMbmsSessionList(updateSessionRequest,reinterpret_cast<TMbmsAction &>(aAction), sessionid);
|
|
1148 |
|
|
1149 |
/** the state of the session added changes from inactive to activated */
|
|
1150 |
User::WaitForRequest(updateSessionRequest);//completes UpdateSession
|
|
1151 |
TESTL(updateSessionRequest.Int() == KErrPermissionDenied);
|
|
1152 |
|
|
1153 |
iPacketMbmsContext.Close();
|
|
1154 |
iPacketService.Close();
|
|
1155 |
iPhone.Close();
|
|
1156 |
|
|
1157 |
return TestStepResult();
|
|
1158 |
}
|
|
1159 |
|
|
1160 |
//-------------------------------------------------------------------------
|
|
1161 |
CGetMbmsNetworkServiceStatus::CGetMbmsNetworkServiceStatus()
|
|
1162 |
/** Each test step initialises it's own name
|
|
1163 |
*/
|
|
1164 |
{
|
|
1165 |
// store the name of this test case
|
|
1166 |
// this is the name that is used by the script file
|
|
1167 |
SetTestStepName(_L("EtelPcktMbmsCap3"));
|
|
1168 |
}
|
|
1169 |
//------------------------------------------------------------------
|
|
1170 |
|
|
1171 |
TVerdict CGetMbmsNetworkServiceStatus::doTestStepL( void )
|
|
1172 |
/**
|
|
1173 |
* Tests the functionality of GetMbmsNetworkServiceStatus of RPacketService.
|
|
1174 |
*
|
|
1175 |
*/
|
|
1176 |
{
|
|
1177 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1178 |
TRequestStatus reqStatus;
|
|
1179 |
TBuf<20> contextName = _L("");
|
|
1180 |
|
|
1181 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1182 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1183 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1184 |
|
|
1185 |
TMbmsNetworkServiceStatus tMbmsNetworkServiceStatus;
|
|
1186 |
TBool attemptAttached = ETrue;
|
|
1187 |
|
|
1188 |
iPacketService.GetMbmsNetworkServiceStatus(reqStatus, attemptAttached, tMbmsNetworkServiceStatus);
|
|
1189 |
User::WaitForRequest(reqStatus);
|
|
1190 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1191 |
|
|
1192 |
iPacketService.Close();
|
|
1193 |
iPhone.Close();
|
|
1194 |
|
|
1195 |
return TestStepResult();
|
|
1196 |
}
|
|
1197 |
|
|
1198 |
//-------------------------------------------------------------------------
|
|
1199 |
|
|
1200 |
CNotifyMbmsNetworkServiceStatusChange::CNotifyMbmsNetworkServiceStatusChange()
|
|
1201 |
/** Each test step initialises it's own name
|
|
1202 |
*/
|
|
1203 |
{
|
|
1204 |
// store the name of this test case
|
|
1205 |
// this is the name that is used by the script file
|
|
1206 |
SetTestStepName(_L("EtelPcktMbmsCap4"));
|
|
1207 |
}
|
|
1208 |
//------------------------------------------------------------------
|
|
1209 |
|
|
1210 |
TVerdict CNotifyMbmsNetworkServiceStatusChange::doTestStepL( void )
|
|
1211 |
/**
|
|
1212 |
* Tests the functionality of NotifyMbmsNetworkServiceStatusChange of RPacketService.
|
|
1213 |
*
|
|
1214 |
*/
|
|
1215 |
{
|
|
1216 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1217 |
TRequestStatus reqStatus;
|
|
1218 |
TBuf<20> contextName = _L("");
|
|
1219 |
|
|
1220 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1221 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1222 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1223 |
|
|
1224 |
TMbmsNetworkServiceStatus tMbmsNetworkServiceStatus;
|
|
1225 |
|
|
1226 |
//To get notified when the network service status changes
|
|
1227 |
iPacketService.NotifyMbmsNetworkServiceStatusChange(reqStatus, tMbmsNetworkServiceStatus);
|
|
1228 |
User::WaitForRequest(reqStatus);
|
|
1229 |
|
|
1230 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1231 |
|
|
1232 |
iPacketService.Close();
|
|
1233 |
iPhone.Close();
|
|
1234 |
|
|
1235 |
return TestStepResult();
|
|
1236 |
}
|
|
1237 |
|
|
1238 |
//-------------------------------------------------------------------------
|
|
1239 |
|
|
1240 |
CNotifyMbmsServiceAvailabilityChange::CNotifyMbmsServiceAvailabilityChange()
|
|
1241 |
/** Each test step initialises it's own name
|
|
1242 |
*/
|
|
1243 |
{
|
|
1244 |
// store the name of this test case
|
|
1245 |
// this is the name that is used by the script file
|
|
1246 |
SetTestStepName(_L("EtelPcktMbmsCap5"));
|
|
1247 |
}
|
|
1248 |
//------------------------------------------------------------------
|
|
1249 |
|
|
1250 |
TVerdict CNotifyMbmsServiceAvailabilityChange::doTestStepL( void )
|
|
1251 |
/**
|
|
1252 |
* Tests Notification of the Service Availability List using the
|
|
1253 |
* API NotifyMbmsServiceAvailabilityListChange of RPacketService.
|
|
1254 |
*/
|
|
1255 |
{
|
|
1256 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1257 |
TRequestStatus reqStatus;
|
|
1258 |
TBuf<20> contextName = _L("");
|
|
1259 |
|
|
1260 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1261 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1262 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1263 |
|
|
1264 |
CPcktMbmsMonitoredServiceList* mbmslist = CPcktMbmsMonitoredServiceList::NewL();
|
|
1265 |
CleanupStack::PushL(mbmslist);
|
|
1266 |
|
|
1267 |
//Update the Mbms service availability List
|
|
1268 |
TMbmsAction aAction=EAddEntries;
|
|
1269 |
iPacketService.UpdateMbmsMonitorServiceListL(reqStatus, reinterpret_cast<TMbmsAction &>(aAction), mbmslist);
|
|
1270 |
User::WaitForRequest(reqStatus);
|
|
1271 |
|
|
1272 |
//Notify the change in the mbms service parameter list
|
|
1273 |
iPacketService.NotifyMbmsServiceAvailabilityChange (reqStatus);
|
|
1274 |
User::WaitForRequest(reqStatus);
|
|
1275 |
TESTL(reqStatus.Int() == KErrNone);
|
|
1276 |
|
|
1277 |
CleanupStack::PopAndDestroy(); //mbmslist
|
|
1278 |
iPacketService.Close();
|
|
1279 |
iPhone.Close();
|
|
1280 |
|
|
1281 |
return TestStepResult();
|
|
1282 |
}
|
|
1283 |
|
|
1284 |
|
|
1285 |
//-------------------------------------------------------------------------
|
|
1286 |
|
|
1287 |
CUpdateMbmsMonitorServiceList::CUpdateMbmsMonitorServiceList()
|
|
1288 |
/** Each test step initialises it's own name
|
|
1289 |
*/
|
|
1290 |
{
|
|
1291 |
// store the name of this test case
|
|
1292 |
// this is the name that is used by the script file
|
|
1293 |
SetTestStepName(_L("EtelPcktMbmsCap6"));
|
|
1294 |
}
|
|
1295 |
//------------------------------------------------------------------
|
|
1296 |
|
|
1297 |
TVerdict CUpdateMbmsMonitorServiceList::doTestStepL( void )
|
|
1298 |
/**
|
|
1299 |
* Tests updation of the Service Monitoring List using the
|
|
1300 |
* API UpdateMbmsMonitorServiceListL of RPacketService.
|
|
1301 |
*/
|
|
1302 |
{
|
|
1303 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1304 |
TRequestStatus reqStatus;
|
|
1305 |
TBuf<20> contextName = _L("");
|
|
1306 |
|
|
1307 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1308 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1309 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1310 |
|
|
1311 |
CPcktMbmsMonitoredServiceList* mbmsList = CPcktMbmsMonitoredServiceList::NewL();
|
|
1312 |
CleanupStack::PushL(mbmsList);
|
|
1313 |
|
|
1314 |
/* ADD SERVICE */
|
|
1315 |
|
|
1316 |
RPacketService::TMbmsServiceAvailabilityV1 mbmsServAvail;
|
|
1317 |
TMbmsAction action=EAddEntries;
|
|
1318 |
TInt ab1=0,s1=1,a1=0;
|
|
1319 |
TInt ab2=1,s2=2,a2=0;
|
|
1320 |
|
|
1321 |
mbmsServAvail.iTmgi.SetServiceId(SIM_PACKET_MBMS_SERVICEID);
|
|
1322 |
mbmsServAvail.iTmgi.SetMCC(SIM_PACKET_MBMS_MCCID);
|
|
1323 |
mbmsServAvail.iTmgi.SetMNC(SIM_PACKET_MBMS_MNCID);
|
|
1324 |
mbmsServAvail.iMbmsServiceMode = reinterpret_cast<TMbmsServiceMode&>(s1);
|
|
1325 |
mbmsServAvail.iMbmsAvailabilityStatus = reinterpret_cast<TMbmsAvailabilityStatus&>(a1);
|
|
1326 |
mbmsServAvail.iMbmsAccessBearer = reinterpret_cast<TMbmsScope&>(ab1);
|
|
1327 |
mbmsList->AddEntryL(mbmsServAvail);
|
|
1328 |
|
|
1329 |
mbmsServAvail.iTmgi.SetServiceId(SIM_PACKET_MBMS_SERVICEID);
|
|
1330 |
mbmsServAvail.iTmgi.SetMCC(SIM_PACKET_MBMS_MCCID);
|
|
1331 |
mbmsServAvail.iTmgi.SetMNC(SIM_PACKET_MBMS_MNCID);
|
|
1332 |
mbmsServAvail.iMbmsServiceMode = reinterpret_cast<TMbmsServiceMode&>(s2);
|
|
1333 |
mbmsServAvail.iMbmsAvailabilityStatus = reinterpret_cast<TMbmsAvailabilityStatus&>(a2);
|
|
1334 |
mbmsServAvail.iMbmsAccessBearer = reinterpret_cast<TMbmsScope&>(ab2);
|
|
1335 |
mbmsList->AddEntryL(mbmsServAvail);
|
|
1336 |
|
|
1337 |
iPacketService.UpdateMbmsMonitorServiceListL(reqStatus,action,mbmsList);
|
|
1338 |
User::WaitForRequest(reqStatus);
|
|
1339 |
CleanupStack::PopAndDestroy();
|
|
1340 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1341 |
|
|
1342 |
/* REMOVE SPECIFIC SERVICE */
|
|
1343 |
mbmsList= CPcktMbmsMonitoredServiceList::NewL();
|
|
1344 |
CleanupStack::PushL(mbmsList);
|
|
1345 |
action=ERemoveEntries;
|
|
1346 |
mbmsServAvail.iTmgi.SetServiceId(2345);
|
|
1347 |
mbmsServAvail.iTmgi.SetMCC(2345);
|
|
1348 |
mbmsServAvail.iTmgi.SetMNC(2345);
|
|
1349 |
mbmsServAvail.iMbmsServiceMode = reinterpret_cast<TMbmsServiceMode&>(s2);
|
|
1350 |
mbmsServAvail.iMbmsAvailabilityStatus = reinterpret_cast<TMbmsAvailabilityStatus&>(a2);
|
|
1351 |
mbmsServAvail.iMbmsAccessBearer = reinterpret_cast<TMbmsScope&>(ab2);
|
|
1352 |
mbmsList->AddEntryL(mbmsServAvail);
|
|
1353 |
|
|
1354 |
iPacketService.UpdateMbmsMonitorServiceListL(reqStatus,action,mbmsList);
|
|
1355 |
User::WaitForRequest(reqStatus);
|
|
1356 |
CleanupStack::PopAndDestroy();
|
|
1357 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1358 |
|
|
1359 |
/* REMOVE_ALL */
|
|
1360 |
action=ERemoveAllEntries;
|
|
1361 |
iPacketService.UpdateMbmsMonitorServiceListL(reqStatus,action);
|
|
1362 |
User::WaitForRequest(reqStatus);
|
|
1363 |
|
|
1364 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1365 |
|
|
1366 |
iPacketService.Close();
|
|
1367 |
iPhone.Close();
|
|
1368 |
|
|
1369 |
return TestStepResult();
|
|
1370 |
}
|
|
1371 |
|
|
1372 |
//-------------------------------------------------------------------------
|
|
1373 |
|
|
1374 |
CEnumerateMbmsActiveServiceList::CEnumerateMbmsActiveServiceList()
|
|
1375 |
/** Each test step initialises it's own name
|
|
1376 |
*/
|
|
1377 |
{
|
|
1378 |
// store the name of this test case
|
|
1379 |
// this is the name that is used by the script file
|
|
1380 |
SetTestStepName(_L("EtelPcktMbmsCap7"));
|
|
1381 |
}
|
|
1382 |
//------------------------------------------------------------------
|
|
1383 |
|
|
1384 |
TVerdict CEnumerateMbmsActiveServiceList::doTestStepL( void )
|
|
1385 |
/**
|
|
1386 |
* Tests the functionality of EnumerateMbmsActiveServiceList of RPacketService.
|
|
1387 |
*
|
|
1388 |
*/
|
|
1389 |
{
|
|
1390 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1391 |
TRequestStatus reqStatus;
|
|
1392 |
TBuf<20> contextName = _L("");
|
|
1393 |
|
|
1394 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1395 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1396 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1397 |
|
|
1398 |
TInt currActiveServices, maxActiveServices;
|
|
1399 |
iPacketService.EnumerateMbmsActiveServiceList(reqStatus,currActiveServices, maxActiveServices);
|
|
1400 |
User::WaitForRequest(reqStatus);
|
|
1401 |
|
|
1402 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1403 |
|
|
1404 |
iPacketService.Close();
|
|
1405 |
iPhone.Close();
|
|
1406 |
|
|
1407 |
return TestStepResult();
|
|
1408 |
}
|
|
1409 |
|
|
1410 |
|
|
1411 |
//-------------------------------------------------------------------------
|
|
1412 |
|
|
1413 |
CEnumerateMbmsMonitorServiceList::CEnumerateMbmsMonitorServiceList()
|
|
1414 |
/** Each test step initialises it's own name
|
|
1415 |
*/
|
|
1416 |
{
|
|
1417 |
// store the name of this test case
|
|
1418 |
// this is the name that is used by the script file
|
|
1419 |
SetTestStepName(_L("EtelPcktMbmsCap8"));
|
|
1420 |
}
|
|
1421 |
//------------------------------------------------------------------
|
|
1422 |
|
|
1423 |
TVerdict CEnumerateMbmsMonitorServiceList::doTestStepL( void )
|
|
1424 |
/**
|
|
1425 |
* Tests the functionality of EnumerateMbmsActiveServiceList of RPacketService.
|
|
1426 |
*
|
|
1427 |
*/
|
|
1428 |
{
|
|
1429 |
SetSimtsyTestNumberL(SIM_PACKET_MBMS_TESTNUMBER);
|
|
1430 |
TRequestStatus reqStatus;
|
|
1431 |
TBuf<20> contextName = _L("");
|
|
1432 |
|
|
1433 |
TESTL(iPhone.Open(iTelServer, KPhoneName)==KErrNone);
|
|
1434 |
TESTL(iPhone.Initialise()==KErrNone);
|
|
1435 |
TESTL(iPacketService.Open(iPhone ) == KErrNone);
|
|
1436 |
|
|
1437 |
TInt currActiveServices, maxActiveServices;
|
|
1438 |
iPacketService.EnumerateMbmsActiveServiceList(reqStatus,currActiveServices, maxActiveServices);
|
|
1439 |
User::WaitForRequest(reqStatus);
|
|
1440 |
|
|
1441 |
TESTL(reqStatus.Int() == KErrPermissionDenied);
|
|
1442 |
|
|
1443 |
iPacketService.Close();
|
|
1444 |
iPhone.Close();
|
|
1445 |
|
|
1446 |
return TestStepResult();
|
|
1447 |
}
|
|
1448 |
|
|
1449 |
|
|
1450 |
/**
|
|
1451 |
* Tests closing one of two handles that both have notifications on them.
|
|
1452 |
* This can cause ETel to close multiple requests during the same cancel
|
|
1453 |
* request, which in turn can panic ETel if the iterator gets corrupted.
|
|
1454 |
*
|
|
1455 |
* @return Test step verdict.
|
|
1456 |
*/
|
|
1457 |
TVerdict CTestMultipleCompletionWithClosingContext::doTestStepL()
|
|
1458 |
{
|
|
1459 |
//
|
|
1460 |
// Initialise and open the packet service...
|
|
1461 |
//
|
|
1462 |
SetSimtsyTestNumberL(2);
|
|
1463 |
|
|
1464 |
TESTL(iPhone.Open(iTelServer, KPhoneName) == KErrNone);
|
|
1465 |
TESTL(iPhone.Initialise() == KErrNone);
|
|
1466 |
TESTL(iPacketService.Open(iPhone) == KErrNone);
|
|
1467 |
StartNTRasSimulation();
|
|
1468 |
|
|
1469 |
//
|
|
1470 |
// Open the first context...
|
|
1471 |
//
|
|
1472 |
TRequestStatus activateContext1Status;
|
|
1473 |
TBuf<50> contextName;
|
|
1474 |
|
|
1475 |
TESTL(iPacketContext[0].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
1476 |
iPacketContext[0].Activate(activateContext1Status);
|
|
1477 |
User::WaitForRequest(activateContext1Status);
|
|
1478 |
|
|
1479 |
//
|
|
1480 |
// Open the second context...
|
|
1481 |
//
|
|
1482 |
TRequestStatus activateContext2Status;
|
|
1483 |
|
|
1484 |
TESTL(iPacketContext[1].OpenNewContext(iPacketService, contextName) == KErrNone);
|
|
1485 |
iPacketContext[1].Activate(activateContext2Status);
|
|
1486 |
User::WaitForRequest(activateContext2Status);
|
|
1487 |
|
|
1488 |
//
|
|
1489 |
// Open another handle to the second context by name...
|
|
1490 |
//
|
|
1491 |
TESTL(iPacketContext[2].OpenExistingContext(iPacketService, _L("PRIMARY2")) == KErrNone);
|
|
1492 |
|
|
1493 |
//
|
|
1494 |
// Post notifications on both handles for the second context...
|
|
1495 |
//
|
|
1496 |
TRequestStatus notifyContext1Status, notifyContext2Status;
|
|
1497 |
RPacketContext::TContextStatus contextStatus1, contextStatus2;
|
|
1498 |
|
|
1499 |
iPacketContext[1].NotifyStatusChange(notifyContext1Status, contextStatus1);
|
|
1500 |
iPacketContext[2].NotifyStatusChange(notifyContext2Status, contextStatus2);
|
|
1501 |
|
|
1502 |
//
|
|
1503 |
// Delete second context using the first handle...
|
|
1504 |
//
|
|
1505 |
TRequestStatus deleteContext2Status;
|
|
1506 |
|
|
1507 |
iPacketContext[1].Delete(deleteContext2Status);
|
|
1508 |
User::WaitForRequest(deleteContext2Status);
|
|
1509 |
|
|
1510 |
//
|
|
1511 |
// The notifications will have triggered and a request will have
|
|
1512 |
// been reposted to the TSY.
|
|
1513 |
//
|
|
1514 |
User::WaitForRequest(notifyContext1Status);
|
|
1515 |
User::WaitForRequest(notifyContext2Status);
|
|
1516 |
|
|
1517 |
//
|
|
1518 |
// Deactivate the fist context...
|
|
1519 |
//
|
|
1520 |
TRequestStatus deactivateContext1Status;
|
|
1521 |
|
|
1522 |
iPacketContext[0].Deactivate(deactivateContext1Status);
|
|
1523 |
User::WaitForRequest(deactivateContext1Status);
|
|
1524 |
|
|
1525 |
//
|
|
1526 |
// Close the contexts. Note this is closing iPacketContext[1] before
|
|
1527 |
// iPacketContext[2]! This forces the notification from the first handle
|
|
1528 |
// to move to the second handle, but there it errors as the context is
|
|
1529 |
// closed. This would cause ETel server to panic with KERN-EXEC:3.
|
|
1530 |
//
|
|
1531 |
iPacketContext[1].Close();
|
|
1532 |
iPacketContext[2].Close();
|
|
1533 |
iPacketContext[0].Close();
|
|
1534 |
iPacketService.Close();
|
|
1535 |
iPhone.Close();
|
|
1536 |
|
|
1537 |
//
|
|
1538 |
// Now check that ETel is still up...
|
|
1539 |
//
|
|
1540 |
TEST(iPhone.Open(iTelServer, KPhoneName) == KErrNone);
|
|
1541 |
iPhone.Close();
|
|
1542 |
|
|
1543 |
return TestStepResult();
|
|
1544 |
} // CTestMultipleCompletionWithClosingContext::doTestStepL
|