24
|
1 |
// Copyright (c) 1997-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 |
// Test Rx SMS Request Failure when PDU Mode is not supported by the mobile
|
|
15 |
// This file implements Receive SMS Request failure tests when PDU mode is not
|
|
16 |
// supported by the mobile iPhone.
|
|
17 |
// See CDataCall.cpp for fully documented test scenario.
|
|
18 |
//
|
|
19 |
//
|
|
20 |
|
|
21 |
/**
|
|
22 |
@file
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include <e32test.h>
|
|
26 |
#include <mmretrieve.h>
|
|
27 |
#include <etelmm.h>
|
|
28 |
#include "Te_LoopBackCNoPduRxMess.h"
|
|
29 |
#include "../../hayes/TSYCONFG.H" // for KInternetAccessPoint
|
|
30 |
|
|
31 |
|
|
32 |
//
|
|
33 |
// Test-side class
|
|
34 |
// With the assistance of the base class, this class must start the emulator
|
|
35 |
// and drive the ETel API.
|
|
36 |
//
|
|
37 |
CTestDriveNoPduRxMess* CTestDriveNoPduRxMess::NewL(const TScriptList aScriptListEntry)
|
|
38 |
{
|
|
39 |
CTestDriveNoPduRxMess* aA = new (ELeave) CTestDriveNoPduRxMess(aScriptListEntry);
|
|
40 |
CleanupStack::PushL(aA);
|
|
41 |
aA->ConstructL();
|
|
42 |
CleanupStack::Pop();
|
|
43 |
return (aA);
|
|
44 |
}
|
|
45 |
|
|
46 |
CTestDriveNoPduRxMess::CTestDriveNoPduRxMess(const TScriptList aScriptListEntry) :
|
|
47 |
iScriptListEntry(aScriptListEntry)
|
|
48 |
{}
|
|
49 |
|
|
50 |
CTestDriveNoPduRxMess::~CTestDriveNoPduRxMess()
|
|
51 |
{}
|
|
52 |
|
|
53 |
TInt CTestDriveNoPduRxMess::RunTestL()
|
|
54 |
{
|
|
55 |
iCurrentScript = iScriptListEntry;
|
|
56 |
return StartEmulatorL();
|
|
57 |
}
|
|
58 |
|
|
59 |
TInt CTestDriveNoPduRxMess::DriveETelApiL()
|
|
60 |
//
|
|
61 |
// This function contains the real meat of the Client-side test code
|
|
62 |
//
|
|
63 |
{
|
|
64 |
INFO_PRINTF1(_L("Test for a Receive SMS Request Failure"));
|
|
65 |
INFO_PRINTF1(_L("when PDU mode is not supported by the"));
|
|
66 |
INFO_PRINTF1(_L("mobile iPhone\n"));
|
|
67 |
|
|
68 |
INFO_PRINTF1(_L("Initializing the Phone...\n"));
|
|
69 |
TRequestStatus reqStatus;
|
|
70 |
|
|
71 |
RMobilePhone::TMMTableSettings tableSettings;
|
|
72 |
tableSettings.iLocId=KInternetAccessPoint;
|
|
73 |
RMobilePhone::TMMTableSettingsPckg tableSettingsPckg(tableSettings);
|
|
74 |
iPhone.InitialiseMM(reqStatus , tableSettingsPckg);
|
|
75 |
|
|
76 |
User::WaitForRequest(reqStatus);
|
|
77 |
TESTL(reqStatus == KErrNone);
|
|
78 |
|
|
79 |
INFO_PRINTF1(_L("Opening Mobile SMS Messaging..."));
|
|
80 |
RMobileSmsMessaging sms;
|
|
81 |
TESTL(sms.Open(iPhone) == KErrNone);
|
|
82 |
|
|
83 |
INFO_PRINTF1(_L("Reading SMS Message..."));
|
|
84 |
|
|
85 |
sms.SetReceiveMode (reqStatus, RMobileSmsMessaging::EReceiveModeUnspecified);
|
|
86 |
|
|
87 |
INFO_PRINTF1(_L("Verifying the Expected SMS Failure..."));
|
|
88 |
User::WaitForRequest(reqStatus);
|
|
89 |
INFO_PRINTF2(_L(" reqStatus = %d"), reqStatus.Int());
|
|
90 |
TESTL(reqStatus == KErrNotSupported);
|
|
91 |
|
|
92 |
INFO_PRINTF1(_L("Closing SMS Messaging..."));
|
|
93 |
sms.Close();
|
|
94 |
return (KErrNone);
|
|
95 |
}
|
|
96 |
|
|
97 |
//
|
|
98 |
// Emulator-side class
|
|
99 |
// With the assistance of the base class, this class must run the designated script
|
|
100 |
//
|
|
101 |
CTestNoPduRxMess* CTestNoPduRxMess::NewL(const TScript* aScript)
|
|
102 |
{
|
|
103 |
CTestNoPduRxMess* aA = new (ELeave) CTestNoPduRxMess(aScript);
|
|
104 |
CleanupStack::PushL(aA);
|
|
105 |
aA->ConstructL();
|
|
106 |
CleanupStack::Pop();
|
|
107 |
return (aA);
|
|
108 |
}
|
|
109 |
|
|
110 |
CTestNoPduRxMess::CTestNoPduRxMess(const TScript* aScript) :
|
|
111 |
iScript(aScript)
|
|
112 |
{}
|
|
113 |
|
|
114 |
void CTestNoPduRxMess::ConstructL()
|
|
115 |
{
|
|
116 |
CATScriptEng::ConstructL();
|
|
117 |
}
|
|
118 |
|
|
119 |
CTestNoPduRxMess::~CTestNoPduRxMess()
|
|
120 |
{}
|
|
121 |
|
|
122 |
TInt CTestNoPduRxMess::Start()
|
|
123 |
{
|
|
124 |
StartScript(iScript);
|
|
125 |
return (KErrNone);
|
|
126 |
}
|
|
127 |
|
|
128 |
void CTestNoPduRxMess::SpecificAlgorithmL(TInt /* aParam */)
|
|
129 |
{
|
|
130 |
}
|
|
131 |
|
|
132 |
void CTestNoPduRxMess::Complete(TInt aError)
|
|
133 |
{
|
|
134 |
iReturnValue = aError;
|
|
135 |
CActiveScheduler::Stop();
|
|
136 |
}
|