windowing/windowserver/test/tauto/tdevicerotation.h
changeset 188 1b081cb0800b
equal deleted inserted replaced
187:9f66f99ee56f 188:1b081cb0800b
       
     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 // Set of tests for Tracing Device Rotation. These tests generally test
       
    15 // the RWsSession::IndicateAppOrientation(...) API.
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @test
       
    21  @internalComponent - Internal Nokia test code
       
    22 */
       
    23 
       
    24 #ifndef __TDEVICERORATION_H__
       
    25 #define __TDEVICERORATION_H__
       
    26 
       
    27 #include <e32std.h>
       
    28 #include <w32std.h>
       
    29 #include <e32property.h>
       
    30 #include <test/testexecutestepbase.h>
       
    31 #include "../tlib/testbase.h"
       
    32 #include "AUTO.H"
       
    33 #include "TGraphicsHarness.h"
       
    34 #include <wspublishandsubscribedata.h>
       
    35 
       
    36 //
       
    37 // CTDeviceRotation Definition
       
    38 //
       
    39 
       
    40 class CTDeviceRotation: public CTGraphicsBase
       
    41 	{
       
    42 public:
       
    43     CTDeviceRotation(CTestStep* aStep);
       
    44 	~CTDeviceRotation();
       
    45 	/*Sets the windowing environment,*/
       
    46 	void ConstructL();
       
    47 
       
    48 protected:
       
    49 	//from 	CTGraphicsStep - Calls the device rotation test.
       
    50 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    51 private: 
       
    52 	//tool functions
       
    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);
       
    60 	//For TESTL
       
    61 	inline void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine) 
       
    62 	    {
       
    63 	    iStep->testBooleanTrueL(aCondition, aFile, aLine, ETrue);
       
    64 	    }
       
    65 private:
       
    66 	//Test Cases
       
    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();
       
    77 	
       
    78 private:
       
    79 	//members
       
    80 	// First Session and Window Group
       
    81 	RWsSession iWs;
       
    82 	RWindowGroup iWindowGroup;
       
    83     RWindow iChildWindow;
       
    84     // Second Session and Window Group
       
    85 	RWsSession iSecondWs;
       
    86 	RWindowGroup iSecondWindowGroup;
       
    87 	RWindow iSecondChildWindow;
       
    88 		
       
    89 	RProperty iRenderOrientationProperty;
       
    90 	RTimer iPublishTimer;
       
    91 	TRequestStatus iPublishTimerStatus;
       
    92 	TRequestStatus iRenderOrientationStatus;
       
    93 	RProperty iThemeServerOrientationProperty;
       
    94 
       
    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.
       
    97 	};
       
    98 
       
    99 class CTDeviceRotationStep : public CTGraphicsStep
       
   100 	{
       
   101 public:
       
   102 	CTDeviceRotationStep();
       
   103 protected:
       
   104 	//from CTGraphicsStep
       
   105 	virtual CTGraphicsBase* CreateTestL();
       
   106 	};
       
   107 
       
   108 _LIT(KTDeviceRotationStep,"TDeviceRotation");
       
   109 
       
   110 #endif //TDEVICERORATION