sl@0: /* sl@0: * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: #if (!defined __CONSUMER_STEP_H__) sl@0: #define __CONSUMER_STEP_H__ sl@0: #include sl@0: sl@0: #include "cafstep.h" sl@0: sl@0: // Constants used to name test cases sl@0: _LIT(KCAFSizeStep,"CAFSizeStep"); sl@0: #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API sl@0: _LIT(KCAFSizeStep64,"CAFSizeStep64"); sl@0: _LIT(KCAFSeekReadStep64,"CAFSeekReadStep64"); sl@0: #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API sl@0: _LIT(KCAFSeekReadStep,"CAFSeekReadStep"); sl@0: _LIT(KCAFAttributesStep,"CAFAttributesStep"); sl@0: _LIT(KCAFStringAttributesStep,"CAFStringAttributesStep"); sl@0: _LIT(KCAFMultiThreadCDataStep,"CAFMultiThreadCDataStep"); sl@0: _LIT(KCAFMimeTypeCDataStep,"CAFMimeTypeCDataStep"); sl@0: _LIT(KCAFShareModeStep,"CAFShareModeStep"); sl@0: _LIT(KCAFHandleSizeStep,"CAFHandleSizeStep"); sl@0: _LIT(KCAFHandleSeekReadStep,"CAFHandleSeekReadStep"); sl@0: _LIT(KCAFHandleMultiThreadCDataStep,"CAFHandleMultiThreadCDataStep"); sl@0: _LIT(KCAFDataAttributeStep,"CAFDataAttributeStep"); sl@0: _LIT(KCAFDataAttributeSetStep,"CAFDataAttributeSetStep"); sl@0: _LIT(KCAFDataStringAttributeStep,"CAFDataStringAttributeStep"); sl@0: _LIT(KCAFDataStringAttributeSetStep,"CAFDataStringAttributeSetStep"); sl@0: _LIT(KCAFExecuteIntentStep,"CAFExecuteIntentStep"); sl@0: _LIT(KCAFDRMFileOpenPerformanceStep, "CAFDRMFileOpenPerformanceStep"); sl@0: sl@0: //#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: _LIT(KWmdrmCAFContentStep,"WmdrmCAFContentStep"); sl@0: _LIT(KWmdrmCAFDataStep,"WmdrmCAFDataStep"); sl@0: _LIT(KWmdrmCAFReadStep, "WmdrmCAFReadStep"); sl@0: //#endif //SYMBIAN_SDP-WMDRM sl@0: sl@0: /* sl@0: * Used to open one file with RFile and the DRM packaged version of the same file with sl@0: * CContent::Open() and compare the reported sizes sl@0: * It can be used with two identical, non DRM file to check the operation of F32Agent sl@0: * The ini file used with this test expects only one parameter sl@0: * sl@0: * URI1 - The name of the file used for this test sl@0: * sl@0: */ sl@0: class CCAFSizeStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFSizeStep(CCAFServer& aParent); sl@0: ~CCAFSizeStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: sl@0: #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API sl@0: /* sl@0: * 64bit version of CCAFSizeStep sl@0: * If the agent to be tested implemented 64bit functions, this test step will test 64bit functions sl@0: * under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step sl@0: * can also ensure that fallback to 32bit functions works properly sl@0: */ sl@0: class CCAFSizeStep64 : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFSizeStep64(CCAFServer& aParent); sl@0: ~CCAFSizeStep64(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API sl@0: sl@0: /* sl@0: * Used to test file Seek and Read operations on DRM protected content. sl@0: * Opens one file with RFile and the DRM packaged version of the same file with sl@0: * CContent::Open() and does a series of Seek and Read operations. sl@0: * Verifies that the CAF and the agent corresponding to the DRM content implement sl@0: * all polymorphic versions of Read() and Seek() correctly sl@0: * It can also be used with two identical, non DRM file to check the operation of F32Agent sl@0: * The ini file used with this test expects only one parameter sl@0: * sl@0: * URI1 - The name of the file used for this test sl@0: * sl@0: */ sl@0: class CCAFSeekReadStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFSeekReadStep(CCAFServer& aParent); sl@0: ~CCAFSeekReadStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: void StandardCheckReturnValue(TInt aReturnValue); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API sl@0: /* sl@0: * 64bit version of CAFSeekReadStep sl@0: * If the agent to be tested implemented 64bit functions, this test step will test 64bit functions sl@0: * under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step sl@0: * can also ensure that fallback to 32bit functions works properly sl@0: * sl@0: */ sl@0: class CCAFSeekReadStep64 : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFSeekReadStep64(CCAFServer& aParent); sl@0: ~CCAFSeekReadStep64(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: void StandardCheckReturnValue(TInt aReturnValue); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API sl@0: sl@0: /* sl@0: * Used to test CContent::Attributes() sl@0: * The INI file specifies the file to retrieve the attributes from. sl@0: * @internalComponent sl@0: */ sl@0: class CCAFAttributesStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFAttributesStep(CCAFServer& aParent); sl@0: ~CCAFAttributesStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: sl@0: /* sl@0: * Used to test Content::StringAttributes() sl@0: * The INI file specifies the file to retrieve the attributes from. sl@0: * @internalComponent sl@0: */ sl@0: class CCAFStringAttributesStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFStringAttributesStep(CCAFServer& aParent); sl@0: ~CCAFStringAttributesStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: sl@0: sl@0: /* sl@0: * Used to test multi-threaded read from CContent sl@0: * @internalComponent sl@0: */ sl@0: class CCAFMultiThreadCDataStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFMultiThreadCDataStep(CCAFServer& aParent); sl@0: ~CCAFMultiThreadCDataStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: static TInt ReaderThreadEntry(TAny *aPtr); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: sl@0: /* sl@0: * Used to test finding the mime type from CData sl@0: * @internalComponent sl@0: */ sl@0: class CCAFMimeTypeCDataStep: public CCAFStep sl@0: { sl@0: public: sl@0: CCAFMimeTypeCDataStep(CCAFServer& aParent); sl@0: ~CCAFMimeTypeCDataStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: static TInt ReaderThreadEntry(TAny *aPtr); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test content sharing modes sl@0: * @internalComponent sl@0: */ sl@0: class CCAFShareModeStep: public CCAFStep sl@0: { sl@0: public: sl@0: CCAFShareModeStep(CCAFServer& aParent); sl@0: ~CCAFShareModeStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: TVerdict doShareModeStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: sl@0: /* sl@0: * Used to open one file with RFile and the DRM packaged version of the same file with sl@0: * CContent::Open() by passing RFile handle and compare the reported sizes sl@0: * It can be used with two identical, non DRM file to check the operation of F32Agent sl@0: * The ini file used with this test expects only one parameter sl@0: * sl@0: * URI1 - The name of the file used for this test sl@0: * sl@0: */ sl@0: class CCAFHandleSizeStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFHandleSizeStep(CCAFServer& aParent); sl@0: ~CCAFHandleSizeStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test file Seek and Read operations on DRM protected content. sl@0: * Opens one file with RFile and the DRM packaged version of the same file with sl@0: * CContent::Open() by passing RFile handle and does a series of Seek and Read operations. sl@0: * Verifies that the CAF and the agent corresponding to the DRM content implement sl@0: * all polymorphic versions of Read() and Seek() correctly sl@0: * It can also be used with two identical, non DRM file to check the operation of F32Agent sl@0: * The ini file used with this test expects only one parameter sl@0: * sl@0: * URI1 - The name of the file used for this test sl@0: */ sl@0: class CCAFHandleSeekReadStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFHandleSeekReadStep(CCAFServer& aParent); sl@0: ~CCAFHandleSeekReadStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test multi-threaded read from CContent sl@0: * @internalComponent sl@0: */ sl@0: class CCAFHandleMultiThreadCDataStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFHandleMultiThreadCDataStep(CCAFServer& aParent); sl@0: ~CCAFHandleMultiThreadCDataStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: static TInt ReaderThreadEntry(TAny *aPtr); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test CManager::GetAttribute() sl@0: * The INI file specifies the file to delete and the expected return code. sl@0: * For instance this can be used to try and delete a file that does not exist or a file sl@0: * that is read-only or has rights that don't allow it to be deleted sl@0: * INI file paramerters sl@0: * sl@0: * sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CCAFDataAttributeStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFDataAttributeStep(CCAFServer& aParent); sl@0: ~CCAFDataAttributeStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: TVerdict doWmdrmTestStepL(); sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test CManager::GetAttributeSet() sl@0: * The INI file specifies the file to delete and the expected return code. sl@0: * For instance this can be used to try and delete a file that does not exist or a file sl@0: * that is read-only or has rights that don't allow it to be deleted sl@0: * INI file paramerters sl@0: * sl@0: * sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CCAFDataAttributeSetStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFDataAttributeSetStep(CCAFServer& aParent); sl@0: ~CCAFDataAttributeSetStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: TVerdict doWmdrmTestStepL(); sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test CContent::GetAttribute() sl@0: * The INI file specifies the file to delete and the expected return code. sl@0: * For instance this can be used to try and delete a file that does not exist or a file sl@0: * that is read-only or has rights that don't allow it to be deleted sl@0: * INI file paramerters sl@0: * sl@0: * sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CCAFDataStringAttributeStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFDataStringAttributeStep(CCAFServer& aParent); sl@0: ~CCAFDataStringAttributeStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: TVerdict doWmdrmTestStepL(); sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test CData::GetStringAttributeSet() sl@0: * The INI file specifies the file to delete and the expected return code. sl@0: * For instance this can be used to try and delete a file that does not exist or a file sl@0: * that is read-only or has rights that don't allow it to be deleted sl@0: * INI file paramerters sl@0: * sl@0: * sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CCAFDataStringAttributeSetStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFDataStringAttributeSetStep(CCAFServer& aParent); sl@0: ~CCAFDataStringAttributeSetStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: TVerdict doWmdrmTestStepL(); sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: class CCAFExecuteIntentStep : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFExecuteIntentStep(CCAFServer& aParent); sl@0: ~CCAFExecuteIntentStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: private: sl@0: CCAFServer& iParent; sl@0: }; sl@0: sl@0: /* sl@0: * Used to test DRM File Open perfomance. sl@0: * The INI file specifies the file to be opened , the iteration count and the maximum time limit for sl@0: * file open operation(in millisecs). sl@0: * If the obtained time doesn't fall within the provided limit (in the INI parameters) , the test case fails. sl@0: * sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: sl@0: class CCAFDRMFileOpenPerformanceTest : public CCAFStep sl@0: { sl@0: public: sl@0: CCAFDRMFileOpenPerformanceTest(CCAFServer& aParent); sl@0: ~CCAFDRMFileOpenPerformanceTest(); sl@0: virtual TVerdict doTestStepL(); sl@0: sl@0: private: sl@0: // Read content from file using CAF sl@0: void OpenAndReadFileContentL(const TDesC& aFileName); sl@0: sl@0: private: sl@0: sl@0: CCAFServer& iParent; sl@0: TUint32 iIterationSum; sl@0: }; sl@0: sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: /* Used to test behaviour of CContent object creation and attribute APIs for WMDRM content. +- sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CWmdrmCAFContentStep : public CCAFStep sl@0: { sl@0: public: sl@0: CWmdrmCAFContentStep(); sl@0: ~CWmdrmCAFContentStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: }; sl@0: sl@0: sl@0: /* Used to test the behaviour of CData object creation and attribute APIs for WMDRM content. sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CWmdrmCAFDataStep : public CCAFStep sl@0: { sl@0: public: sl@0: CWmdrmCAFDataStep(); sl@0: ~CWmdrmCAFDataStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: }; sl@0: sl@0: sl@0: /* Used to test synchronous and asynchronous behaviour of ReadL() APIs of CData class for WMDRM content. sl@0: * @internalComponent Exposure internally sl@0: */ sl@0: class CWmdrmCAFReadStep : public CCAFStep sl@0: { sl@0: public: sl@0: CWmdrmCAFReadStep(); sl@0: ~CWmdrmCAFReadStep(); sl@0: virtual TVerdict doTestStepL(); sl@0: sl@0: private: sl@0: TInt TestSynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput); sl@0: TInt TestAsynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput); sl@0: }; sl@0: sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: sl@0: #endif