|
1 /* |
|
2 * Copyright (c) 2008 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: alfperfapp cover test case class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_ALFPERFAPPCOVERTESTCASE_H |
|
20 #define C_ALFPERFAPPCOVERTESTCASE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <aknappui.h> |
|
24 #include <alf/alfimagevisual.h> |
|
25 #include <alf/alftexturemanager.h> |
|
26 |
|
27 #include "alfperfapptestcase.h" |
|
28 |
|
29 |
|
30 class CAlfImageLoaderUtil; |
|
31 class CAlfLayout; |
|
32 class CAlfViewportLayout; |
|
33 |
|
34 class CAlfPerfAppCoverTestCaseControl; |
|
35 |
|
36 |
|
37 /** |
|
38 * CAlfPerfAppCoverTestCase class for measuring the frame rate |
|
39 * when images are scrolled left and right and scaled. |
|
40 */ |
|
41 class CAlfPerfAppCoverTestCase |
|
42 : public CAlfPerfAppTestCase, |
|
43 public MAlfTextureLoadingCompletedObserver |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Returns ETrue if test case is supported. |
|
48 * @param aCaseId test case id. |
|
49 * @return ETrue if supported. |
|
50 */ |
|
51 static TBool IsSupported( TInt aCaseId ); |
|
52 |
|
53 static CAlfPerfAppCoverTestCase* NewL( TInt aCaseId, TInt aSequenceIndex); |
|
54 virtual ~CAlfPerfAppCoverTestCase(); |
|
55 |
|
56 // From base class CAlfPerfAppTestCase: |
|
57 virtual void SetupL( |
|
58 CAlfEnv& aEnv, |
|
59 const TRect& aVisibleArea, |
|
60 TRequestStatus& aStatus ); |
|
61 virtual void ExecuteL( TRequestStatus& aStatus ); |
|
62 virtual void TearDown(); |
|
63 virtual void HandleVisibleAreaChange( const TRect& aRect ); |
|
64 |
|
65 // From base class MAlfTextureLoadingCompletedObserver |
|
66 void TextureLoadingCompleted( |
|
67 CAlfTexture& aTexture, TInt aTextureId, TInt aErrorCode ); |
|
68 virtual TInt CaseID(); |
|
69 |
|
70 protected: |
|
71 |
|
72 CAlfPerfAppCoverTestCase( TInt aCaseId, TInt aSequenceIndex ); |
|
73 void ConstructL(); |
|
74 |
|
75 private: |
|
76 private: |
|
77 /** |
|
78 * Test case of which execution this instance was created. |
|
79 */ |
|
80 TInt iCaseId; |
|
81 |
|
82 /** |
|
83 * A temporary store for holding the status of orientation |
|
84 * information of the application before the test case |
|
85 * is started. The previous value is restored in teardown. |
|
86 */ |
|
87 CAknAppUiBase::TAppUiOrientation iOrientation; |
|
88 |
|
89 /** |
|
90 * Alf environment. |
|
91 * Not owned. |
|
92 */ |
|
93 CAlfEnv* iEnv; |
|
94 |
|
95 /** |
|
96 * Test case control. |
|
97 * Not owned. |
|
98 */ |
|
99 CAlfPerfAppCoverTestCaseControl* iControl; |
|
100 |
|
101 private: |
|
102 |
|
103 #if 0 |
|
104 /** |
|
105 * Next cycle. |
|
106 */ |
|
107 void NextCycleL(); |
|
108 |
|
109 /** |
|
110 * Returns opacity for index. |
|
111 */ |
|
112 TReal32 OpacityForIndex( TInt aIndex ); |
|
113 |
|
114 /** |
|
115 * Returns size for index. |
|
116 */ |
|
117 TAlfRealSize SizeForIndex( TInt aIndex ); |
|
118 |
|
119 /** |
|
120 * Returns position for index. |
|
121 */ |
|
122 TAlfRealPoint PositionForIndex( TInt aIndex, const TAlfRealSize& aSize ); |
|
123 #endif |
|
124 |
|
125 private: |
|
126 |
|
127 /** |
|
128 * Image visuals. |
|
129 */ |
|
130 RPointerArray< CAlfImageVisual > iImages; |
|
131 |
|
132 /** |
|
133 * Cycle counter. |
|
134 */ |
|
135 TInt iCycleCounter; |
|
136 |
|
137 /** |
|
138 * Image loader utility. |
|
139 * Owned. |
|
140 */ |
|
141 CAlfImageLoaderUtil* iLoader; |
|
142 |
|
143 TInt iLoadedImages; |
|
144 TRequestStatus* iStatus; |
|
145 |
|
146 }; |
|
147 |
|
148 #endif // C_ALFPERFAPPCOVERTESTCASE_H |
|
149 |