os/security/contentmgmt/referencedrmagent/tcaf/source/Consumerstep.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
#if (!defined __CONSUMER_STEP_H__)
sl@0
    22
#define __CONSUMER_STEP_H__
sl@0
    23
#include <test/testexecutestepbase.h>
sl@0
    24
sl@0
    25
#include "cafstep.h"
sl@0
    26
sl@0
    27
// Constants used to name test cases 
sl@0
    28
_LIT(KCAFSizeStep,"CAFSizeStep");
sl@0
    29
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
sl@0
    30
_LIT(KCAFSizeStep64,"CAFSizeStep64");
sl@0
    31
_LIT(KCAFSeekReadStep64,"CAFSeekReadStep64");
sl@0
    32
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
sl@0
    33
_LIT(KCAFSeekReadStep,"CAFSeekReadStep");
sl@0
    34
_LIT(KCAFAttributesStep,"CAFAttributesStep");
sl@0
    35
_LIT(KCAFStringAttributesStep,"CAFStringAttributesStep");
sl@0
    36
_LIT(KCAFMultiThreadCDataStep,"CAFMultiThreadCDataStep");
sl@0
    37
_LIT(KCAFMimeTypeCDataStep,"CAFMimeTypeCDataStep");
sl@0
    38
_LIT(KCAFShareModeStep,"CAFShareModeStep");
sl@0
    39
_LIT(KCAFHandleSizeStep,"CAFHandleSizeStep");
sl@0
    40
_LIT(KCAFHandleSeekReadStep,"CAFHandleSeekReadStep");
sl@0
    41
_LIT(KCAFHandleMultiThreadCDataStep,"CAFHandleMultiThreadCDataStep");
sl@0
    42
_LIT(KCAFDataAttributeStep,"CAFDataAttributeStep");
sl@0
    43
_LIT(KCAFDataAttributeSetStep,"CAFDataAttributeSetStep");
sl@0
    44
_LIT(KCAFDataStringAttributeStep,"CAFDataStringAttributeStep");
sl@0
    45
_LIT(KCAFDataStringAttributeSetStep,"CAFDataStringAttributeSetStep");
sl@0
    46
_LIT(KCAFExecuteIntentStep,"CAFExecuteIntentStep");
sl@0
    47
_LIT(KCAFDRMFileOpenPerformanceStep, "CAFDRMFileOpenPerformanceStep");
sl@0
    48
sl@0
    49
//#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
sl@0
    50
_LIT(KWmdrmCAFContentStep,"WmdrmCAFContentStep");     
sl@0
    51
_LIT(KWmdrmCAFDataStep,"WmdrmCAFDataStep");     
sl@0
    52
_LIT(KWmdrmCAFReadStep, "WmdrmCAFReadStep");     
sl@0
    53
//#endif //SYMBIAN_SDP-WMDRM 
sl@0
    54
sl@0
    55
/* 
sl@0
    56
* Used to open one file with RFile and the DRM packaged version of the same file with 
sl@0
    57
* CContent::Open() and compare the reported sizes
sl@0
    58
* It can be used with two identical, non DRM file to check the operation of F32Agent
sl@0
    59
* The ini file used with this test expects only one parameter
sl@0
    60
*
sl@0
    61
* URI1 - The name of the file used for this test
sl@0
    62
* 
sl@0
    63
*/
sl@0
    64
class CCAFSizeStep : public CCAFStep
sl@0
    65
	{
sl@0
    66
public:
sl@0
    67
	CCAFSizeStep(CCAFServer& aParent);
sl@0
    68
	~CCAFSizeStep();
sl@0
    69
	virtual TVerdict doTestStepL();
sl@0
    70
private:
sl@0
    71
	CCAFServer& iParent;
sl@0
    72
	};
sl@0
    73
sl@0
    74
sl@0
    75
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
sl@0
    76
/* 
sl@0
    77
* 64bit version of CCAFSizeStep 
sl@0
    78
* If the agent to be tested implemented 64bit functions, this test step will test 64bit functions
sl@0
    79
* under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step
sl@0
    80
* can also ensure that fallback to 32bit functions works properly  
sl@0
    81
*/
sl@0
    82
class CCAFSizeStep64 : public CCAFStep
sl@0
    83
	{
sl@0
    84
public:
sl@0
    85
	CCAFSizeStep64(CCAFServer& aParent);
sl@0
    86
	~CCAFSizeStep64();
sl@0
    87
	virtual TVerdict doTestStepL();
sl@0
    88
private:
sl@0
    89
	CCAFServer& iParent;
sl@0
    90
	};
sl@0
    91
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
sl@0
    92
sl@0
    93
/* 
sl@0
    94
* Used to test file Seek and Read operations on DRM protected content.
sl@0
    95
* Opens one file with RFile and the DRM packaged version of the same file with 
sl@0
    96
* CContent::Open() and does a series of Seek and Read operations.
sl@0
    97
* Verifies that the CAF and the agent corresponding to the DRM content implement 
sl@0
    98
* all polymorphic versions of Read() and Seek() correctly
sl@0
    99
* It can also be used with two identical, non DRM file to check the operation of F32Agent
sl@0
   100
* The ini file used with this test expects only one parameter
sl@0
   101
*
sl@0
   102
* URI1 - The name of the file used for this test
sl@0
   103
* 
sl@0
   104
*/
sl@0
   105
class CCAFSeekReadStep : public CCAFStep
sl@0
   106
	{
sl@0
   107
public:
sl@0
   108
	CCAFSeekReadStep(CCAFServer& aParent);
sl@0
   109
	~CCAFSeekReadStep();
sl@0
   110
	virtual TVerdict doTestStepL();
sl@0
   111
private:
sl@0
   112
	void StandardCheckReturnValue(TInt aReturnValue);
sl@0
   113
private:
sl@0
   114
	CCAFServer& iParent;
sl@0
   115
	};
sl@0
   116
sl@0
   117
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
sl@0
   118
/* 
sl@0
   119
* 64bit version of CAFSeekReadStep
sl@0
   120
* If the agent to be tested implemented 64bit functions, this test step will test 64bit functions
sl@0
   121
* under the same scenario as its 32bit counterpart. If 64bit functions are not implemented, this test step
sl@0
   122
* can also ensure that fallback to 32bit functions works properly 
sl@0
   123
* 
sl@0
   124
*/
sl@0
   125
class CCAFSeekReadStep64 : public CCAFStep
sl@0
   126
	{
sl@0
   127
public:
sl@0
   128
	CCAFSeekReadStep64(CCAFServer& aParent);
sl@0
   129
	~CCAFSeekReadStep64();
sl@0
   130
	virtual TVerdict doTestStepL();
sl@0
   131
private:
sl@0
   132
	void StandardCheckReturnValue(TInt aReturnValue);
sl@0
   133
private:
sl@0
   134
	CCAFServer& iParent;
sl@0
   135
	};
sl@0
   136
#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
sl@0
   137
sl@0
   138
/* 
sl@0
   139
* Used to test CContent::Attributes()
sl@0
   140
* The INI file specifies the file to retrieve the attributes from.
sl@0
   141
* @internalComponent
sl@0
   142
*/
sl@0
   143
class CCAFAttributesStep : public CCAFStep
sl@0
   144
	{
sl@0
   145
public:
sl@0
   146
	CCAFAttributesStep(CCAFServer& aParent);
sl@0
   147
	~CCAFAttributesStep();
sl@0
   148
	virtual TVerdict doTestStepL();
sl@0
   149
private:
sl@0
   150
	CCAFServer& iParent;
sl@0
   151
	};
sl@0
   152
sl@0
   153
sl@0
   154
/* 
sl@0
   155
* Used to test Content::StringAttributes()
sl@0
   156
* The INI file specifies the file to retrieve the attributes from.
sl@0
   157
* @internalComponent
sl@0
   158
*/
sl@0
   159
class CCAFStringAttributesStep : public CCAFStep
sl@0
   160
	{
sl@0
   161
public:
sl@0
   162
	CCAFStringAttributesStep(CCAFServer& aParent);
sl@0
   163
	~CCAFStringAttributesStep();
sl@0
   164
	virtual TVerdict doTestStepL();
sl@0
   165
private:
sl@0
   166
	CCAFServer& iParent;
sl@0
   167
	};
sl@0
   168
sl@0
   169
sl@0
   170
sl@0
   171
/* 
sl@0
   172
* Used to test multi-threaded read from CContent
sl@0
   173
* @internalComponent
sl@0
   174
*/
sl@0
   175
class CCAFMultiThreadCDataStep : public CCAFStep
sl@0
   176
	{
sl@0
   177
public:
sl@0
   178
	CCAFMultiThreadCDataStep(CCAFServer& aParent);
sl@0
   179
	~CCAFMultiThreadCDataStep();
sl@0
   180
	virtual TVerdict doTestStepL();
sl@0
   181
	static TInt ReaderThreadEntry(TAny *aPtr);
sl@0
   182
private:
sl@0
   183
	CCAFServer& iParent;
sl@0
   184
	};
sl@0
   185
sl@0
   186
sl@0
   187
/* 
sl@0
   188
* Used to test finding the mime type from CData
sl@0
   189
* @internalComponent
sl@0
   190
*/
sl@0
   191
class CCAFMimeTypeCDataStep: public CCAFStep
sl@0
   192
	{
sl@0
   193
public:
sl@0
   194
	CCAFMimeTypeCDataStep(CCAFServer& aParent);
sl@0
   195
	~CCAFMimeTypeCDataStep();
sl@0
   196
	virtual TVerdict doTestStepL();
sl@0
   197
	static TInt ReaderThreadEntry(TAny *aPtr);
sl@0
   198
private:
sl@0
   199
	CCAFServer& iParent;
sl@0
   200
	};
sl@0
   201
sl@0
   202
/* 
sl@0
   203
* Used to test content sharing modes
sl@0
   204
* @internalComponent
sl@0
   205
*/
sl@0
   206
class CCAFShareModeStep: public CCAFStep
sl@0
   207
	{
sl@0
   208
public:
sl@0
   209
	CCAFShareModeStep(CCAFServer& aParent);
sl@0
   210
	~CCAFShareModeStep();
sl@0
   211
	virtual TVerdict doTestStepL();
sl@0
   212
	TVerdict doShareModeStepL();
sl@0
   213
private:
sl@0
   214
	CCAFServer& iParent;
sl@0
   215
	};
sl@0
   216
sl@0
   217
sl@0
   218
/* 
sl@0
   219
* Used to open one file with RFile and the DRM packaged version of the same file with 
sl@0
   220
* CContent::Open() by passing RFile handle and compare the reported sizes
sl@0
   221
* It can be used with two identical, non DRM file to check the operation of F32Agent
sl@0
   222
* The ini file used with this test expects only one parameter
sl@0
   223
*
sl@0
   224
* URI1 - The name of the file used for this test
sl@0
   225
* 
sl@0
   226
*/
sl@0
   227
class CCAFHandleSizeStep : public CCAFStep
sl@0
   228
	{
sl@0
   229
public:
sl@0
   230
	CCAFHandleSizeStep(CCAFServer& aParent);
sl@0
   231
	~CCAFHandleSizeStep();
sl@0
   232
	virtual TVerdict doTestStepL();
sl@0
   233
private:
sl@0
   234
	CCAFServer& iParent;
sl@0
   235
	};	
sl@0
   236
sl@0
   237
/* 
sl@0
   238
* Used to test file Seek and Read operations on DRM protected content.
sl@0
   239
* Opens one file with RFile and the DRM packaged version of the same file with 
sl@0
   240
* CContent::Open() by passing RFile handle and does a series of Seek and Read operations.
sl@0
   241
* Verifies that the CAF and the agent corresponding to the DRM content implement 
sl@0
   242
* all polymorphic versions of Read() and Seek() correctly
sl@0
   243
* It can also be used with two identical, non DRM file to check the operation of F32Agent
sl@0
   244
* The ini file used with this test expects only one parameter
sl@0
   245
*
sl@0
   246
* URI1 - The name of the file used for this test
sl@0
   247
*/
sl@0
   248
class CCAFHandleSeekReadStep : public CCAFStep
sl@0
   249
	{
sl@0
   250
public:
sl@0
   251
	CCAFHandleSeekReadStep(CCAFServer& aParent);
sl@0
   252
	~CCAFHandleSeekReadStep();
sl@0
   253
	virtual TVerdict doTestStepL();
sl@0
   254
private:
sl@0
   255
	CCAFServer& iParent;
sl@0
   256
	};
sl@0
   257
sl@0
   258
/* 
sl@0
   259
* Used to test multi-threaded read from CContent
sl@0
   260
* @internalComponent
sl@0
   261
*/
sl@0
   262
class CCAFHandleMultiThreadCDataStep : public CCAFStep
sl@0
   263
	{
sl@0
   264
public:
sl@0
   265
	CCAFHandleMultiThreadCDataStep(CCAFServer& aParent);
sl@0
   266
	~CCAFHandleMultiThreadCDataStep();
sl@0
   267
	virtual TVerdict doTestStepL();
sl@0
   268
	static TInt ReaderThreadEntry(TAny *aPtr);
sl@0
   269
private:
sl@0
   270
	CCAFServer& iParent;
sl@0
   271
	};
sl@0
   272
	
sl@0
   273
/* 
sl@0
   274
* Used to test CManager::GetAttribute()
sl@0
   275
* The INI file specifies the file to delete and the expected return code.
sl@0
   276
* For instance this can be used to try and delete a file that does not exist or a file
sl@0
   277
* that is read-only or has rights that don't allow it to be deleted
sl@0
   278
* INI file paramerters
sl@0
   279
*
sl@0
   280
*
sl@0
   281
* @internalComponent Exposure internally
sl@0
   282
*/
sl@0
   283
class CCAFDataAttributeStep : public CCAFStep
sl@0
   284
	{
sl@0
   285
public:
sl@0
   286
	CCAFDataAttributeStep(CCAFServer& aParent);
sl@0
   287
	~CCAFDataAttributeStep();
sl@0
   288
	virtual TVerdict doTestStepL();
sl@0
   289
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
sl@0
   290
    TVerdict doWmdrmTestStepL();     
sl@0
   291
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
sl@0
   292
private:
sl@0
   293
	CCAFServer& iParent;
sl@0
   294
	};
sl@0
   295
sl@0
   296
/* 
sl@0
   297
* Used to test CManager::GetAttributeSet()
sl@0
   298
* The INI file specifies the file to delete and the expected return code.
sl@0
   299
* For instance this can be used to try and delete a file that does not exist or a file
sl@0
   300
* that is read-only or has rights that don't allow it to be deleted
sl@0
   301
* INI file paramerters
sl@0
   302
*
sl@0
   303
*
sl@0
   304
* @internalComponent Exposure internally
sl@0
   305
*/
sl@0
   306
class CCAFDataAttributeSetStep : public CCAFStep
sl@0
   307
	{
sl@0
   308
public:
sl@0
   309
	CCAFDataAttributeSetStep(CCAFServer& aParent);
sl@0
   310
	~CCAFDataAttributeSetStep();
sl@0
   311
	virtual TVerdict doTestStepL();
sl@0
   312
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
sl@0
   313
    TVerdict doWmdrmTestStepL();     
sl@0
   314
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
sl@0
   315
private:
sl@0
   316
	CCAFServer& iParent;
sl@0
   317
	};
sl@0
   318
sl@0
   319
/* 
sl@0
   320
* Used to test CContent::GetAttribute()
sl@0
   321
* The INI file specifies the file to delete and the expected return code.
sl@0
   322
* For instance this can be used to try and delete a file that does not exist or a file
sl@0
   323
* that is read-only or has rights that don't allow it to be deleted
sl@0
   324
* INI file paramerters
sl@0
   325
*
sl@0
   326
*
sl@0
   327
* @internalComponent Exposure internally
sl@0
   328
*/
sl@0
   329
class CCAFDataStringAttributeStep : public CCAFStep
sl@0
   330
	{
sl@0
   331
public:
sl@0
   332
	CCAFDataStringAttributeStep(CCAFServer& aParent);
sl@0
   333
	~CCAFDataStringAttributeStep();
sl@0
   334
	virtual TVerdict doTestStepL();
sl@0
   335
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
sl@0
   336
    TVerdict doWmdrmTestStepL();     
sl@0
   337
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
sl@0
   338
private:
sl@0
   339
	CCAFServer& iParent;
sl@0
   340
	};
sl@0
   341
sl@0
   342
/* 
sl@0
   343
* Used to test CData::GetStringAttributeSet()
sl@0
   344
* The INI file specifies the file to delete and the expected return code.
sl@0
   345
* For instance this can be used to try and delete a file that does not exist or a file
sl@0
   346
* that is read-only or has rights that don't allow it to be deleted
sl@0
   347
* INI file paramerters
sl@0
   348
*
sl@0
   349
*
sl@0
   350
* @internalComponent Exposure internally
sl@0
   351
*/
sl@0
   352
class CCAFDataStringAttributeSetStep : public CCAFStep
sl@0
   353
	{
sl@0
   354
public:
sl@0
   355
	CCAFDataStringAttributeSetStep(CCAFServer& aParent);
sl@0
   356
	~CCAFDataStringAttributeSetStep();
sl@0
   357
	virtual TVerdict doTestStepL();
sl@0
   358
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
sl@0
   359
    TVerdict doWmdrmTestStepL();     
sl@0
   360
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
sl@0
   361
private:
sl@0
   362
	CCAFServer& iParent;
sl@0
   363
	};
sl@0
   364
sl@0
   365
class CCAFExecuteIntentStep : public CCAFStep
sl@0
   366
	{
sl@0
   367
public:
sl@0
   368
	CCAFExecuteIntentStep(CCAFServer& aParent);
sl@0
   369
	~CCAFExecuteIntentStep();
sl@0
   370
	virtual TVerdict doTestStepL();
sl@0
   371
private:
sl@0
   372
	CCAFServer& iParent;
sl@0
   373
	};
sl@0
   374
	
sl@0
   375
/*
sl@0
   376
* Used to test DRM File Open perfomance.
sl@0
   377
* The INI file specifies the file to be opened , the iteration count and the maximum time limit for 
sl@0
   378
* file open operation(in millisecs).
sl@0
   379
* If the obtained time doesn't fall within the provided limit (in the INI parameters) , the test case fails.
sl@0
   380
*
sl@0
   381
* @internalComponent Exposure internally
sl@0
   382
*/
sl@0
   383
sl@0
   384
class CCAFDRMFileOpenPerformanceTest : public CCAFStep
sl@0
   385
	{
sl@0
   386
	public:
sl@0
   387
	CCAFDRMFileOpenPerformanceTest(CCAFServer& aParent);
sl@0
   388
	~CCAFDRMFileOpenPerformanceTest();
sl@0
   389
	virtual TVerdict doTestStepL();
sl@0
   390
	
sl@0
   391
	private:
sl@0
   392
	// Read content from file using CAF
sl@0
   393
	void OpenAndReadFileContentL(const TDesC& aFileName);
sl@0
   394
	
sl@0
   395
	private:
sl@0
   396
sl@0
   397
	CCAFServer& iParent;
sl@0
   398
	TUint32 iIterationSum;
sl@0
   399
	};
sl@0
   400
sl@0
   401
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
sl@0
   402
/* Used to test behaviour of CContent object creation and attribute APIs for WMDRM content.  +-   
sl@0
   403
* @internalComponent Exposure internally     
sl@0
   404
*/     
sl@0
   405
class CWmdrmCAFContentStep : public CCAFStep     
sl@0
   406
    {     
sl@0
   407
public:     
sl@0
   408
    CWmdrmCAFContentStep();     
sl@0
   409
    ~CWmdrmCAFContentStep();     
sl@0
   410
    virtual TVerdict doTestStepL();     
sl@0
   411
    };     
sl@0
   412
      
sl@0
   413
      
sl@0
   414
/* Used to test the behaviour of CData object creation and attribute APIs for WMDRM content.     
sl@0
   415
* @internalComponent Exposure internally     
sl@0
   416
*/     
sl@0
   417
class CWmdrmCAFDataStep : public CCAFStep     
sl@0
   418
    {     
sl@0
   419
public:     
sl@0
   420
    CWmdrmCAFDataStep();     
sl@0
   421
    ~CWmdrmCAFDataStep();     
sl@0
   422
    virtual TVerdict doTestStepL();     
sl@0
   423
    };     
sl@0
   424
      
sl@0
   425
         
sl@0
   426
/* Used to test synchronous and asynchronous behaviour of ReadL() APIs of CData class for WMDRM content.     
sl@0
   427
* @internalComponent Exposure internally     
sl@0
   428
*/     
sl@0
   429
class CWmdrmCAFReadStep : public CCAFStep     
sl@0
   430
    {     
sl@0
   431
public:     
sl@0
   432
    CWmdrmCAFReadStep();     
sl@0
   433
    ~CWmdrmCAFReadStep();     
sl@0
   434
    virtual TVerdict doTestStepL();     
sl@0
   435
      
sl@0
   436
private:     
sl@0
   437
    TInt TestSynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput);     
sl@0
   438
    TInt TestAsynchronousReadL(const TDesC8& aHeaderData, TBool aIntent, TDesC& aInputPacket, TDesC& aExpectedOuput);     
sl@0
   439
    };       
sl@0
   440
      
sl@0
   441
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
sl@0
   442
sl@0
   443
#endif