1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/referencedrmagent/tcaf/source/Consumerstep.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,443 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +#if (!defined __CONSUMER_STEP_H__)
1.25 +#define __CONSUMER_STEP_H__
1.26 +#include <test/testexecutestepbase.h>
1.27 +
1.28 +#include "cafstep.h"
1.29 +
1.30 +// Constants used to name test cases
1.31 +_LIT(KCAFSizeStep,"CAFSizeStep");
1.32 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.33 +_LIT(KCAFSizeStep64,"CAFSizeStep64");
1.34 +_LIT(KCAFSeekReadStep64,"CAFSeekReadStep64");
1.35 +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.36 +_LIT(KCAFSeekReadStep,"CAFSeekReadStep");
1.37 +_LIT(KCAFAttributesStep,"CAFAttributesStep");
1.38 +_LIT(KCAFStringAttributesStep,"CAFStringAttributesStep");
1.39 +_LIT(KCAFMultiThreadCDataStep,"CAFMultiThreadCDataStep");
1.40 +_LIT(KCAFMimeTypeCDataStep,"CAFMimeTypeCDataStep");
1.41 +_LIT(KCAFShareModeStep,"CAFShareModeStep");
1.42 +_LIT(KCAFHandleSizeStep,"CAFHandleSizeStep");
1.43 +_LIT(KCAFHandleSeekReadStep,"CAFHandleSeekReadStep");
1.44 +_LIT(KCAFHandleMultiThreadCDataStep,"CAFHandleMultiThreadCDataStep");
1.45 +_LIT(KCAFDataAttributeStep,"CAFDataAttributeStep");
1.46 +_LIT(KCAFDataAttributeSetStep,"CAFDataAttributeSetStep");
1.47 +_LIT(KCAFDataStringAttributeStep,"CAFDataStringAttributeStep");
1.48 +_LIT(KCAFDataStringAttributeSetStep,"CAFDataStringAttributeSetStep");
1.49 +_LIT(KCAFExecuteIntentStep,"CAFExecuteIntentStep");
1.50 +_LIT(KCAFDRMFileOpenPerformanceStep, "CAFDRMFileOpenPerformanceStep");
1.51 +
1.52 +//#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.53 +_LIT(KWmdrmCAFContentStep,"WmdrmCAFContentStep");
1.54 +_LIT(KWmdrmCAFDataStep,"WmdrmCAFDataStep");
1.55 +_LIT(KWmdrmCAFReadStep, "WmdrmCAFReadStep");
1.56 +//#endif //SYMBIAN_SDP-WMDRM
1.57 +
1.58 +/*
1.59 +* Used to open one file with RFile and the DRM packaged version of the same file with
1.60 +* CContent::Open() and compare the reported sizes
1.61 +* It can be used with two identical, non DRM file to check the operation of F32Agent
1.62 +* The ini file used with this test expects only one parameter
1.63 +*
1.64 +* URI1 - The name of the file used for this test
1.65 +*
1.66 +*/
1.67 +class CCAFSizeStep : public CCAFStep
1.68 + {
1.69 +public:
1.70 + CCAFSizeStep(CCAFServer& aParent);
1.71 + ~CCAFSizeStep();
1.72 + virtual TVerdict doTestStepL();
1.73 +private:
1.74 + CCAFServer& iParent;
1.75 + };
1.76 +
1.77 +
1.78 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.79 +/*
1.80 +* 64bit version of CCAFSizeStep
1.81 +* If the agent to be tested implemented 64bit functions, this test step will test 64bit functions
1.82 +* under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step
1.83 +* can also ensure that fallback to 32bit functions works properly
1.84 +*/
1.85 +class CCAFSizeStep64 : public CCAFStep
1.86 + {
1.87 +public:
1.88 + CCAFSizeStep64(CCAFServer& aParent);
1.89 + ~CCAFSizeStep64();
1.90 + virtual TVerdict doTestStepL();
1.91 +private:
1.92 + CCAFServer& iParent;
1.93 + };
1.94 +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.95 +
1.96 +/*
1.97 +* Used to test file Seek and Read operations on DRM protected content.
1.98 +* Opens one file with RFile and the DRM packaged version of the same file with
1.99 +* CContent::Open() and does a series of Seek and Read operations.
1.100 +* Verifies that the CAF and the agent corresponding to the DRM content implement
1.101 +* all polymorphic versions of Read() and Seek() correctly
1.102 +* It can also be used with two identical, non DRM file to check the operation of F32Agent
1.103 +* The ini file used with this test expects only one parameter
1.104 +*
1.105 +* URI1 - The name of the file used for this test
1.106 +*
1.107 +*/
1.108 +class CCAFSeekReadStep : public CCAFStep
1.109 + {
1.110 +public:
1.111 + CCAFSeekReadStep(CCAFServer& aParent);
1.112 + ~CCAFSeekReadStep();
1.113 + virtual TVerdict doTestStepL();
1.114 +private:
1.115 + void StandardCheckReturnValue(TInt aReturnValue);
1.116 +private:
1.117 + CCAFServer& iParent;
1.118 + };
1.119 +
1.120 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.121 +/*
1.122 +* 64bit version of CAFSeekReadStep
1.123 +* If the agent to be tested implemented 64bit functions, this test step will test 64bit functions
1.124 +* under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step
1.125 +* can also ensure that fallback to 32bit functions works properly
1.126 +*
1.127 +*/
1.128 +class CCAFSeekReadStep64 : public CCAFStep
1.129 + {
1.130 +public:
1.131 + CCAFSeekReadStep64(CCAFServer& aParent);
1.132 + ~CCAFSeekReadStep64();
1.133 + virtual TVerdict doTestStepL();
1.134 +private:
1.135 + void StandardCheckReturnValue(TInt aReturnValue);
1.136 +private:
1.137 + CCAFServer& iParent;
1.138 + };
1.139 +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.140 +
1.141 +/*
1.142 +* Used to test CContent::Attributes()
1.143 +* The INI file specifies the file to retrieve the attributes from.
1.144 +* @internalComponent
1.145 +*/
1.146 +class CCAFAttributesStep : public CCAFStep
1.147 + {
1.148 +public:
1.149 + CCAFAttributesStep(CCAFServer& aParent);
1.150 + ~CCAFAttributesStep();
1.151 + virtual TVerdict doTestStepL();
1.152 +private:
1.153 + CCAFServer& iParent;
1.154 + };
1.155 +
1.156 +
1.157 +/*
1.158 +* Used to test Content::StringAttributes()
1.159 +* The INI file specifies the file to retrieve the attributes from.
1.160 +* @internalComponent
1.161 +*/
1.162 +class CCAFStringAttributesStep : public CCAFStep
1.163 + {
1.164 +public:
1.165 + CCAFStringAttributesStep(CCAFServer& aParent);
1.166 + ~CCAFStringAttributesStep();
1.167 + virtual TVerdict doTestStepL();
1.168 +private:
1.169 + CCAFServer& iParent;
1.170 + };
1.171 +
1.172 +
1.173 +
1.174 +/*
1.175 +* Used to test multi-threaded read from CContent
1.176 +* @internalComponent
1.177 +*/
1.178 +class CCAFMultiThreadCDataStep : public CCAFStep
1.179 + {
1.180 +public:
1.181 + CCAFMultiThreadCDataStep(CCAFServer& aParent);
1.182 + ~CCAFMultiThreadCDataStep();
1.183 + virtual TVerdict doTestStepL();
1.184 + static TInt ReaderThreadEntry(TAny *aPtr);
1.185 +private:
1.186 + CCAFServer& iParent;
1.187 + };
1.188 +
1.189 +
1.190 +/*
1.191 +* Used to test finding the mime type from CData
1.192 +* @internalComponent
1.193 +*/
1.194 +class CCAFMimeTypeCDataStep: public CCAFStep
1.195 + {
1.196 +public:
1.197 + CCAFMimeTypeCDataStep(CCAFServer& aParent);
1.198 + ~CCAFMimeTypeCDataStep();
1.199 + virtual TVerdict doTestStepL();
1.200 + static TInt ReaderThreadEntry(TAny *aPtr);
1.201 +private:
1.202 + CCAFServer& iParent;
1.203 + };
1.204 +
1.205 +/*
1.206 +* Used to test content sharing modes
1.207 +* @internalComponent
1.208 +*/
1.209 +class CCAFShareModeStep: public CCAFStep
1.210 + {
1.211 +public:
1.212 + CCAFShareModeStep(CCAFServer& aParent);
1.213 + ~CCAFShareModeStep();
1.214 + virtual TVerdict doTestStepL();
1.215 + TVerdict doShareModeStepL();
1.216 +private:
1.217 + CCAFServer& iParent;
1.218 + };
1.219 +
1.220 +
1.221 +/*
1.222 +* Used to open one file with RFile and the DRM packaged version of the same file with
1.223 +* CContent::Open() by passing RFile handle and compare the reported sizes
1.224 +* It can be used with two identical, non DRM file to check the operation of F32Agent
1.225 +* The ini file used with this test expects only one parameter
1.226 +*
1.227 +* URI1 - The name of the file used for this test
1.228 +*
1.229 +*/
1.230 +class CCAFHandleSizeStep : public CCAFStep
1.231 + {
1.232 +public:
1.233 + CCAFHandleSizeStep(CCAFServer& aParent);
1.234 + ~CCAFHandleSizeStep();
1.235 + virtual TVerdict doTestStepL();
1.236 +private:
1.237 + CCAFServer& iParent;
1.238 + };
1.239 +
1.240 +/*
1.241 +* Used to test file Seek and Read operations on DRM protected content.
1.242 +* Opens one file with RFile and the DRM packaged version of the same file with
1.243 +* CContent::Open() by passing RFile handle and does a series of Seek and Read operations.
1.244 +* Verifies that the CAF and the agent corresponding to the DRM content implement
1.245 +* all polymorphic versions of Read() and Seek() correctly
1.246 +* It can also be used with two identical, non DRM file to check the operation of F32Agent
1.247 +* The ini file used with this test expects only one parameter
1.248 +*
1.249 +* URI1 - The name of the file used for this test
1.250 +*/
1.251 +class CCAFHandleSeekReadStep : public CCAFStep
1.252 + {
1.253 +public:
1.254 + CCAFHandleSeekReadStep(CCAFServer& aParent);
1.255 + ~CCAFHandleSeekReadStep();
1.256 + virtual TVerdict doTestStepL();
1.257 +private:
1.258 + CCAFServer& iParent;
1.259 + };
1.260 +
1.261 +/*
1.262 +* Used to test multi-threaded read from CContent
1.263 +* @internalComponent
1.264 +*/
1.265 +class CCAFHandleMultiThreadCDataStep : public CCAFStep
1.266 + {
1.267 +public:
1.268 + CCAFHandleMultiThreadCDataStep(CCAFServer& aParent);
1.269 + ~CCAFHandleMultiThreadCDataStep();
1.270 + virtual TVerdict doTestStepL();
1.271 + static TInt ReaderThreadEntry(TAny *aPtr);
1.272 +private:
1.273 + CCAFServer& iParent;
1.274 + };
1.275 +
1.276 +/*
1.277 +* Used to test CManager::GetAttribute()
1.278 +* The INI file specifies the file to delete and the expected return code.
1.279 +* For instance this can be used to try and delete a file that does not exist or a file
1.280 +* that is read-only or has rights that don't allow it to be deleted
1.281 +* INI file paramerters
1.282 +*
1.283 +*
1.284 +* @internalComponent Exposure internally
1.285 +*/
1.286 +class CCAFDataAttributeStep : public CCAFStep
1.287 + {
1.288 +public:
1.289 + CCAFDataAttributeStep(CCAFServer& aParent);
1.290 + ~CCAFDataAttributeStep();
1.291 + virtual TVerdict doTestStepL();
1.292 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.293 + TVerdict doWmdrmTestStepL();
1.294 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.295 +private:
1.296 + CCAFServer& iParent;
1.297 + };
1.298 +
1.299 +/*
1.300 +* Used to test CManager::GetAttributeSet()
1.301 +* The INI file specifies the file to delete and the expected return code.
1.302 +* For instance this can be used to try and delete a file that does not exist or a file
1.303 +* that is read-only or has rights that don't allow it to be deleted
1.304 +* INI file paramerters
1.305 +*
1.306 +*
1.307 +* @internalComponent Exposure internally
1.308 +*/
1.309 +class CCAFDataAttributeSetStep : public CCAFStep
1.310 + {
1.311 +public:
1.312 + CCAFDataAttributeSetStep(CCAFServer& aParent);
1.313 + ~CCAFDataAttributeSetStep();
1.314 + virtual TVerdict doTestStepL();
1.315 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.316 + TVerdict doWmdrmTestStepL();
1.317 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.318 +private:
1.319 + CCAFServer& iParent;
1.320 + };
1.321 +
1.322 +/*
1.323 +* Used to test CContent::GetAttribute()
1.324 +* The INI file specifies the file to delete and the expected return code.
1.325 +* For instance this can be used to try and delete a file that does not exist or a file
1.326 +* that is read-only or has rights that don't allow it to be deleted
1.327 +* INI file paramerters
1.328 +*
1.329 +*
1.330 +* @internalComponent Exposure internally
1.331 +*/
1.332 +class CCAFDataStringAttributeStep : public CCAFStep
1.333 + {
1.334 +public:
1.335 + CCAFDataStringAttributeStep(CCAFServer& aParent);
1.336 + ~CCAFDataStringAttributeStep();
1.337 + virtual TVerdict doTestStepL();
1.338 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.339 + TVerdict doWmdrmTestStepL();
1.340 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.341 +private:
1.342 + CCAFServer& iParent;
1.343 + };
1.344 +
1.345 +/*
1.346 +* Used to test CData::GetStringAttributeSet()
1.347 +* The INI file specifies the file to delete and the expected return code.
1.348 +* For instance this can be used to try and delete a file that does not exist or a file
1.349 +* that is read-only or has rights that don't allow it to be deleted
1.350 +* INI file paramerters
1.351 +*
1.352 +*
1.353 +* @internalComponent Exposure internally
1.354 +*/
1.355 +class CCAFDataStringAttributeSetStep : public CCAFStep
1.356 + {
1.357 +public:
1.358 + CCAFDataStringAttributeSetStep(CCAFServer& aParent);
1.359 + ~CCAFDataStringAttributeSetStep();
1.360 + virtual TVerdict doTestStepL();
1.361 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.362 + TVerdict doWmdrmTestStepL();
1.363 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.364 +private:
1.365 + CCAFServer& iParent;
1.366 + };
1.367 +
1.368 +class CCAFExecuteIntentStep : public CCAFStep
1.369 + {
1.370 +public:
1.371 + CCAFExecuteIntentStep(CCAFServer& aParent);
1.372 + ~CCAFExecuteIntentStep();
1.373 + virtual TVerdict doTestStepL();
1.374 +private:
1.375 + CCAFServer& iParent;
1.376 + };
1.377 +
1.378 +/*
1.379 +* Used to test DRM File Open perfomance.
1.380 +* The INI file specifies the file to be opened , the iteration count and the maximum time limit for
1.381 +* file open operation(in millisecs).
1.382 +* If the obtained time doesn't fall within the provided limit (in the INI parameters) , the test case fails.
1.383 +*
1.384 +* @internalComponent Exposure internally
1.385 +*/
1.386 +
1.387 +class CCAFDRMFileOpenPerformanceTest : public CCAFStep
1.388 + {
1.389 + public:
1.390 + CCAFDRMFileOpenPerformanceTest(CCAFServer& aParent);
1.391 + ~CCAFDRMFileOpenPerformanceTest();
1.392 + virtual TVerdict doTestStepL();
1.393 +
1.394 + private:
1.395 + // Read content from file using CAF
1.396 + void OpenAndReadFileContentL(const TDesC& aFileName);
1.397 +
1.398 + private:
1.399 +
1.400 + CCAFServer& iParent;
1.401 + TUint32 iIterationSum;
1.402 + };
1.403 +
1.404 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.405 +/* Used to test behaviour of CContent object creation and attribute APIs for WMDRM content. +-
1.406 +* @internalComponent Exposure internally
1.407 +*/
1.408 +class CWmdrmCAFContentStep : public CCAFStep
1.409 + {
1.410 +public:
1.411 + CWmdrmCAFContentStep();
1.412 + ~CWmdrmCAFContentStep();
1.413 + virtual TVerdict doTestStepL();
1.414 + };
1.415 +
1.416 +
1.417 +/* Used to test the behaviour of CData object creation and attribute APIs for WMDRM content.
1.418 +* @internalComponent Exposure internally
1.419 +*/
1.420 +class CWmdrmCAFDataStep : public CCAFStep
1.421 + {
1.422 +public:
1.423 + CWmdrmCAFDataStep();
1.424 + ~CWmdrmCAFDataStep();
1.425 + virtual TVerdict doTestStepL();
1.426 + };
1.427 +
1.428 +
1.429 +/* Used to test synchronous and asynchronous behaviour of ReadL() APIs of CData class for WMDRM content.
1.430 +* @internalComponent Exposure internally
1.431 +*/
1.432 +class CWmdrmCAFReadStep : public CCAFStep
1.433 + {
1.434 +public:
1.435 + CWmdrmCAFReadStep();
1.436 + ~CWmdrmCAFReadStep();
1.437 + virtual TVerdict doTestStepL();
1.438 +
1.439 +private:
1.440 + TInt TestSynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput);
1.441 + TInt TestAsynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput);
1.442 + };
1.443 +
1.444 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.445 +
1.446 +#endif