|
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 |
|
29 #include <LiwCommon.h> |
|
30 #include <LiwBufferExtension.h> |
|
31 #include <LiwServiceHandler.h> |
|
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, |
|
64 EStreamingURLFile |
|
65 }; |
|
66 public: // Constructors and destructor |
|
67 |
|
68 /** |
|
69 * Two-phased constructor. |
|
70 */ |
|
71 static Ctmediaprovidertesting* NewL( CTestModuleIf& aTestModuleIf ); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 virtual ~Ctmediaprovidertesting(); |
|
77 |
|
78 |
|
79 public: // New functions |
|
80 /** |
|
81 * A static method which compares two result maps. This mehtod compares image,sound and video maps. |
|
82 * @return ETrue OR EFalse. |
|
83 */ |
|
84 TBool Ctmediaprovidertesting::CompareMaps(CLiwMap* aExpectedMap, |
|
85 const CLiwMap* aResultMap); |
|
86 /** |
|
87 * A static method which compares two strings from the maps. |
|
88 * @param aKey key value to be compared. |
|
89 * @param aExpectedMap the expected result map. |
|
90 * @param aResultMap the fetched result map. |
|
91 * @return ETrue OR EFalse. |
|
92 */ |
|
93 TBool Ctmediaprovidertesting::CompareStringResult(const TDesC8& aKey, |
|
94 CLiwMap* aExpectedMap, |
|
95 const CLiwMap* aResultMap); |
|
96 |
|
97 /** |
|
98 * A static method which compares two TTime values from the maps. |
|
99 * @param aKey key value to be compared. |
|
100 * @param aExpectedMap the expected result map. |
|
101 * @param aResultMap the fetched result map. |
|
102 * @return ETrue OR EFalse. |
|
103 */ |
|
104 TBool Ctmediaprovidertesting::CompareTTimeResult(const TDesC8& aKey, |
|
105 CLiwMap* aExpectedMap, |
|
106 const CLiwMap* aResultMap); |
|
107 |
|
108 /** |
|
109 * A static method which compares two TTime values from the maps. |
|
110 * @param aKey key value to be compared. |
|
111 * @param aExpectedMap the expected result map. |
|
112 * @param aResultMap the fetched result map. |
|
113 * @return ETrue OR EFalse. |
|
114 */ |
|
115 TBool Ctmediaprovidertesting::CompareTIntResult(const TDesC8& aKey, |
|
116 CLiwMap* aExpectedMap, |
|
117 const CLiwMap* aResultMap); |
|
118 public: // Functions from base classes |
|
119 |
|
120 /** |
|
121 * From CScriptBase Runs a script line. |
|
122 * @param aItem Script line containing method name and parameters. |
|
123 * @return Symbian OS error code. |
|
124 */ |
|
125 virtual TInt RunMethodL(CStifItemParser& aItem); |
|
126 |
|
127 /** |
|
128 * From the MLiwNotifyCallback interface it is called by the media management service. |
|
129 * @param aCmdId Script line containing method name and parameters. |
|
130 * @return Symbian OS error code. |
|
131 */ |
|
132 TInt HandleNotifyL(TInt aCmdId, |
|
133 TInt aEventId, |
|
134 CLiwGenericParamList& aEventParamList, |
|
135 const CLiwGenericParamList& aInParamList); |
|
136 private: |
|
137 |
|
138 /** |
|
139 * C++ default constructor. |
|
140 */ |
|
141 Ctmediaprovidertesting(CTestModuleIf& aTestModuleIf); |
|
142 /** |
|
143 * By default Symbian 2nd phase constructor is private. |
|
144 */ |
|
145 void ConstructL(); |
|
146 /** |
|
147 * Frees all resources allocated from test methods. |
|
148 */ |
|
149 void Delete(); |
|
150 /** |
|
151 * Test methods are listed below. |
|
152 */ |
|
153 /** |
|
154 * Example test method. |
|
155 * @since ?Series60_version |
|
156 * @param aItem Script line containing parameters. |
|
157 * @return Symbian OS error code. |
|
158 */ |
|
159 TInt GetFilesListL(CStifItemParser& aItem); |
|
160 /** |
|
161 * loades the media management service. |
|
162 * @return MLiwInterface pointer. |
|
163 */ |
|
164 void LoadServiceL(); |
|
165 /** |
|
166 * This method checks whether the obtained result and the expected results match. |
|
167 * @param aResultlist a list of maps as iterator to be compared with expected output. |
|
168 * @return Symbian OS error code. |
|
169 */ |
|
170 TBool IsExpectedResult(CLiwIterable* aResultlist); |
|
171 /** |
|
172 * This method parses the input from cfg file and prepare the input list. |
|
173 * @param aItem input list contaning input params from cfg file. |
|
174 * @return Symbian OS error code. |
|
175 */ |
|
176 void ParseStiffInput(CStifItemParser& aItem); |
|
177 /** |
|
178 * This method parses the input from cfg file and prepare the Expected out put list. |
|
179 * @param aItem input list contaning input params from cfg file. |
|
180 * @return Symbian OS error code. |
|
181 */ |
|
182 void SetExpectedOutputMap(CStifItemParser& aItem); |
|
183 /** |
|
184 * Method used to log version of test class |
|
185 */ |
|
186 void SendTestClassVersion(); |
|
187 private: // Data |
|
188 //An array to hold the expected result maps. |
|
189 RPointerArray <CLiwMap> iExpectedOutPutArray; |
|
190 //the expected output error code |
|
191 TInt iExpErrorCode; |
|
192 //result of the test case. |
|
193 TInt iResult; |
|
194 //input parameter list |
|
195 CLiwGenericParamList* iInList; |
|
196 //output parameter list |
|
197 CLiwGenericParamList* iOutList; |
|
198 //service handler pointer |
|
199 CLiwServiceHandler* iServicehandler; |
|
200 //interface handle |
|
201 MLiwInterface* iIface; |
|
202 //file type |
|
203 TFileType iFiletype; |
|
204 }; |
|
205 #endif // TMEDIAPROVIDERTESTING_H |
|
206 // End of File |