sl@0: // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Set of tests for Tracing Device Rotation. These tests generally test sl@0: // the RWsSession::IndicateAppOrientation(...) API. sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Nokia test code sl@0: */ sl@0: sl@0: #ifndef __TDEVICERORATION_H__ sl@0: #define __TDEVICERORATION_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include "../tlib/testbase.h" sl@0: #include "AUTO.H" sl@0: #include "TGraphicsHarness.h" sl@0: #include sl@0: sl@0: // sl@0: // CTDeviceRotation Definition sl@0: // sl@0: sl@0: class CTDeviceRotation: public CTGraphicsBase sl@0: { sl@0: public: sl@0: CTDeviceRotation(CTestStep* aStep); sl@0: ~CTDeviceRotation(); sl@0: /*Sets the windowing environment,*/ sl@0: void ConstructL(); sl@0: sl@0: protected: sl@0: //from CTGraphicsStep - Calls the device rotation test. sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: private: sl@0: //tool functions sl@0: void SimulateThemeServerOrientation(TRenderOrientation aExpectedaOrientation); sl@0: void CheckHalSetting(TRenderOrientation aOrientation); sl@0: void IsOrientationCorrect(TRenderOrientation aOrientation); sl@0: void TestIndicateAppOrientation(TRenderOrientation aOrientation); sl@0: void TestIndicateAppOrientation(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation); sl@0: void TestIgnoredAppOrientation(TRenderOrientation aSecondOrientation, TInt aThemeServerOrientation, TInt aExpectedOrientation); sl@0: void TestAppOrientationOnSwap(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation); sl@0: //For TESTL sl@0: inline void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine) sl@0: { sl@0: iStep->testBooleanTrueL(aCondition, aFile, aLine, ETrue); sl@0: } sl@0: private: sl@0: //Test Cases sl@0: void TestInitialOrientation(); sl@0: void TestFixedOrientations(); sl@0: void TestAutoOrientation(); sl@0: void TestIgnoreOrientation(); sl@0: void TestFixedOrientationsOnWindowSwap(); sl@0: void TestAutoOrientationOnWindowSwap(); sl@0: void TestIgnoreOrientationOnWindowSwap(); sl@0: void TestIgnoreAutoOrientationOnWindowSwap(); sl@0: void TestInvalidAppOrientation(); sl@0: void TestInvalidThemeServerOrientation(); sl@0: sl@0: private: sl@0: //members sl@0: // First Session and Window Group sl@0: RWsSession iWs; sl@0: RWindowGroup iWindowGroup; sl@0: RWindow iChildWindow; sl@0: // Second Session and Window Group sl@0: RWsSession iSecondWs; sl@0: RWindowGroup iSecondWindowGroup; sl@0: RWindow iSecondChildWindow; sl@0: sl@0: RProperty iRenderOrientationProperty; sl@0: RTimer iPublishTimer; sl@0: TRequestStatus iPublishTimerStatus; sl@0: TRequestStatus iRenderOrientationStatus; sl@0: RProperty iThemeServerOrientationProperty; sl@0: sl@0: TRenderOrientation iCurrentThemeServerOrientation; sl@0: TBool iWaitForPublishOnNextTest; //Set to EFalse to skip waiting for publish on next test, default ETrue, Resets to ETrue on each Test. sl@0: }; sl@0: sl@0: class CTDeviceRotationStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTDeviceRotationStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: _LIT(KTDeviceRotationStep,"TDeviceRotation"); sl@0: sl@0: #endif //TDEVICERORATION