77
|
1 |
/*
|
|
2 |
* Copyright (c) 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 "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: STIF testclass declaration
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef TSANIMIHL_H
|
|
19 |
#define TSANIMIHL_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <StifLogger.h>
|
|
23 |
#include <TestScripterInternal.h>
|
|
24 |
#include <StifTestModule.h>
|
|
25 |
#include <TestclassAssert.h>
|
|
26 |
|
|
27 |
#include <f32file.h>
|
|
28 |
#include "sanimobserver.h"
|
|
29 |
|
|
30 |
class CSAnimImagePlugin;
|
|
31 |
class CSAnimIhlPluginTestSuite;
|
|
32 |
class CTestWaiter;
|
|
33 |
|
|
34 |
// FORWARD DECLARATIONS
|
|
35 |
//class ?FORWARD_CLASSNAME;
|
|
36 |
class CTsanimihl;
|
|
37 |
|
|
38 |
class TMockIhlAnimationObserver : public MSAnimObserver
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
TMockIhlAnimationObserver( CTsanimihl& aTestSuite ) : iTestSuite( aTestSuite ) {}
|
|
42 |
virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ );
|
|
43 |
virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/ );
|
|
44 |
private:
|
|
45 |
CTsanimihl& iTestSuite;
|
|
46 |
};
|
|
47 |
|
|
48 |
|
|
49 |
// CONSTANTS
|
|
50 |
//const ?type ?constant_var = ?constant;
|
|
51 |
|
|
52 |
// MACROS
|
|
53 |
//#define ?macro ?macro_def
|
|
54 |
#define TEST_CLASS_VERSION_MAJOR 0
|
|
55 |
#define TEST_CLASS_VERSION_MINOR 0
|
|
56 |
#define TEST_CLASS_VERSION_BUILD 0
|
|
57 |
|
|
58 |
// Logging path
|
|
59 |
_LIT( KTsanimihlLogPath, "\\logs\\testframework\\Tsanimihl\\" );
|
|
60 |
// Log file
|
|
61 |
_LIT( KTsanimihlLogFile, "Tsanimihl.txt" );
|
|
62 |
_LIT( KTsanimihlLogFileWithTitle, "Tsanimihl_[%S].txt" );
|
|
63 |
|
|
64 |
// FUNCTION PROTOTYPES
|
|
65 |
//?type ?function_name(?arg_list);
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
// DATA TYPES
|
|
70 |
//enum ?declaration
|
|
71 |
//typedef ?declaration
|
|
72 |
//extern ?data_type;
|
|
73 |
|
|
74 |
// CLASS DECLARATION
|
|
75 |
|
|
76 |
/**
|
|
77 |
* CTsanimihl test class for STIF Test Framework TestScripter.
|
|
78 |
* ?other_description_lines
|
|
79 |
*
|
|
80 |
* @lib ?library
|
|
81 |
* @since ?Series60_version
|
|
82 |
*/
|
|
83 |
NONSHARABLE_CLASS(CTsanimihl) : public CScriptBase
|
|
84 |
{
|
|
85 |
public: // Constructors and destructor
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Two-phased constructor.
|
|
89 |
*/
|
|
90 |
static CTsanimihl* NewL( CTestModuleIf& aTestModuleIf );
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Destructor.
|
|
94 |
*/
|
|
95 |
virtual ~CTsanimihl();
|
|
96 |
|
|
97 |
public: // New functions
|
|
98 |
|
|
99 |
/**
|
|
100 |
* ?member_description.
|
|
101 |
* @since ?Series60_version
|
|
102 |
* @param ?arg1 ?description
|
|
103 |
* @return ?description
|
|
104 |
*/
|
|
105 |
//?type ?member_function( ?type ?arg1 );
|
|
106 |
|
|
107 |
public: // Functions from base classes
|
|
108 |
|
|
109 |
/**
|
|
110 |
* From CScriptBase Runs a script line.
|
|
111 |
* @since ?Series60_version
|
|
112 |
* @param aItem Script line containing method name and parameters
|
|
113 |
* @return Symbian OS error code
|
|
114 |
*/
|
|
115 |
virtual TInt RunMethodL( CStifItemParser& aItem );
|
|
116 |
|
|
117 |
|
|
118 |
protected: // Functions from base classes
|
|
119 |
|
|
120 |
/**
|
|
121 |
* From ?base_class ?member_description
|
|
122 |
*/
|
|
123 |
//?type ?member_function();
|
|
124 |
|
|
125 |
private:
|
|
126 |
|
|
127 |
/**
|
|
128 |
* C++ default constructor.
|
|
129 |
*/
|
|
130 |
CTsanimihl( CTestModuleIf& aTestModuleIf );
|
|
131 |
|
|
132 |
/**
|
|
133 |
* By default Symbian 2nd phase constructor is private.
|
|
134 |
*/
|
|
135 |
void ConstructL();
|
|
136 |
|
|
137 |
// Prohibit copy constructor if not deriving from CBase.
|
|
138 |
// ?classname( const ?classname& );
|
|
139 |
// Prohibit assigment operator if not deriving from CBase.
|
|
140 |
// ?classname& operator=( const ?classname& );
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Frees all resources allocated from test methods.
|
|
144 |
* @since ?Series60_version
|
|
145 |
*/
|
|
146 |
void Delete();
|
|
147 |
|
|
148 |
private: // New methods
|
|
149 |
|
|
150 |
/**
|
|
151 |
* Example test method.
|
|
152 |
* @since ?Series60_version
|
|
153 |
* @param aItem Script line containing parameters.
|
|
154 |
* @return Symbian OS error code.
|
|
155 |
*/
|
|
156 |
TInt ExampleL( CStifItemParser& aItem );
|
|
157 |
TInt SetupEmptyL();
|
|
158 |
TInt SetupObjL();
|
|
159 |
TInt SetupStillImageL();
|
|
160 |
TInt SetupAnimationL();
|
|
161 |
TInt SetupMultiFrameL();
|
|
162 |
TInt SetupStillImageWithBgColourL();
|
|
163 |
TInt Teardown();
|
|
164 |
|
|
165 |
TInt TestConstructorL();
|
|
166 |
TInt TestConstructorNoMemoryL();
|
|
167 |
TInt TestUnknownFileL();
|
|
168 |
TInt TestCorruptFileL();
|
|
169 |
TInt TestLoadStillImageGray2L();
|
|
170 |
TInt TestLoadStillImageColourL();
|
|
171 |
TInt TestLoadAnimationL();
|
|
172 |
TInt TestLoadMultiFrameL();
|
|
173 |
TInt TestLoadStillImageNoMemoryL();
|
|
174 |
TInt TestLoadAnimationNoMemoryL();
|
|
175 |
TInt TestCancelLoadStillImageL();
|
|
176 |
TInt TestCancelLoadAnimationL();
|
|
177 |
TInt TestCancelLoadMultiFrameL();
|
|
178 |
TInt TestShowStillImageL();
|
|
179 |
TInt TestShowStillImageWithFrameDelayL();
|
|
180 |
TInt TestShowAnimationL();
|
|
181 |
TInt TestShowMultiFrameL();
|
|
182 |
TInt TestCancelPlayL();
|
|
183 |
TInt TestBgColourL();
|
|
184 |
TInt TestBgColourBeforeLoadL();
|
|
185 |
TInt TestScaleStillImageL();
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Method used to log version of test class
|
|
189 |
*/
|
|
190 |
void SendTestClassVersion();
|
|
191 |
|
|
192 |
//ADD NEW METHOD DEC HERE
|
|
193 |
//[TestMethods] - Do not remove
|
|
194 |
|
|
195 |
public: // Data
|
|
196 |
// ?one_line_short_description_of_data
|
|
197 |
//?data_declaration;
|
|
198 |
|
|
199 |
protected: // Data
|
|
200 |
// ?one_line_short_description_of_data
|
|
201 |
//?data_declaration;
|
|
202 |
|
|
203 |
private: // Data
|
|
204 |
friend class TMockIhlAnimationObserver;
|
|
205 |
|
|
206 |
/** File server session used in testing. */
|
|
207 |
RFs iFs;
|
|
208 |
|
|
209 |
/** Instance of the class that this test suite is testing. */
|
|
210 |
CSAnimImagePlugin* iTestObj;
|
|
211 |
|
|
212 |
/** A 32 bit identifer returned by ECom to identify this instance to the framework. */
|
|
213 |
TUid iDtorKey;
|
|
214 |
|
|
215 |
/** For testing async calls. */
|
|
216 |
CTestWaiter* iWaiter;
|
|
217 |
|
|
218 |
/** For testing correct number of calls to animation observer. */
|
|
219 |
TInt iFrameCounter;
|
|
220 |
|
|
221 |
/** Animation observer for testing. */
|
|
222 |
TMockIhlAnimationObserver iObserver;
|
|
223 |
// ?one_line_short_description_of_data
|
|
224 |
//?data_declaration;
|
|
225 |
|
|
226 |
// Reserved pointer for future extension
|
|
227 |
//TAny* iReserved;
|
|
228 |
|
|
229 |
};
|
|
230 |
|
|
231 |
#endif // TSANIMIHL_H
|
|
232 |
|
|
233 |
// End of File
|