|
1 /* |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #if (!defined __RECOGNIZER_STEP_H__) |
|
22 #define __RECOGNIZER_STEP_H__ |
|
23 #include <test/testexecutestepbase.h> |
|
24 |
|
25 #include "cafstep.h" |
|
26 |
|
27 // Constants used to name test cases |
|
28 _LIT(KCAFRecognizeStep,"CAFRecognizeStep"); |
|
29 _LIT(KCAFRecognizerSpeedStep,"CAFRecognizerSpeedStep"); |
|
30 _LIT(KCAFBufferSizeStep,"CAFBufferSizeStep"); |
|
31 _LIT(KCAFApparcStep,"CAFApparcStep"); |
|
32 _LIT(KCAF_DEF077443_Step,"CAF_DEF077443_Step"); |
|
33 _LIT(KCAF_DEF078413_Step,"CAF_DEF078413_Step"); |
|
34 |
|
35 class CCAFServer; |
|
36 class CApaDataRecognizerType; |
|
37 |
|
38 /* |
|
39 * Used to test the CAgentResolver::DoRecognize() function |
|
40 * The ini file used in this test expects the following parameters to be specified |
|
41 * |
|
42 * FileName - full path and filename of the file to be investigated |
|
43 * |
|
44 * Container - the container mime type expected |
|
45 * |
|
46 * Content - the content mime type expected |
|
47 * |
|
48 * Recognized - whether or not CAF should recognize this file |
|
49 * |
|
50 * If an agent recognizes the file, it fills in what it thinks the container and content mime |
|
51 * types of the file are. The test verifies: |
|
52 * The file was recognized correctly (either recognized, or not recognized) |
|
53 * If it was recognized verify that the container mime type is correct |
|
54 * If it was recognized verify that the content mime type is correct |
|
55 * @internalComponent Exposure internally |
|
56 */ |
|
57 class CCAFRecognizeStep : public CCAFStep |
|
58 { |
|
59 public: |
|
60 CCAFRecognizeStep(CCAFServer& aParent); |
|
61 ~CCAFRecognizeStep(); |
|
62 virtual TVerdict doTestStepL(); |
|
63 #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
64 TVerdict doWmdrmTestStepL(); |
|
65 #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT |
|
66 |
|
67 private: |
|
68 void CheckResultL(TBool aResult, TDes8& aContainerMimeType, TDes8& aContentMimeType, TBool aExpectedResult, TDesC16& aExpectedContainerMime, TDesC16& aExpectedContentMime); |
|
69 CCAFServer& iParent; |
|
70 }; |
|
71 |
|
72 /* |
|
73 * Used to test the speed of the CAgentResolver::DoRecognize() function |
|
74 * Creates and instance of CAgentResolver and calls DoRecognize() 1000 times for the file |
|
75 * specified in the INI file. |
|
76 * The ini file used in this test only needs one parameter specified |
|
77 * |
|
78 * FileName - full path and filename of the file to be investigated |
|
79 * |
|
80 * Timing information in the TestExecute log file indicates how long this takes |
|
81 * @internalComponent Exposure internally |
|
82 */ |
|
83 class CCAFRecognizerSpeedStep : public CCAFStep |
|
84 { |
|
85 public: |
|
86 CCAFRecognizerSpeedStep(CCAFServer& aParent); |
|
87 ~CCAFRecognizerSpeedStep (); |
|
88 virtual TVerdict doTestStepL(); |
|
89 private: |
|
90 CCAFServer& iParent; |
|
91 }; |
|
92 |
|
93 |
|
94 /* |
|
95 * Used to test CAgentResolver::PreferredBufferSize() function |
|
96 * CAgentResolver should use the static configuration data in each agent's resource file |
|
97 * to determine the buffer size required for apparc recognition |
|
98 * @internalComponent Exposure internally |
|
99 */ |
|
100 class CCAFBufferSizeStep : public CCAFStep |
|
101 { |
|
102 public: |
|
103 CCAFBufferSizeStep(CCAFServer& aParent); |
|
104 ~CCAFBufferSizeStep(); |
|
105 virtual TVerdict doTestStepL(); |
|
106 private: |
|
107 CCAFServer& iParent; |
|
108 }; |
|
109 |
|
110 |
|
111 /* |
|
112 This test verifys that the CApaCafRecognizer correctly identifies the mime type |
|
113 * The ini file specifies two parameters |
|
114 * |
|
115 * FileName - the file to recognize |
|
116 * |
|
117 * CafMimeType - the expected mime type returned from RecognizeL() |
|
118 * |
|
119 * @internalComponent Exposure internally |
|
120 */ |
|
121 class CCAFApparcStep : public CCAFStep |
|
122 { |
|
123 public: |
|
124 CCAFApparcStep(CCAFServer& aParent); |
|
125 ~CCAFApparcStep(); |
|
126 virtual TVerdict doTestStepL(); |
|
127 private: |
|
128 CCAFServer& iParent; |
|
129 }; |
|
130 |
|
131 /* |
|
132 This test verifies that upper case Mime types can be recognized. |
|
133 * |
|
134 * See DEF077443: Propagated:CAF should not be performing case sensitive comparisons on MIME types |
|
135 * |
|
136 * @internalComponent Exposure internally |
|
137 */ |
|
138 class CCAF_DEF077443_Step : public CCAFStep |
|
139 { |
|
140 public: |
|
141 CCAF_DEF077443_Step(CCAFServer& aParent); |
|
142 ~CCAF_DEF077443_Step(); |
|
143 virtual TVerdict doTestStepL(); |
|
144 private: |
|
145 CCAFServer& iParent; |
|
146 }; |
|
147 |
|
148 |
|
149 #endif |