77
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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 "Symbian Foundation License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Declaration of CSAnimMifPluginTestSuite class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef SANIMMIFPLUGINTESTSUITE_H
|
|
20 |
#define SANIMMIFPLUGINTESTSUITE_H
|
|
21 |
|
|
22 |
#include <ceunittestsuiteclass.h>
|
|
23 |
#include <e32def.h>
|
|
24 |
#include <f32file.h>
|
|
25 |
#include "sanimobserver.h"
|
|
26 |
|
|
27 |
class CSAnimImagePlugin;
|
|
28 |
class CSAnimMifPluginTestSuite;
|
|
29 |
class CTestWaiter;
|
|
30 |
|
|
31 |
NONSHARABLE_CLASS( TMockMifAnimationObserver ) : public MSAnimObserver
|
|
32 |
{
|
|
33 |
public:
|
|
34 |
TMockMifAnimationObserver( CSAnimMifPluginTestSuite& aTestSuite ) : iTestSuite( aTestSuite ) {}
|
|
35 |
virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/, const CFbsBitmap& /*aMask*/ );
|
|
36 |
virtual void UpdateScreen( const CFbsBitmap& /*aFrame*/ );
|
|
37 |
private:
|
|
38 |
CSAnimMifPluginTestSuite& iTestSuite;
|
|
39 |
};
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Test cases for CSAnimSvgPlugin class.
|
|
43 |
*
|
|
44 |
* @lib None
|
|
45 |
* @since S60 3.2
|
|
46 |
*/
|
|
47 |
NONSHARABLE_CLASS( CSAnimMifPluginTestSuite ) : public CEUnitTestSuiteClass
|
|
48 |
{
|
|
49 |
|
|
50 |
public:
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Constructs a CSAnimMifPluginTestSuite object.
|
|
54 |
*
|
|
55 |
* @since S60 3.2
|
|
56 |
*
|
|
57 |
* @return The new object
|
|
58 |
*/
|
|
59 |
static CSAnimMifPluginTestSuite* NewL();
|
|
60 |
static CSAnimMifPluginTestSuite* NewLC();
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Destructor.
|
|
64 |
*
|
|
65 |
* @since S60 3.2
|
|
66 |
*/
|
|
67 |
virtual ~CSAnimMifPluginTestSuite();
|
|
68 |
|
|
69 |
private:
|
|
70 |
|
|
71 |
/**
|
|
72 |
* First phase constructor.
|
|
73 |
*
|
|
74 |
* @since S60 3.2
|
|
75 |
*/
|
|
76 |
CSAnimMifPluginTestSuite();
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Second phase constructor.
|
|
80 |
*
|
|
81 |
* @since S60 3.2
|
|
82 |
*/
|
|
83 |
void ConstructL();
|
|
84 |
|
|
85 |
private: // New methods
|
|
86 |
|
|
87 |
void SetupEmptyL();
|
|
88 |
void SetupObjL();
|
|
89 |
void SetupFileL( const TDesC& aFileName );
|
|
90 |
void SetupStillImageNoMaskL();
|
|
91 |
void SetupStillImageL();
|
|
92 |
void SetupScaledAnimationL();
|
|
93 |
void SetupUnscaledAnimationL();
|
|
94 |
void SetupFinishedL();
|
|
95 |
void Teardown();
|
|
96 |
|
|
97 |
void TestConstructorL();
|
|
98 |
void TestConstructorNoMemoryL();
|
|
99 |
void TestUnknownFileL();
|
|
100 |
void TestCorruptFileL();
|
|
101 |
void TestNoFramesFileL();
|
|
102 |
void TestLoadStillImageL();
|
|
103 |
void TestLoadScaledAnimationL();
|
|
104 |
void TestLoadUnscaledAnimationL();
|
|
105 |
void TestLoadNoMemoryL();
|
|
106 |
void TestCancelLoadL();
|
|
107 |
void TestShowStillImageL();
|
|
108 |
void TestShowAnimationL();
|
|
109 |
void TestCancelStillImageL();
|
|
110 |
void TestCancelAnimationL();
|
|
111 |
void TestCancelNotActiveL();
|
|
112 |
void TestShowBeforeLoadL();
|
|
113 |
void TestSetDisplayModeL();
|
|
114 |
void TestSetSizeL();
|
|
115 |
void TestSetFrameDelayL();
|
|
116 |
void TestBackroundColourL();
|
|
117 |
|
|
118 |
private: // data
|
|
119 |
|
|
120 |
EUNIT_DECLARE_TEST_TABLE;
|
|
121 |
|
|
122 |
friend class TMockMifAnimationObserver;
|
|
123 |
|
|
124 |
/** File server session used in testing. */
|
|
125 |
RFs iFs;
|
|
126 |
|
|
127 |
/** Instance of the class that this test suite is testing. */
|
|
128 |
CSAnimImagePlugin* iTestObj;
|
|
129 |
|
|
130 |
/** A 32 bit identifer returned by ECom to identify this instance to the framework. */
|
|
131 |
TUid iDtorKey;
|
|
132 |
|
|
133 |
/** For testing async calls. */
|
|
134 |
CTestWaiter* iWaiter;
|
|
135 |
|
|
136 |
/** For testing correct number of calls to animation observer. */
|
|
137 |
TInt iFrameCounter;
|
|
138 |
|
|
139 |
/** Animation observer for testing. */
|
|
140 |
TMockMifAnimationObserver iObserver;
|
|
141 |
|
|
142 |
};
|
|
143 |
|
|
144 |
#endif // SANIMMIFPLUGINTESTSUITE_H
|