First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Set of tests for Tracing Device Rotation. These tests generally test
15 // the RWsSession::IndicateAppOrientation(...) API.
21 @internalComponent - Internal Nokia test code
24 #ifndef __TDEVICERORATION_H__
25 #define __TDEVICERORATION_H__
29 #include <e32property.h>
30 #include <test/testexecutestepbase.h>
31 #include "../tlib/testbase.h"
33 #include "TGraphicsHarness.h"
34 #include <wspublishandsubscribedata.h>
37 // CTDeviceRotation Definition
40 class CTDeviceRotation: public CTGraphicsBase
43 CTDeviceRotation(CTestStep* aStep);
45 /*Sets the windowing environment,*/
49 //from CTGraphicsStep - Calls the device rotation test.
50 virtual void RunTestCaseL(TInt aCurTestCase);
53 void SimulateThemeServerOrientation(TRenderOrientation aExpectedaOrientation);
54 void CheckHalSetting(TRenderOrientation aOrientation);
55 void IsOrientationCorrect(TRenderOrientation aOrientation);
56 void TestIndicateAppOrientation(TRenderOrientation aOrientation);
57 void TestIndicateAppOrientation(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
58 void TestIgnoredAppOrientation(TRenderOrientation aSecondOrientation, TInt aThemeServerOrientation, TInt aExpectedOrientation);
59 void TestAppOrientationOnSwap(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
61 inline void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine)
63 iStep->testBooleanTrueL(aCondition, aFile, aLine, ETrue);
67 void TestInitialOrientation();
68 void TestFixedOrientations();
69 void TestAutoOrientation();
70 void TestIgnoreOrientation();
71 void TestFixedOrientationsOnWindowSwap();
72 void TestAutoOrientationOnWindowSwap();
73 void TestIgnoreOrientationOnWindowSwap();
74 void TestIgnoreAutoOrientationOnWindowSwap();
75 void TestInvalidAppOrientation();
76 void TestInvalidThemeServerOrientation();
80 // First Session and Window Group
82 RWindowGroup iWindowGroup;
84 // Second Session and Window Group
86 RWindowGroup iSecondWindowGroup;
87 RWindow iSecondChildWindow;
89 RProperty iRenderOrientationProperty;
91 TRequestStatus iPublishTimerStatus;
92 TRequestStatus iRenderOrientationStatus;
93 RProperty iThemeServerOrientationProperty;
95 TRenderOrientation iCurrentThemeServerOrientation;
96 TBool iWaitForPublishOnNextTest; //Set to EFalse to skip waiting for publish on next test, default ETrue, Resets to ETrue on each Test.
99 class CTDeviceRotationStep : public CTGraphicsStep
102 CTDeviceRotationStep();
104 //from CTGraphicsStep
105 virtual CTGraphicsBase* CreateTestL();
108 _LIT(KTDeviceRotationStep,"TDeviceRotation");
110 #endif //TDEVICERORATION