telephonyprotocols/psdagt/TS_PsdAgt/PsdAgtTestNotificationDisabled.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This contains PsdAgt TestCase Test 4.1
       
    15 // 
       
    16 //
       
    17 
       
    18 // EPOC includes
       
    19 #include <e32base.h>
       
    20 #include <in_sock.h>
       
    21 
       
    22 // Test system includes
       
    23 #include "networking/log.h"
       
    24 #include "networking/teststep.h"
       
    25 #include "TestStepPsdAgt.h"
       
    26 #include "TestSuitePsdAgt.h"
       
    27 
       
    28 // RPacketContext
       
    29 #include <etelpckt.h> 
       
    30 
       
    31 // EConnectionOpen
       
    32 #include <connectprog.h>
       
    33 
       
    34 // COMMDB Database Undo
       
    35 #include "DbUndo.h"
       
    36 
       
    37 // Class definitions
       
    38 #include "PsdAgtTestNotificationDisabled.h"
       
    39 
       
    40 
       
    41 // Test case 4.1,  Context Config change, Service Option reduced, disconnect
       
    42 enum TVerdict CPsdAgtTest4_1::doPsdAgtTestStepL( void )
       
    43 	{
       
    44 	TInt err;
       
    45 	TInt stage;
       
    46 	CNifAgentRefN1 *agent;
       
    47 	TRealAgtNotify agtNotify; 
       
    48 
       
    49 	agtNotify.SetTestCase(401);
       
    50 
       
    51 	Log(_L("Loading DUMMYNIF.DLL"));
       
    52 	// Construct a new Dummy Nifman Instance
       
    53 	agent = CNifAgentRefN1::NewL(this,EFalse);
       
    54 	CleanupStack::PushL(agent);
       
    55 
       
    56 	// Attempt connection
       
    57 	Log(_L("Connecting..."));
       
    58 	agent->Connect();
       
    59 	
       
    60 	// Check result codes
       
    61 	agent->GetCompletionCode(err);
       
    62 	TESTEL(err==KErrNone,err);
       
    63 
       
    64 	// Check ConnectComplete was reported at the correct stage in the state machine
       
    65 	agent->GetProgressStage(stage);
       
    66 	TESTEL(stage==KConnectionOpen,stage);
       
    67 
       
    68 	Log(_L("Connect Successful"));
       
    69 
       
    70 	DelayL(3000000);
       
    71 
       
    72 	// Tell the ETEL layer to send a QOS change to PSDAGX
       
    73 	Log(_L("Notify PSDAGX of QoS change"));
       
    74 	agtNotify.NotifyAgt(EReduce);
       
    75 
       
    76 	// Make sure no dialog is presented
       
    77 	DelayL(3000000);
       
    78 
       
    79 	// Disconnect
       
    80 	Log(_L("Disconnecting..."));
       
    81 	agent->Disconnect();
       
    82 
       
    83 	// Check result code
       
    84 	agent->GetCompletionCode(err);
       
    85 	TESTEL(err==KErrNone,err);
       
    86 
       
    87 	Log(_L("Disconnect Successful"));
       
    88 	
       
    89 	// Finished with Dummy Nifman so delete it
       
    90 	CleanupStack::PopAndDestroy(agent);
       
    91 	Log(_L("DUMMYNIF.DLL Unloaded"));
       
    92 	
       
    93 	// Finished with database so undo any changes 
       
    94 	Log(_L("Reverting COMMDB changes"));
       
    95 
       
    96 	return iTestStepResult;
       
    97 	}
       
    98