os/security/contentmgmt/referencedrmagent/tcaf/source/RecognizerStep.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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 __RECOGNIZER_STEP_H__)
sl@0
    22
#define __RECOGNIZER_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(KCAFRecognizeStep,"CAFRecognizeStep");
sl@0
    29
_LIT(KCAFRecognizerSpeedStep,"CAFRecognizerSpeedStep");
sl@0
    30
_LIT(KCAFBufferSizeStep,"CAFBufferSizeStep");
sl@0
    31
_LIT(KCAFApparcStep,"CAFApparcStep");
sl@0
    32
_LIT(KCAF_DEF077443_Step,"CAF_DEF077443_Step");
sl@0
    33
_LIT(KCAF_DEF078413_Step,"CAF_DEF078413_Step");
sl@0
    34
sl@0
    35
class CCAFServer;
sl@0
    36
class CApaDataRecognizerType;
sl@0
    37
sl@0
    38
/* 
sl@0
    39
* Used to test the CAgentResolver::DoRecognize() function
sl@0
    40
* The ini file used in this test expects the following parameters to be specified
sl@0
    41
*
sl@0
    42
* FileName - full path and filename of the file to be investigated
sl@0
    43
*
sl@0
    44
* Container - the container mime type expected
sl@0
    45
*
sl@0
    46
* Content - the content mime type expected 
sl@0
    47
*
sl@0
    48
* Recognized - whether or not CAF should recognize this file
sl@0
    49
*
sl@0
    50
* If an agent recognizes the file, it fills in what it thinks the container and content mime 
sl@0
    51
* types of the file are. The test verifies:
sl@0
    52
* The file was recognized correctly (either recognized, or not recognized)
sl@0
    53
* If it was recognized verify that the container mime type is correct
sl@0
    54
* If it was recognized verify that the content mime type is correct
sl@0
    55
* @internalComponent Exposure internally
sl@0
    56
*/
sl@0
    57
class CCAFRecognizeStep : public CCAFStep
sl@0
    58
	{
sl@0
    59
public:
sl@0
    60
	CCAFRecognizeStep(CCAFServer& aParent);
sl@0
    61
	~CCAFRecognizeStep();
sl@0
    62
	virtual TVerdict doTestStepL();
sl@0
    63
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT     
sl@0
    64
    TVerdict doWmdrmTestStepL();     
sl@0
    65
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT 
sl@0
    66
sl@0
    67
private:
sl@0
    68
	void CheckResultL(TBool aResult, TDes8& aContainerMimeType, TDes8& aContentMimeType, TBool aExpectedResult, TDesC16& aExpectedContainerMime, TDesC16& aExpectedContentMime);
sl@0
    69
	CCAFServer& iParent;
sl@0
    70
	};
sl@0
    71
sl@0
    72
/* 
sl@0
    73
* Used to test the speed of the CAgentResolver::DoRecognize() function
sl@0
    74
* Creates and instance of CAgentResolver and calls DoRecognize() 1000 times for the file
sl@0
    75
* specified in the INI file.
sl@0
    76
* The ini file used in this test only needs one parameter specified
sl@0
    77
*
sl@0
    78
* FileName - full path and filename of the file to be investigated
sl@0
    79
*
sl@0
    80
* Timing information in the TestExecute log file indicates how long this takes
sl@0
    81
* @internalComponent Exposure internally
sl@0
    82
*/
sl@0
    83
class CCAFRecognizerSpeedStep : public CCAFStep
sl@0
    84
	{
sl@0
    85
public:
sl@0
    86
	CCAFRecognizerSpeedStep(CCAFServer& aParent);
sl@0
    87
	~CCAFRecognizerSpeedStep ();
sl@0
    88
	virtual TVerdict doTestStepL();
sl@0
    89
private:
sl@0
    90
	CCAFServer& iParent;
sl@0
    91
	};
sl@0
    92
sl@0
    93
sl@0
    94
/* 
sl@0
    95
* Used to test CAgentResolver::PreferredBufferSize() function
sl@0
    96
* CAgentResolver should use the static configuration data in each agent's resource file
sl@0
    97
* to determine the buffer size required for apparc recognition
sl@0
    98
* @internalComponent Exposure internally
sl@0
    99
*/
sl@0
   100
class CCAFBufferSizeStep : public CCAFStep
sl@0
   101
	{
sl@0
   102
public:
sl@0
   103
	CCAFBufferSizeStep(CCAFServer& aParent);
sl@0
   104
	~CCAFBufferSizeStep();
sl@0
   105
	virtual TVerdict doTestStepL();
sl@0
   106
private:
sl@0
   107
	CCAFServer& iParent;
sl@0
   108
	};
sl@0
   109
sl@0
   110
sl@0
   111
/* 
sl@0
   112
This test verifys that the CApaCafRecognizer correctly identifies the mime type 
sl@0
   113
* The ini file specifies two parameters
sl@0
   114
*
sl@0
   115
* FileName - the file to recognize 
sl@0
   116
*
sl@0
   117
* CafMimeType - the expected mime type returned from RecognizeL()
sl@0
   118
* 
sl@0
   119
* @internalComponent Exposure internally
sl@0
   120
*/
sl@0
   121
class CCAFApparcStep : public CCAFStep
sl@0
   122
	{
sl@0
   123
public:
sl@0
   124
	CCAFApparcStep(CCAFServer& aParent);
sl@0
   125
	~CCAFApparcStep();
sl@0
   126
	virtual TVerdict doTestStepL();
sl@0
   127
private:
sl@0
   128
	CCAFServer& iParent;
sl@0
   129
	};
sl@0
   130
sl@0
   131
/* 
sl@0
   132
This test verifies that upper case Mime types can be recognized.
sl@0
   133
*
sl@0
   134
* See DEF077443: Propagated:CAF should not be performing case sensitive comparisons on MIME types
sl@0
   135
* 
sl@0
   136
* @internalComponent Exposure internally
sl@0
   137
*/
sl@0
   138
class CCAF_DEF077443_Step : public CCAFStep
sl@0
   139
	{
sl@0
   140
public:
sl@0
   141
	CCAF_DEF077443_Step(CCAFServer& aParent);
sl@0
   142
	~CCAF_DEF077443_Step();
sl@0
   143
	virtual TVerdict doTestStepL();
sl@0
   144
private:
sl@0
   145
	CCAFServer& iParent;
sl@0
   146
	};
sl@0
   147
sl@0
   148
sl@0
   149
#endif