24
|
1 |
// Copyright (c) 2008-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 |
// Base class for CTSY component tests
|
|
15 |
//
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef CCTSYCOMPONENTTESTBASE_H
|
|
20 |
#define CCTSYCOMPONENTTESTBASE_H
|
|
21 |
|
|
22 |
#include <test/tefunit.h>
|
|
23 |
|
|
24 |
#include <etelmm.h>
|
|
25 |
#include <etelmmcs.h>
|
|
26 |
#include <etelpckt.h>
|
|
27 |
|
|
28 |
#include <test/rmockltsy.h>
|
|
29 |
#include <ctsy/serviceapi/cmmutility.h>
|
|
30 |
#include <ctsy/rmmcustomapi.h>
|
|
31 |
|
|
32 |
class CCtsyComponentTestBase : public CTestFixture
|
|
33 |
{
|
|
34 |
|
|
35 |
protected:
|
|
36 |
enum TExtendedErrorClient
|
|
37 |
{
|
|
38 |
EUseBasicError,
|
|
39 |
EUseExtendedError
|
|
40 |
};
|
|
41 |
|
|
42 |
void OpenEtelServerL(TExtendedErrorClient aSetExtendedErrorClient = EUseBasicError);
|
|
43 |
|
|
44 |
void OpenPhoneNegativeL(TInt aMode = 1);
|
|
45 |
|
|
46 |
void OpenPhoneL();
|
|
47 |
void OpenPhoneL(RMobilePhone::TMobilePhoneServiceTableV1& aSimServiceTable);
|
|
48 |
|
|
49 |
void OpenCustomApiLC(RMmCustomAPI& aCustomAPI);
|
|
50 |
|
|
51 |
void OpenPacketServiceLC(RPacketService& aPacketService, RPacketService::TStatus aPacketServiceStatus);
|
|
52 |
TInt SetContextActiveL(TInfoName& aContextName);
|
|
53 |
//
|
|
54 |
|
|
55 |
// Driver calls
|
|
56 |
void DriverExpectDialCallRequestL(TInt aCallId, RMobilePhone::TMobileService aMode, TInt aDialError, TBool aIsIsvCall = EFalse, TBool aIsSimOriginated = EFalse, TBool aPerformFdnCheck = ETrue);
|
|
57 |
void DriverCompleteGetMobileCallInfoL(TInt aCallId, RMobilePhone::TMobileService aService);
|
|
58 |
void DriverCompleteSuccessfulDialNotificationsL(TInt aCallId);
|
|
59 |
void DriverCompleteCallStatusChangeNotificationsL(RArray<RMobileCall::TMobileCallStatus>& aStatuses, TInt aCallId, TInt aNotifyError, TInt aExtraDelay = 0);
|
|
60 |
void DriverDialCallL(TInt aCallId, RMobilePhone::TMobileService aMode, TBool aIsIsvCall = EFalse, TBool aIsSimOriginated = EFalse, TBool aPerformFdnCheck = ETrue); //aIsSimOriginated is set to ETrue when the call originates from the SIM i.e. a SET UP CALL proactive command
|
|
61 |
void DriverHangUpCallL(TInt aCallId, TInt aHangUpCause, TBool aCallHasDuration = ETrue);
|
|
62 |
void DriverCompleteSuccessfulHangUpNotificationsL(TInt aCallId, TBool aWithInBandInfo, TInt aNotifyError, TBool aCallHasDuration = ETrue, TInt aExtraDelay = 0); //aCallDuration should be set to true if we expect an update to the phone's life timer... i.e. if the call has been connected then an update will come through
|
|
63 |
void DriverHoldCallL(TInt aCallId, TInt aHoldError);
|
|
64 |
void DriverDialAndHoldFirstCallDialSecondCallL(RMobilePhone::TMobileService aMobileService, TInt aCallId1, TInt aCallId2);
|
|
65 |
|
|
66 |
void DriverPrepInternalGettersMockLtsyL();
|
|
67 |
|
|
68 |
// Client calls
|
|
69 |
TInt OpenLineAndCallL(RMobileLine& aMobileLine, RMobileCall& aMobileCall, RMobilePhone::TMobileService aMode);
|
|
70 |
void ClientDialCallL(RMobileLine& aMobileLine, RMobileCall& aMobileCall, RMobilePhone::TMobileService aMode, TBool aDialEmergencyCall=EFalse, TBool aPerformFdnCheck=ETrue);
|
|
71 |
void ClientWaitForCallStatusNotifications(RMobileCall& aMobileCall, TRequestStatus& aRequestStatus, RMobileCall::TMobileCallStatus& aCallStatus, RArray<RMobileCall::TMobileCallStatus>& aExpectedStatuses, TInt aExpectedError);
|
|
72 |
void ClientDialAndHoldFirstCallDialSecondCallL(RMobilePhone::TMobileService aMobileService, RMobileCall& aMobileCall1, RMobileLine& aMobileLine1, RMobileCall& aMobileCall2, RMobileLine& aMobileLine2);
|
|
73 |
void ClientHangUpCallL(RMobileCall& aMobileCall);
|
|
74 |
|
|
75 |
//
|
|
76 |
|
|
77 |
void AssertMockLtsyStatusL();
|
|
78 |
|
|
79 |
void WaitForMockLTSYTerminated();
|
|
80 |
|
|
81 |
// To push a CleanupItem ont the cleanupstack to close the phone
|
|
82 |
static void Cleanup(TAny* self);
|
|
83 |
virtual void DoCleanup();
|
|
84 |
|
|
85 |
|
|
86 |
// Fake type used for bad parameter testing.
|
|
87 |
// These will have the correct extension ID but the wrong descriptor
|
|
88 |
// size compared to the T-class which the API expects.
|
|
89 |
class TTestMultimodeType
|
|
90 |
{
|
|
91 |
public:
|
|
92 |
TTestMultimodeType(TInt aExtensionId) { iExtensionId = aExtensionId; }
|
|
93 |
TInt ExtensionId() const { return iExtensionId; }
|
|
94 |
|
|
95 |
private:
|
|
96 |
TInt iExtensionId;
|
|
97 |
};
|
|
98 |
|
|
99 |
typedef TPckg<TTestMultimodeType> TTestMultimodeTypePckg;
|
|
100 |
|
|
101 |
void CallGetMobileCallInfoL(TInt aCallId,
|
|
102 |
RMobilePhone::TMobileService aService,
|
|
103 |
const TDesC& aTelNumber);
|
|
104 |
|
|
105 |
void PrintMockLtsyLog();
|
|
106 |
protected:
|
|
107 |
RTelServer iTelServer;
|
|
108 |
RMobilePhone iPhone;
|
|
109 |
RMockLtsy iMockLTSY;
|
|
110 |
TBuf<255> iLogBuf;
|
|
111 |
|
|
112 |
}; // class CCtsyComponentTestBase
|
|
113 |
|
|
114 |
|
|
115 |
// ------------------------------------------------------------------------ //
|
|
116 |
|
|
117 |
//
|
|
118 |
// Defintions of various Network Information type data for use in test-steps
|
|
119 |
//
|
|
120 |
|
|
121 |
// Data values for RMobilePhone::TMobilePhoneNetworkInfoV5
|
|
122 |
const RMobilePhone::TMobilePhoneNetworkCountryCode KCountryCode= _L("011");
|
|
123 |
const RMobilePhone::TMobilePhoneNetworkIdentity KCdmaSID = _L("666");
|
|
124 |
const RMobilePhone::TMobilePhoneNetworkIdentity KAnalogSID = _L("777");
|
|
125 |
const RMobilePhone::TMobilePhoneNetworkIdentity KNetworkId = _L("88888");
|
|
126 |
const RMobilePhone::TMobilePhoneNetworkDisplayTag KDisplayTag = _L("MyNet");
|
|
127 |
const RMobilePhone::TMobilePhoneNetworkShortName KShortName = _L("MyNetwork");
|
|
128 |
const RMobilePhone::TMobilePhoneNetworkLongName KLongName = _L("MyNetworkLongName");
|
|
129 |
const RMobilePhone::TMobilePhoneNetworkAccess KAccess = RMobilePhone::ENetworkAccessGsm;
|
|
130 |
const RMobilePhone::TMobilePhoneNetworkMode KMode = RMobilePhone::ENetworkModeCdma95;
|
|
131 |
const RMobilePhone::TMobilePhoneNetworkStatus KStatus = RMobilePhone::ENetworkStatusAvailable;
|
|
132 |
const RMobilePhone::TMobilePhoneNetworkBandInfo KBandInfo = RMobilePhone::E1900BandF;
|
|
133 |
const TBool KEgprsAvailable = ETrue;
|
|
134 |
const TBool KHsdpaAvailable = EFalse;
|
|
135 |
|
|
136 |
// Data values for RMobilePhone::TMobilePhoneLocationAreaV1
|
|
137 |
const TBool KAreaKnown = ETrue;
|
|
138 |
const TUint KLocationAreaCode = 9999;
|
|
139 |
const TUint KCellId = 111;
|
|
140 |
|
|
141 |
// Data values for RMobilePhone::TMobilePhoneNetworkMode
|
|
142 |
const RMobilePhone::TMobilePhoneNetworkMode KNetworkMode = RMobilePhone::ENetworkModeWcdma;
|
|
143 |
|
|
144 |
// Data values for RMobilePhone::TMobilePhoneNITZ
|
|
145 |
const TInt32 KNitzFieldsUsed = RMobilePhone::KCapsTimeAvailable |
|
|
146 |
RMobilePhone::KCapsTimezoneAvailable |
|
|
147 |
RMobilePhone::KCapsDSTAvailable |
|
|
148 |
RMobilePhone::KCapsShortNameAvailable |
|
|
149 |
RMobilePhone::KCapsLongNameAvailable;
|
|
150 |
|
|
151 |
const TInt KTimeZone = 10;
|
|
152 |
const TInt KDst = 5;
|
|
153 |
|
|
154 |
// Data values for Signal Strength
|
|
155 |
const TInt32 KSignalStrength = 99;
|
|
156 |
const TInt8 KBar = 5;
|
|
157 |
|
|
158 |
// Data values for RMobilePhone::TMobilePhoneBatteryInfoV1
|
|
159 |
const RMobilePhone::TMobilePhoneBatteryStatus KBatteryStatus = RMobilePhone::EPoweredByBattery;
|
|
160 |
const TUint KBatteryChargeLevel = 77;
|
|
161 |
|
|
162 |
|
|
163 |
#endif // CCTSYCOMPONENTTESTBASE_H
|
|
164 |
|