68
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// Contain the implementation of the class for generic CSD agent test
|
|
15 |
//
|
|
16 |
//
|
|
17 |
#include "CsdAgentTestSteps.h"
|
|
18 |
#include "es_sock.h"
|
|
19 |
#include "in_sock.h"
|
|
20 |
#include "commdbconnpref.h"
|
|
21 |
|
|
22 |
CTestStepCsdAgentConnection::CTestStepCsdAgentConnection(TPtrC aName)
|
|
23 |
{
|
|
24 |
iTestStepName=aName;
|
|
25 |
}
|
|
26 |
|
|
27 |
enum TVerdict CTestStepCsdAgentConnection::doTestStepL(void)
|
|
28 |
{
|
|
29 |
|
|
30 |
__UHEAP_MARK;
|
|
31 |
TInt err;
|
|
32 |
RSocketServ server;
|
|
33 |
RConnection connection;
|
|
34 |
TRequestStatus status;
|
|
35 |
|
|
36 |
err = server.Connect();
|
|
37 |
TESTEL(err == KErrNone, err);
|
|
38 |
CleanupClosePushL(server);
|
|
39 |
|
|
40 |
err = connection.Open(server,KAfInet);
|
|
41 |
TESTEL(err == KErrNone, err);
|
|
42 |
CleanupClosePushL(connection);
|
|
43 |
|
|
44 |
//connection_start.script
|
|
45 |
//TestCase1: Start the connection (outgoing) which results in 0, KErrNone, it pulls pppLcp for te_ppsize.xml
|
|
46 |
// Verifies AgentAdapter state transition from EConnecting to EConnected
|
|
47 |
TCommDbConnPref prefs;
|
|
48 |
prefs.SetIapId(0);
|
|
49 |
prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
|
|
50 |
|
|
51 |
connection.Start(prefs, status);
|
|
52 |
User::WaitForRequest(status);
|
|
53 |
TESTEL(status.Int() == KErrNone, status.Int());
|
|
54 |
|
|
55 |
// Verifies AgentAdapter state transition from EConnected to EDisconnecting
|
|
56 |
err = connection.Stop();
|
|
57 |
TESTEL(err == KErrNone, err);
|
|
58 |
CleanupStack::Pop();
|
|
59 |
|
|
60 |
// close the socket server
|
|
61 |
server.Close();
|
|
62 |
CleanupStack::Pop();
|
|
63 |
|
|
64 |
__UHEAP_MARKEND;
|
|
65 |
|
|
66 |
return iTestStepResult;
|
|
67 |
}
|