44
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
46
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
44
|
6 |
* which accompanies this distribution, and is available
|
46
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
44
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef USBUINOTIFAPITEST_H
|
|
19 |
#define USBUINOTIFAPITEST_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <StifLogger.h>
|
|
23 |
#include <TestScripterInternal.h>
|
|
24 |
#include <StifTestModule.h>
|
|
25 |
#include <TestclassAssert.h>
|
|
26 |
|
|
27 |
#include <usbuinotif.h>
|
|
28 |
#include <usbpersonalityids.h>
|
|
29 |
#include <centralrepository.h>
|
|
30 |
#include <UsbWatcherInternalCRKeys.h>
|
|
31 |
#include <usbman.h>
|
|
32 |
#include <usbwatcher.h>
|
|
33 |
#include <usb/hostms/srverr.h>
|
|
34 |
// CONSTANTS
|
|
35 |
|
|
36 |
// MACROS
|
|
37 |
#define TEST_CLASS_VERSION_MAJOR 0
|
|
38 |
#define TEST_CLASS_VERSION_MINOR 0
|
|
39 |
#define TEST_CLASS_VERSION_BUILD 0
|
|
40 |
|
|
41 |
// Logging path
|
52
|
42 |
_LIT( KUSBUiNotifApiTestLogPath, "e:\\testing\\stiflogs\\" );
|
44
|
43 |
|
|
44 |
// Log file
|
52
|
45 |
_LIT( KUSBUiNotifApiTestLogFile, "USBUiNotifApiTest.txt" );
|
|
46 |
_LIT( KUSBUiNotifApiTestLogFileWithTitle, "USBUiNotifApiTest_[%S].txt" );
|
44
|
47 |
|
|
48 |
// FUNCTION PROTOTYPES
|
|
49 |
|
|
50 |
// FORWARD DECLARATIONS
|
52
|
51 |
class CUSBUiNotifApiTest;
|
44
|
52 |
|
|
53 |
// DATA TYPES
|
|
54 |
enum TTestOption
|
|
55 |
{
|
|
56 |
EQueryDiscarded = 0,
|
|
57 |
EQueryAccepted,
|
|
58 |
EQueryCanceled
|
|
59 |
};
|
|
60 |
|
|
61 |
// CLASS DECLARATION
|
|
62 |
|
|
63 |
/**
|
52
|
64 |
* CUSBUiNotifApiTest test class for STIF Test Framework TestScripter.
|
44
|
65 |
* ?other_description_lines
|
|
66 |
*
|
|
67 |
* @lib ?library
|
|
68 |
* @since ?Series60_version
|
|
69 |
*/
|
52
|
70 |
NONSHARABLE_CLASS(CUSBUiNotifApiTest) : public CScriptBase
|
44
|
71 |
{
|
|
72 |
public: // Constructors and destructor
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Two-phased constructor.
|
|
76 |
*/
|
52
|
77 |
static CUSBUiNotifApiTest* NewL( CTestModuleIf& aTestModuleIf );
|
44
|
78 |
|
|
79 |
/**
|
|
80 |
* Destructor.
|
|
81 |
*/
|
52
|
82 |
virtual ~CUSBUiNotifApiTest();
|
44
|
83 |
|
|
84 |
public: // New functions
|
|
85 |
|
|
86 |
public: // Functions from base classes
|
|
87 |
|
|
88 |
/**
|
|
89 |
* From CScriptBase Runs a script line.
|
|
90 |
* @since ?Series60_version
|
|
91 |
* @param aItem Script line containing method name and parameters
|
|
92 |
* @return Symbian OS error code
|
|
93 |
*/
|
|
94 |
virtual TInt RunMethodL( CStifItemParser& aItem );
|
|
95 |
|
|
96 |
protected: // New functions
|
|
97 |
|
|
98 |
protected: // Functions from base classes
|
|
99 |
|
|
100 |
/**
|
|
101 |
* From ?base_class ?member_description
|
|
102 |
*/
|
|
103 |
//?type ?member_function();
|
|
104 |
|
|
105 |
private:
|
|
106 |
|
|
107 |
/**
|
|
108 |
* C++ default constructor.
|
|
109 |
*/
|
52
|
110 |
CUSBUiNotifApiTest( CTestModuleIf& aTestModuleIf );
|
44
|
111 |
|
|
112 |
/**
|
|
113 |
* By default Symbian 2nd phase constructor is private.
|
|
114 |
*/
|
|
115 |
void ConstructL();
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Frees all resources allocated from test methods.
|
|
119 |
* @since ?Series60_version
|
|
120 |
*/
|
|
121 |
void Delete();
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Test methods are listed below.
|
|
125 |
*/
|
52
|
126 |
virtual TInt CableConnectedNotifierTest( CStifItemParser& aItem );
|
|
127 |
virtual TInt FinishCableConnectedQuery( CStifItemParser& aItem );
|
|
128 |
virtual TInt UsbQueriesNotifierTest( CStifItemParser& aItem );
|
|
129 |
virtual TInt UsbOTGErrorNotifierTests( CStifItemParser& aItem );
|
|
130 |
virtual TInt UsbOTGWarningNotifierTests( CStifItemParser& aItem );
|
|
131 |
virtual TInt FinishQuery( CStifItemParser& aItem );
|
|
132 |
virtual TInt LoadNotifiersL( CStifItemParser& aItem );
|
|
133 |
virtual TInt UnLoadNotifiers ( CStifItemParser& aItem );
|
|
134 |
virtual TInt UsbMSMMNotifierTests ( CStifItemParser& aItem );
|
|
135 |
virtual TInt CancelMsmmNotifier( CStifItemParser& aItem );
|
|
136 |
virtual TInt CancelQueryNotifier( CStifItemParser& aItem );
|
|
137 |
virtual TInt CancelOtgErrorNotifier( CStifItemParser& aItem );
|
|
138 |
virtual TInt CancelOtgWarningNotifier( CStifItemParser& aItem );
|
|
139 |
virtual TInt CancelCableConnectedNotifier( CStifItemParser& aItem );
|
|
140 |
virtual TInt WaitForRequest( CStifItemParser& aItem );
|
|
141 |
virtual TInt SynchStart( CStifItemParser& aItem );
|
|
142 |
virtual TInt Update( CStifItemParser& aItem );
|
44
|
143 |
/**
|
|
144 |
* Method used to log version of test class
|
|
145 |
*/
|
|
146 |
void SendTestClassVersion();
|
|
147 |
|
|
148 |
//ADD NEW METHOD DEC HERE
|
|
149 |
//[TestMethods] - Do not remove
|
|
150 |
TInt GetTestOption( TPtrC aOptionString, TTestOption& aOption );
|
|
151 |
TInt GetPersonalityIdFromString( TPtrC aOptionString, TInt& aPersonalityId );
|
|
152 |
TInt GetQueryType( TPtrC aTypeString, TUSBUIQueries& aQueryType );
|
|
153 |
TInt GetOTGErrorType( TPtrC aTypeString, TUsbUiNotifOtgError& aQueryType );
|
|
154 |
TInt GetOTGWarningType( TPtrC aTypeString, TUsbUiNotifOtgWarning& aQueryType );
|
|
155 |
TInt GetMSMMrrorType( TPtrC aTypeString, THostMsErrCode& aQueryType );
|
52
|
156 |
TInt FindAndKillProcess(const TDesC& aProcessName);
|
44
|
157 |
|
|
158 |
public: // Data
|
|
159 |
|
|
160 |
protected: // Data
|
|
161 |
|
|
162 |
private: // Data
|
52
|
163 |
|
44
|
164 |
RNotifier *iNotifier;
|
52
|
165 |
TBool iNotifierConnected;
|
44
|
166 |
RUsbWatcher* iUsbWatcher;
|
|
167 |
|
|
168 |
CRepository* iRepository;
|
|
169 |
|
|
170 |
TUSBConnectionNotifierParamsPckg iConnectionNotifierResponseParamsPckg;
|
|
171 |
TRequestStatus iReqStatus;
|
|
172 |
TInt iPersonalityIdBackup;
|
|
173 |
TBool iCompleteQuery;
|
|
174 |
TPckg<TInt> iRes;
|
|
175 |
CArrayPtr<MEikSrvNotifierBase2>* iNotifierArray;
|
|
176 |
TUid iInstanceUid;
|
|
177 |
THostMsErrData iErrData;
|
|
178 |
THostMsErrorDataPckg iErrPckg ;
|
|
179 |
|
|
180 |
public: // Friend classes
|
|
181 |
//?friend_class_declaration;
|
|
182 |
protected: // Friend classes
|
|
183 |
//?friend_class_declaration;
|
|
184 |
private: // Friend classes
|
|
185 |
//?friend_class_declaration;
|
52
|
186 |
|
44
|
187 |
};
|
|
188 |
|
|
189 |
#endif // USBUINOTIFAPITEST_H
|
|
190 |
|
|
191 |
// End of File
|