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 __CAF_STEP_H__)
|
sl@0
|
22 |
#define __CAF_STEP_H__
|
sl@0
|
23 |
#include <test/testexecutestepbase.h>
|
sl@0
|
24 |
|
sl@0
|
25 |
class CCAFServer;
|
sl@0
|
26 |
class CApaDataRecognizerType;
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
//Base class used to provide utility functions availble to test step classes
|
sl@0
|
30 |
class CCAFStep : public CTestStep
|
sl@0
|
31 |
{
|
sl@0
|
32 |
public:
|
sl@0
|
33 |
CCAFStep();
|
sl@0
|
34 |
virtual ~CCAFStep();
|
sl@0
|
35 |
|
sl@0
|
36 |
/*
|
sl@0
|
37 |
* Convert a 16-bit descriptor to an 8-bit descriptor
|
sl@0
|
38 |
* A new HBufC8 is allocated to store the new version of the descriptor
|
sl@0
|
39 |
* @param source a descriptor derived from TDesC16
|
sl@0
|
40 |
* @return a new HBufC8 with a copy of the data in source
|
sl@0
|
41 |
*/
|
sl@0
|
42 |
HBufC8* ConvertDes16toHBufC8LC(TDesC& source);
|
sl@0
|
43 |
|
sl@0
|
44 |
/*
|
sl@0
|
45 |
* Convert a 8-bit descriptor to an 16-bit descriptor
|
sl@0
|
46 |
* A new HBufC16 is allocated to store the new version of the descriptor
|
sl@0
|
47 |
* @param source a descriptor derived from TDesC8
|
sl@0
|
48 |
* @return a new HBufC16 with a copy of the data in source
|
sl@0
|
49 |
*/
|
sl@0
|
50 |
HBufC16* ConvertDes8toHBufC16LC(TDesC8& source);
|
sl@0
|
51 |
|
sl@0
|
52 |
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
53 |
|
sl@0
|
54 |
/*
|
sl@0
|
55 |
* Utility method which creates dummy header data for WMDRM operations.
|
sl@0
|
56 |
* @return A new HBufC8 allocated which contains the header data.
|
sl@0
|
57 |
*/
|
sl@0
|
58 |
HBufC8* CreateWmdrmHeaderLC();
|
sl@0
|
59 |
|
sl@0
|
60 |
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
|
sl@0
|
61 |
|
sl@0
|
62 |
/*
|
sl@0
|
63 |
* Load CAFRECOGNIZER.MDL and create an instance of CApaCafRecognizer that can be used
|
sl@0
|
64 |
* by derived classes
|
sl@0
|
65 |
*/
|
sl@0
|
66 |
void LoadCafRecognizerL();
|
sl@0
|
67 |
|
sl@0
|
68 |
/*
|
sl@0
|
69 |
* Delete the instance of CApaCafRecognizer and unload the CAFRECOGNIZER.MDL library
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
void UnLoadCafRecognizer();
|
sl@0
|
72 |
|
sl@0
|
73 |
/*
|
sl@0
|
74 |
* Implementation of CTestStep virtual functions, create and install a CActiveScheduler
|
sl@0
|
75 |
*/
|
sl@0
|
76 |
virtual TVerdict doTestStepPreambleL();
|
sl@0
|
77 |
|
sl@0
|
78 |
/*
|
sl@0
|
79 |
* Implementation of CTestStep virtual functions, uninstalls and removes the CActiveScheduler
|
sl@0
|
80 |
*/
|
sl@0
|
81 |
virtual TVerdict doTestStepPostambleL();
|
sl@0
|
82 |
|
sl@0
|
83 |
/* delete a file */
|
sl@0
|
84 |
TInt Delete(const TDesC& aFile);
|
sl@0
|
85 |
|
sl@0
|
86 |
protected:
|
sl@0
|
87 |
/*
|
sl@0
|
88 |
* Open the file and read data into the buffer up until the length of the buffer
|
sl@0
|
89 |
* aBuffer.Length() will be set to the length of data read
|
sl@0
|
90 |
* @param aFileName the file to read from
|
sl@0
|
91 |
* @param aBuffer the buffer to read into
|
sl@0
|
92 |
*/
|
sl@0
|
93 |
void ReadBufferL(TDesC16& aFileName, TDes8& aBuffer);
|
sl@0
|
94 |
|
sl@0
|
95 |
/* Starts the Apparc server (for use by CSupplier tests)
|
sl@0
|
96 |
*/
|
sl@0
|
97 |
void StartApparcServerL();
|
sl@0
|
98 |
|
sl@0
|
99 |
CApaDataRecognizerType *iRecognizer;
|
sl@0
|
100 |
|
sl@0
|
101 |
/** Is called to initialise the following parameters
|
sl@0
|
102 |
*/
|
sl@0
|
103 |
void InitialiseFileHandleParametersL();
|
sl@0
|
104 |
|
sl@0
|
105 |
RFs iFs;
|
sl@0
|
106 |
RFile iFile;
|
sl@0
|
107 |
TPtrC iUri;
|
sl@0
|
108 |
TPtrC iUniqueId;
|
sl@0
|
109 |
TInt iExpectedResult;
|
sl@0
|
110 |
|
sl@0
|
111 |
private:
|
sl@0
|
112 |
CActiveScheduler *iActiveScheduler;
|
sl@0
|
113 |
TUid iDtorIDKey;
|
sl@0
|
114 |
};
|
sl@0
|
115 |
|
sl@0
|
116 |
#endif
|