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