|
1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #ifndef TRENDERORIENTATION_H |
|
23 #define TRENDERORIENTATION_H |
|
24 |
|
25 #include <e32property.h> |
|
26 #include "te_graphicsperformanceSuiteStepBase.h" |
|
27 |
|
28 /** |
|
29 CTWindowSet contains a window server session, a group window and a child window. |
|
30 */ |
|
31 class CTWindowSet : public CBase |
|
32 { |
|
33 public: |
|
34 ~CTWindowSet(); |
|
35 void ConstructL(); |
|
36 void Destroy(); |
|
37 |
|
38 inline RWsSession& Session() |
|
39 {return iWs;}; |
|
40 inline RWindowGroup& WindowGroup() |
|
41 {return iWindowGroup;}; |
|
42 |
|
43 private: |
|
44 RWsSession iWs; |
|
45 RWindowGroup iWindowGroup; |
|
46 RWindow iChildWindow; |
|
47 }; |
|
48 |
|
49 /** |
|
50 Test case to test the performance of various use cases which affect the render orientation RProperty |
|
51 */ |
|
52 class CTRenderOrientation : public CTe_graphicsperformanceSuiteStepBase |
|
53 { |
|
54 public: |
|
55 CTRenderOrientation(); |
|
56 ~CTRenderOrientation(); |
|
57 |
|
58 // From CTestStep |
|
59 virtual TVerdict doTestStepPreambleL(); |
|
60 virtual TVerdict doTestStepPostambleL(); |
|
61 |
|
62 virtual TVerdict doTestStepL(); |
|
63 |
|
64 private: |
|
65 enum TWindowSet |
|
66 { |
|
67 // One per orientation |
|
68 EFirstWindowSet, |
|
69 ESecondWindowSet, |
|
70 EThirdWindowSet, |
|
71 EFourthWindowSet, |
|
72 |
|
73 ENumWindowSets |
|
74 }; |
|
75 |
|
76 enum TTestPhase |
|
77 { |
|
78 EIndicatedOrientationChange, // window indicates a new render orientation |
|
79 EWindowOrdinalChange, // window order changed, render orientation dictated by a different window with a different orientation |
|
80 EThemeOrientationChange, // theme orientation changed, render orienation dictated by this due to relevant window being set to EDisplayOrientationAuto |
|
81 EThemeOrientationChangeOnly, // theme orientation change only, to compare timings to above |
|
82 |
|
83 ENumTestPhases |
|
84 }; |
|
85 |
|
86 void TestOrientationChangeL(const TDesC& aStepName, TTestPhase aTestPhase); |
|
87 |
|
88 TRenderOrientation GetRenderOrientationL(); |
|
89 TRenderOrientation GetThemeOrientationL(); |
|
90 TRenderOrientation GetOrientationL(RProperty& aProperty); |
|
91 void ThemeServerProperty(const TDesC& aCmd); |
|
92 |
|
93 private: |
|
94 CTWindowSet iWindowSet[ENumWindowSets]; |
|
95 RProperty iWsRenderOrientationProperty; |
|
96 RProperty iThemeOrientationProperty; |
|
97 |
|
98 RTimer iTimeoutTimer; |
|
99 TRequestStatus iTimeoutStatus; |
|
100 TRequestStatus iOrientationStatus; |
|
101 TInt iTimingsTaken; |
|
102 }; |
|
103 |
|
104 _LIT(KTRenderOrientation,"trenderorientation"); |
|
105 |
|
106 #endif /* TRENDERORIENTATION_H */ |