Update contrib.
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #if (!defined __CONSUMER_STEP_H__)
22 #define __CONSUMER_STEP_H__
23 #include <test/testexecutestepbase.h>
27 // Constants used to name test cases
28 _LIT(KCAFSizeStep,"CAFSizeStep");
29 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
30 _LIT(KCAFSizeStep64,"CAFSizeStep64");
31 _LIT(KCAFSeekReadStep64,"CAFSeekReadStep64");
32 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
33 _LIT(KCAFSeekReadStep,"CAFSeekReadStep");
34 _LIT(KCAFAttributesStep,"CAFAttributesStep");
35 _LIT(KCAFStringAttributesStep,"CAFStringAttributesStep");
36 _LIT(KCAFMultiThreadCDataStep,"CAFMultiThreadCDataStep");
37 _LIT(KCAFMimeTypeCDataStep,"CAFMimeTypeCDataStep");
38 _LIT(KCAFShareModeStep,"CAFShareModeStep");
39 _LIT(KCAFHandleSizeStep,"CAFHandleSizeStep");
40 _LIT(KCAFHandleSeekReadStep,"CAFHandleSeekReadStep");
41 _LIT(KCAFHandleMultiThreadCDataStep,"CAFHandleMultiThreadCDataStep");
42 _LIT(KCAFDataAttributeStep,"CAFDataAttributeStep");
43 _LIT(KCAFDataAttributeSetStep,"CAFDataAttributeSetStep");
44 _LIT(KCAFDataStringAttributeStep,"CAFDataStringAttributeStep");
45 _LIT(KCAFDataStringAttributeSetStep,"CAFDataStringAttributeSetStep");
46 _LIT(KCAFExecuteIntentStep,"CAFExecuteIntentStep");
47 _LIT(KCAFDRMFileOpenPerformanceStep, "CAFDRMFileOpenPerformanceStep");
49 //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
50 _LIT(KWmdrmCAFContentStep,"WmdrmCAFContentStep");
51 _LIT(KWmdrmCAFDataStep,"WmdrmCAFDataStep");
52 _LIT(KWmdrmCAFReadStep, "WmdrmCAFReadStep");
53 //#endif //SYMBIAN_SDP-WMDRM
56 * Used to open one file with RFile and the DRM packaged version of the same file with
57 * CContent::Open() and compare the reported sizes
58 * It can be used with two identical, non DRM file to check the operation of F32Agent
59 * The ini file used with this test expects only one parameter
61 * URI1 - The name of the file used for this test
64 class CCAFSizeStep : public CCAFStep
67 CCAFSizeStep(CCAFServer& aParent);
69 virtual TVerdict doTestStepL();
75 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
77 * 64bit version of CCAFSizeStep
78 * If the agent to be tested implemented 64bit functions, this test step will test 64bit functions
79 * under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step
80 * can also ensure that fallback to 32bit functions works properly
82 class CCAFSizeStep64 : public CCAFStep
85 CCAFSizeStep64(CCAFServer& aParent);
87 virtual TVerdict doTestStepL();
91 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
94 * Used to test file Seek and Read operations on DRM protected content.
95 * Opens one file with RFile and the DRM packaged version of the same file with
96 * CContent::Open() and does a series of Seek and Read operations.
97 * Verifies that the CAF and the agent corresponding to the DRM content implement
98 * all polymorphic versions of Read() and Seek() correctly
99 * It can also be used with two identical, non DRM file to check the operation of F32Agent
100 * The ini file used with this test expects only one parameter
102 * URI1 - The name of the file used for this test
105 class CCAFSeekReadStep : public CCAFStep
108 CCAFSeekReadStep(CCAFServer& aParent);
110 virtual TVerdict doTestStepL();
112 void StandardCheckReturnValue(TInt aReturnValue);
117 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
119 * 64bit version of CAFSeekReadStep
120 * If the agent to be tested implemented 64bit functions, this test step will test 64bit functions
121 * under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step
122 * can also ensure that fallback to 32bit functions works properly
125 class CCAFSeekReadStep64 : public CCAFStep
128 CCAFSeekReadStep64(CCAFServer& aParent);
129 ~CCAFSeekReadStep64();
130 virtual TVerdict doTestStepL();
132 void StandardCheckReturnValue(TInt aReturnValue);
136 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
139 * Used to test CContent::Attributes()
140 * The INI file specifies the file to retrieve the attributes from.
143 class CCAFAttributesStep : public CCAFStep
146 CCAFAttributesStep(CCAFServer& aParent);
147 ~CCAFAttributesStep();
148 virtual TVerdict doTestStepL();
155 * Used to test Content::StringAttributes()
156 * The INI file specifies the file to retrieve the attributes from.
159 class CCAFStringAttributesStep : public CCAFStep
162 CCAFStringAttributesStep(CCAFServer& aParent);
163 ~CCAFStringAttributesStep();
164 virtual TVerdict doTestStepL();
172 * Used to test multi-threaded read from CContent
175 class CCAFMultiThreadCDataStep : public CCAFStep
178 CCAFMultiThreadCDataStep(CCAFServer& aParent);
179 ~CCAFMultiThreadCDataStep();
180 virtual TVerdict doTestStepL();
181 static TInt ReaderThreadEntry(TAny *aPtr);
188 * Used to test finding the mime type from CData
191 class CCAFMimeTypeCDataStep: public CCAFStep
194 CCAFMimeTypeCDataStep(CCAFServer& aParent);
195 ~CCAFMimeTypeCDataStep();
196 virtual TVerdict doTestStepL();
197 static TInt ReaderThreadEntry(TAny *aPtr);
203 * Used to test content sharing modes
206 class CCAFShareModeStep: public CCAFStep
209 CCAFShareModeStep(CCAFServer& aParent);
210 ~CCAFShareModeStep();
211 virtual TVerdict doTestStepL();
212 TVerdict doShareModeStepL();
219 * Used to open one file with RFile and the DRM packaged version of the same file with
220 * CContent::Open() by passing RFile handle and compare the reported sizes
221 * It can be used with two identical, non DRM file to check the operation of F32Agent
222 * The ini file used with this test expects only one parameter
224 * URI1 - The name of the file used for this test
227 class CCAFHandleSizeStep : public CCAFStep
230 CCAFHandleSizeStep(CCAFServer& aParent);
231 ~CCAFHandleSizeStep();
232 virtual TVerdict doTestStepL();
238 * Used to test file Seek and Read operations on DRM protected content.
239 * Opens one file with RFile and the DRM packaged version of the same file with
240 * CContent::Open() by passing RFile handle and does a series of Seek and Read operations.
241 * Verifies that the CAF and the agent corresponding to the DRM content implement
242 * all polymorphic versions of Read() and Seek() correctly
243 * It can also be used with two identical, non DRM file to check the operation of F32Agent
244 * The ini file used with this test expects only one parameter
246 * URI1 - The name of the file used for this test
248 class CCAFHandleSeekReadStep : public CCAFStep
251 CCAFHandleSeekReadStep(CCAFServer& aParent);
252 ~CCAFHandleSeekReadStep();
253 virtual TVerdict doTestStepL();
259 * Used to test multi-threaded read from CContent
262 class CCAFHandleMultiThreadCDataStep : public CCAFStep
265 CCAFHandleMultiThreadCDataStep(CCAFServer& aParent);
266 ~CCAFHandleMultiThreadCDataStep();
267 virtual TVerdict doTestStepL();
268 static TInt ReaderThreadEntry(TAny *aPtr);
274 * Used to test CManager::GetAttribute()
275 * The INI file specifies the file to delete and the expected return code.
276 * For instance this can be used to try and delete a file that does not exist or a file
277 * that is read-only or has rights that don't allow it to be deleted
278 * INI file paramerters
281 * @internalComponent Exposure internally
283 class CCAFDataAttributeStep : public CCAFStep
286 CCAFDataAttributeStep(CCAFServer& aParent);
287 ~CCAFDataAttributeStep();
288 virtual TVerdict doTestStepL();
289 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
290 TVerdict doWmdrmTestStepL();
291 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
297 * Used to test CManager::GetAttributeSet()
298 * The INI file specifies the file to delete and the expected return code.
299 * For instance this can be used to try and delete a file that does not exist or a file
300 * that is read-only or has rights that don't allow it to be deleted
301 * INI file paramerters
304 * @internalComponent Exposure internally
306 class CCAFDataAttributeSetStep : public CCAFStep
309 CCAFDataAttributeSetStep(CCAFServer& aParent);
310 ~CCAFDataAttributeSetStep();
311 virtual TVerdict doTestStepL();
312 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
313 TVerdict doWmdrmTestStepL();
314 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
320 * Used to test CContent::GetAttribute()
321 * The INI file specifies the file to delete and the expected return code.
322 * For instance this can be used to try and delete a file that does not exist or a file
323 * that is read-only or has rights that don't allow it to be deleted
324 * INI file paramerters
327 * @internalComponent Exposure internally
329 class CCAFDataStringAttributeStep : public CCAFStep
332 CCAFDataStringAttributeStep(CCAFServer& aParent);
333 ~CCAFDataStringAttributeStep();
334 virtual TVerdict doTestStepL();
335 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
336 TVerdict doWmdrmTestStepL();
337 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
343 * Used to test CData::GetStringAttributeSet()
344 * The INI file specifies the file to delete and the expected return code.
345 * For instance this can be used to try and delete a file that does not exist or a file
346 * that is read-only or has rights that don't allow it to be deleted
347 * INI file paramerters
350 * @internalComponent Exposure internally
352 class CCAFDataStringAttributeSetStep : public CCAFStep
355 CCAFDataStringAttributeSetStep(CCAFServer& aParent);
356 ~CCAFDataStringAttributeSetStep();
357 virtual TVerdict doTestStepL();
358 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
359 TVerdict doWmdrmTestStepL();
360 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
365 class CCAFExecuteIntentStep : public CCAFStep
368 CCAFExecuteIntentStep(CCAFServer& aParent);
369 ~CCAFExecuteIntentStep();
370 virtual TVerdict doTestStepL();
376 * Used to test DRM File Open perfomance.
377 * The INI file specifies the file to be opened , the iteration count and the maximum time limit for
378 * file open operation(in millisecs).
379 * If the obtained time doesn't fall within the provided limit (in the INI parameters) , the test case fails.
381 * @internalComponent Exposure internally
384 class CCAFDRMFileOpenPerformanceTest : public CCAFStep
387 CCAFDRMFileOpenPerformanceTest(CCAFServer& aParent);
388 ~CCAFDRMFileOpenPerformanceTest();
389 virtual TVerdict doTestStepL();
392 // Read content from file using CAF
393 void OpenAndReadFileContentL(const TDesC& aFileName);
398 TUint32 iIterationSum;
401 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
402 /* Used to test behaviour of CContent object creation and attribute APIs for WMDRM content. +-
403 * @internalComponent Exposure internally
405 class CWmdrmCAFContentStep : public CCAFStep
408 CWmdrmCAFContentStep();
409 ~CWmdrmCAFContentStep();
410 virtual TVerdict doTestStepL();
414 /* Used to test the behaviour of CData object creation and attribute APIs for WMDRM content.
415 * @internalComponent Exposure internally
417 class CWmdrmCAFDataStep : public CCAFStep
421 ~CWmdrmCAFDataStep();
422 virtual TVerdict doTestStepL();
426 /* Used to test synchronous and asynchronous behaviour of ReadL() APIs of CData class for WMDRM content.
427 * @internalComponent Exposure internally
429 class CWmdrmCAFReadStep : public CCAFStep
433 ~CWmdrmCAFReadStep();
434 virtual TVerdict doTestStepL();
437 TInt TestSynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput);
438 TInt TestAsynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput);
441 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT