24
|
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 CsdAgt TestCase Test 3.1 - 3.2
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
// EPOC includes
|
|
19 |
#include <e32base.h>
|
|
20 |
#include <in_sock.h>
|
|
21 |
#include <dummyetel.h> // include here to avoid picking up the real etel.h
|
|
22 |
#include <etelmm.h>
|
|
23 |
|
|
24 |
// Test system includes
|
|
25 |
#include "log.h"
|
|
26 |
#include "teststep.h"
|
|
27 |
#include "TestStepCsdAgt.h"
|
|
28 |
#include "TestSuiteCsdAgt.h"
|
|
29 |
|
|
30 |
// COMMDB Database Undo
|
|
31 |
#include "DbUndo.h"
|
|
32 |
|
|
33 |
// EFinishedDialling
|
|
34 |
#include <csdprog.h>
|
|
35 |
|
|
36 |
// Class definitions
|
|
37 |
#include "CsdAgtTestReconnect.h"
|
|
38 |
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Test case 3.1, CSD reconnect after open state
|
|
42 |
*
|
|
43 |
*/
|
|
44 |
enum TVerdict CCsdAgtTest3_1::doCsdAgtTestStepL( void )
|
|
45 |
{
|
|
46 |
TRealAgtNotify AgtNotify;
|
|
47 |
|
|
48 |
AgtNotify.SetTestCase(10301);
|
|
49 |
SetGSMModeL(AgtNotify);
|
|
50 |
|
|
51 |
// Call ReConnect() utility function
|
|
52 |
ReConnectL();
|
|
53 |
|
|
54 |
return iTestStepResult;
|
|
55 |
}
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Test case 3.2 CSD reconnect fails
|
|
59 |
*
|
|
60 |
*/
|
|
61 |
enum TVerdict CCsdAgtTest3_2::doCsdAgtTestStepL( void )
|
|
62 |
{
|
|
63 |
TInt err;
|
|
64 |
TInt stage;
|
|
65 |
CNifAgentRefN1 *agent;
|
|
66 |
|
|
67 |
TRealAgtNotify AgtNotify;
|
|
68 |
AgtNotify.SetTestCase((TInt)10302);
|
|
69 |
SetGSMModeL(AgtNotify);
|
|
70 |
|
|
71 |
// Construct a new Dummy Nifman Instance
|
|
72 |
// Log(_L("Loading DUMMYNIF.DLL"));
|
|
73 |
agent = CNifAgentRefN1::NewL(this);
|
|
74 |
CleanupStack::PushL(agent);
|
|
75 |
|
|
76 |
// Attempt connection
|
|
77 |
Log(_L("Connecting..."));
|
|
78 |
agent->Connect();
|
|
79 |
|
|
80 |
// Check for an error code
|
|
81 |
agent->GetCompletionCode(err);
|
|
82 |
TESTEL(err==KErrNone,err);
|
|
83 |
|
|
84 |
// Check ConnectComplete was reported at the correct stage in the state machine
|
|
85 |
agent->GetProgressStage(stage);
|
|
86 |
TESTEL(stage==ECsdConnectionOpen,stage);
|
|
87 |
|
|
88 |
Log(_L("Connect Succeeded"));
|
|
89 |
|
|
90 |
DelayL(2000000);
|
|
91 |
|
|
92 |
AgtNotify.SetTestCase((TInt)10303);
|
|
93 |
|
|
94 |
// Attempt connection
|
|
95 |
Log(_L("ReConnecting..."));
|
|
96 |
agent->ReConnect();
|
|
97 |
|
|
98 |
// Check for an error code
|
|
99 |
agent->GetCompletionCode(err);
|
|
100 |
TESTEL(err==KErrGeneral,err);
|
|
101 |
|
|
102 |
// Check ConnectComplete was reported at the correct stage in the state machine
|
|
103 |
agent->GetProgressStage(stage);
|
|
104 |
TESTEL(stage==ECsdScannedScript,stage);
|
|
105 |
|
|
106 |
DelayL(2000000);
|
|
107 |
|
|
108 |
// Disconnect
|
|
109 |
Log(_L("Disconnecting..."));
|
|
110 |
agent->Disconnect();
|
|
111 |
|
|
112 |
// Check for an error code
|
|
113 |
agent->GetCompletionCode(err);
|
|
114 |
TESTEL(err==KErrNone,err);
|
|
115 |
|
|
116 |
Log(_L("Disconnect Succeeded"));
|
|
117 |
|
|
118 |
// Finished with Dummy Nifman so delete it
|
|
119 |
CleanupStack::PopAndDestroy(agent);
|
|
120 |
// Log(_L("DUMMYNIF.DLL Unloaded"));
|
|
121 |
|
|
122 |
return iTestStepResult;
|
|
123 |
}
|