author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 24 Nov 2009 08:56:33 +0200 | |
changeset 33 | 50974a8b132e |
parent 22 | fc9cf246af83 |
permissions | -rw-r--r-- |
19 | 1 |
/* |
2 |
* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: ?Description |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#ifndef TMEDIAPROVIDERTESTING_H |
|
21 |
#define TMEDIAPROVIDERTESTING_H |
|
22 |
||
23 |
// INCLUDES |
|
24 |
#include <StifLogger.h> |
|
25 |
#include <TestScripterInternal.h> |
|
26 |
#include <StifTestModule.h> |
|
27 |
#include <TestclassAssert.h> |
|
28 |
||
33
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
29 |
#include <liwcommon.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
30 |
#include <liwbufferextension.h> |
50974a8b132e
Revision: 200945
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
22
diff
changeset
|
31 |
#include <liwservicehandler.h> |
19 | 32 |
|
33 |
// CONSTANTS |
|
34 |
//const ?type ?constant_var = ?constant; |
|
35 |
||
36 |
// MACROS |
|
37 |
//#define ?macro ?macro_def |
|
38 |
#define TEST_CLASS_VERSION_MAJOR 0 |
|
39 |
#define TEST_CLASS_VERSION_MINOR 0 |
|
40 |
#define TEST_CLASS_VERSION_BUILD 0 |
|
41 |
||
42 |
// Logging path |
|
43 |
_LIT( KtmediaprovidertestingLogPath, "\\logs\\testframework\\" ); |
|
44 |
// Log file |
|
45 |
_LIT( KtmediaprovidertestingLogFile, "tmediaprovidertesting.txt" ); |
|
46 |
_LIT( KtmediaprovidertestingLogFileWithTitle, "tmediaprovidertesting_[%S].txt" ); |
|
47 |
||
48 |
class Ctmediaprovidertesting; |
|
49 |
||
50 |
/** |
|
51 |
* Ctmediaprovidertesting test class for STIF Test Framework TestScripter. |
|
52 |
* ?other_description_lines |
|
53 |
* |
|
54 |
* @lib ?library |
|
55 |
* @since ?Series60_version |
|
56 |
*/ |
|
57 |
NONSHARABLE_CLASS(Ctmediaprovidertesting) : public CScriptBase, public MLiwNotifyCallback |
|
58 |
{ |
|
59 |
public: |
|
60 |
enum TFileType |
|
61 |
{ |
|
62 |
EOtherFile, |
|
63 |
EMusicFile, |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
64 |
EStreamingURLFile, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
65 |
EImageFile |
19 | 66 |
}; |
67 |
public: // Constructors and destructor |
|
68 |
||
69 |
/** |
|
70 |
* Two-phased constructor. |
|
71 |
*/ |
|
72 |
static Ctmediaprovidertesting* NewL( CTestModuleIf& aTestModuleIf ); |
|
73 |
||
74 |
/** |
|
75 |
* Destructor. |
|
76 |
*/ |
|
77 |
virtual ~Ctmediaprovidertesting(); |
|
78 |
||
79 |
||
80 |
public: // New functions |
|
81 |
/** |
|
82 |
* A static method which compares two result maps. This mehtod compares image,sound and video maps. |
|
83 |
* @return ETrue OR EFalse. |
|
84 |
*/ |
|
85 |
TBool Ctmediaprovidertesting::CompareMaps(CLiwMap* aExpectedMap, |
|
86 |
const CLiwMap* aResultMap); |
|
87 |
/** |
|
88 |
* A static method which compares two strings from the maps. |
|
89 |
* @param aKey key value to be compared. |
|
90 |
* @param aExpectedMap the expected result map. |
|
91 |
* @param aResultMap the fetched result map. |
|
92 |
* @return ETrue OR EFalse. |
|
93 |
*/ |
|
94 |
TBool Ctmediaprovidertesting::CompareStringResult(const TDesC8& aKey, |
|
95 |
CLiwMap* aExpectedMap, |
|
96 |
const CLiwMap* aResultMap); |
|
97 |
||
98 |
/** |
|
99 |
* A static method which compares two TTime values from the maps. |
|
100 |
* @param aKey key value to be compared. |
|
101 |
* @param aExpectedMap the expected result map. |
|
102 |
* @param aResultMap the fetched result map. |
|
103 |
* @return ETrue OR EFalse. |
|
104 |
*/ |
|
105 |
TBool Ctmediaprovidertesting::CompareTTimeResult(const TDesC8& aKey, |
|
106 |
CLiwMap* aExpectedMap, |
|
107 |
const CLiwMap* aResultMap); |
|
108 |
||
109 |
/** |
|
110 |
* A static method which compares two TTime values from the maps. |
|
111 |
* @param aKey key value to be compared. |
|
112 |
* @param aExpectedMap the expected result map. |
|
113 |
* @param aResultMap the fetched result map. |
|
114 |
* @return ETrue OR EFalse. |
|
115 |
*/ |
|
116 |
TBool Ctmediaprovidertesting::CompareTIntResult(const TDesC8& aKey, |
|
117 |
CLiwMap* aExpectedMap, |
|
118 |
const CLiwMap* aResultMap); |
|
119 |
public: // Functions from base classes |
|
120 |
||
121 |
/** |
|
122 |
* From CScriptBase Runs a script line. |
|
123 |
* @param aItem Script line containing method name and parameters. |
|
124 |
* @return Symbian OS error code. |
|
125 |
*/ |
|
126 |
virtual TInt RunMethodL(CStifItemParser& aItem); |
|
127 |
||
128 |
/** |
|
129 |
* From the MLiwNotifyCallback interface it is called by the media management service. |
|
130 |
* @param aCmdId Script line containing method name and parameters. |
|
131 |
* @return Symbian OS error code. |
|
132 |
*/ |
|
133 |
TInt HandleNotifyL(TInt aCmdId, |
|
134 |
TInt aEventId, |
|
135 |
CLiwGenericParamList& aEventParamList, |
|
136 |
const CLiwGenericParamList& aInParamList); |
|
137 |
private: |
|
138 |
||
139 |
/** |
|
140 |
* C++ default constructor. |
|
141 |
*/ |
|
142 |
Ctmediaprovidertesting(CTestModuleIf& aTestModuleIf); |
|
143 |
/** |
|
144 |
* By default Symbian 2nd phase constructor is private. |
|
145 |
*/ |
|
146 |
void ConstructL(); |
|
147 |
/** |
|
148 |
* Frees all resources allocated from test methods. |
|
149 |
*/ |
|
150 |
void Delete(); |
|
151 |
/** |
|
152 |
* Test methods are listed below. |
|
153 |
*/ |
|
154 |
/** |
|
155 |
* Example test method. |
|
156 |
* @since ?Series60_version |
|
157 |
* @param aItem Script line containing parameters. |
|
158 |
* @return Symbian OS error code. |
|
159 |
*/ |
|
160 |
TInt GetFilesListL(CStifItemParser& aItem); |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
161 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
162 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
163 |
* Example test method. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
164 |
* @since ?Series60_version |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
165 |
* @param aItem Script line containing parameters. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
166 |
* @return Symbian OS error code. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
167 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
168 |
TInt GetListBackToBackCallL(CStifItemParser& aItem); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
169 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
170 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
171 |
|
19 | 172 |
/** |
173 |
* loades the media management service. |
|
174 |
* @return MLiwInterface pointer. |
|
175 |
*/ |
|
176 |
void LoadServiceL(); |
|
177 |
/** |
|
178 |
* This method checks whether the obtained result and the expected results match. |
|
179 |
* @param aResultlist a list of maps as iterator to be compared with expected output. |
|
180 |
* @return Symbian OS error code. |
|
181 |
*/ |
|
182 |
TBool IsExpectedResult(CLiwIterable* aResultlist); |
|
183 |
/** |
|
184 |
* This method parses the input from cfg file and prepare the input list. |
|
185 |
* @param aItem input list contaning input params from cfg file. |
|
186 |
* @return Symbian OS error code. |
|
187 |
*/ |
|
188 |
void ParseStiffInput(CStifItemParser& aItem); |
|
189 |
/** |
|
190 |
* This method parses the input from cfg file and prepare the Expected out put list. |
|
191 |
* @param aItem input list contaning input params from cfg file. |
|
192 |
* @return Symbian OS error code. |
|
193 |
*/ |
|
194 |
void SetExpectedOutputMap(CStifItemParser& aItem); |
|
195 |
/** |
|
196 |
* Method used to log version of test class |
|
197 |
*/ |
|
198 |
void SendTestClassVersion(); |
|
199 |
private: // Data |
|
200 |
//An array to hold the expected result maps. |
|
201 |
RPointerArray <CLiwMap> iExpectedOutPutArray; |
|
202 |
//the expected output error code |
|
203 |
TInt iExpErrorCode; |
|
204 |
//result of the test case. |
|
205 |
TInt iResult; |
|
206 |
//input parameter list |
|
207 |
CLiwGenericParamList* iInList; |
|
208 |
//output parameter list |
|
209 |
CLiwGenericParamList* iOutList; |
|
210 |
//service handler pointer |
|
211 |
CLiwServiceHandler* iServicehandler; |
|
212 |
//interface handle |
|
213 |
MLiwInterface* iIface; |
|
214 |
//file type |
|
22
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
215 |
TFileType iFiletype; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
216 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
217 |
// Number of back to back async request given |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
19
diff
changeset
|
218 |
TInt iNumberApiCall ; |
19 | 219 |
}; |
220 |
#endif // TMEDIAPROVIDERTESTING_H |
|
221 |
// End of File |