1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/tdevicerotation.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,110 @@
1.4 +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Set of tests for Tracing Device Rotation. These tests generally test
1.18 +// the RWsSession::IndicateAppOrientation(...) API.
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @test
1.24 + @internalComponent - Internal Nokia test code
1.25 +*/
1.26 +
1.27 +#ifndef __TDEVICERORATION_H__
1.28 +#define __TDEVICERORATION_H__
1.29 +
1.30 +#include <e32std.h>
1.31 +#include <w32std.h>
1.32 +#include <e32property.h>
1.33 +#include <test/testexecutestepbase.h>
1.34 +#include "../tlib/testbase.h"
1.35 +#include "AUTO.H"
1.36 +#include "TGraphicsHarness.h"
1.37 +#include <wspublishandsubscribedata.h>
1.38 +
1.39 +//
1.40 +// CTDeviceRotation Definition
1.41 +//
1.42 +
1.43 +class CTDeviceRotation: public CTGraphicsBase
1.44 + {
1.45 +public:
1.46 + CTDeviceRotation(CTestStep* aStep);
1.47 + ~CTDeviceRotation();
1.48 + /*Sets the windowing environment,*/
1.49 + void ConstructL();
1.50 +
1.51 +protected:
1.52 + //from CTGraphicsStep - Calls the device rotation test.
1.53 + virtual void RunTestCaseL(TInt aCurTestCase);
1.54 +private:
1.55 + //tool functions
1.56 + void SimulateThemeServerOrientation(TRenderOrientation aExpectedaOrientation);
1.57 + void CheckHalSetting(TRenderOrientation aOrientation);
1.58 + void IsOrientationCorrect(TRenderOrientation aOrientation);
1.59 + void TestIndicateAppOrientation(TRenderOrientation aOrientation);
1.60 + void TestIndicateAppOrientation(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
1.61 + void TestIgnoredAppOrientation(TRenderOrientation aSecondOrientation, TInt aThemeServerOrientation, TInt aExpectedOrientation);
1.62 + void TestAppOrientationOnSwap(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
1.63 + //For TESTL
1.64 + inline void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine)
1.65 + {
1.66 + iStep->testBooleanTrueL(aCondition, aFile, aLine, ETrue);
1.67 + }
1.68 +private:
1.69 + //Test Cases
1.70 + void TestInitialOrientation();
1.71 + void TestFixedOrientations();
1.72 + void TestAutoOrientation();
1.73 + void TestIgnoreOrientation();
1.74 + void TestFixedOrientationsOnWindowSwap();
1.75 + void TestAutoOrientationOnWindowSwap();
1.76 + void TestIgnoreOrientationOnWindowSwap();
1.77 + void TestIgnoreAutoOrientationOnWindowSwap();
1.78 + void TestInvalidAppOrientation();
1.79 + void TestInvalidThemeServerOrientation();
1.80 +
1.81 +private:
1.82 + //members
1.83 + // First Session and Window Group
1.84 + RWsSession iWs;
1.85 + RWindowGroup iWindowGroup;
1.86 + RWindow iChildWindow;
1.87 + // Second Session and Window Group
1.88 + RWsSession iSecondWs;
1.89 + RWindowGroup iSecondWindowGroup;
1.90 + RWindow iSecondChildWindow;
1.91 +
1.92 + RProperty iRenderOrientationProperty;
1.93 + RTimer iPublishTimer;
1.94 + TRequestStatus iPublishTimerStatus;
1.95 + TRequestStatus iRenderOrientationStatus;
1.96 + RProperty iThemeServerOrientationProperty;
1.97 +
1.98 + TRenderOrientation iCurrentThemeServerOrientation;
1.99 + TBool iWaitForPublishOnNextTest; //Set to EFalse to skip waiting for publish on next test, default ETrue, Resets to ETrue on each Test.
1.100 + };
1.101 +
1.102 +class CTDeviceRotationStep : public CTGraphicsStep
1.103 + {
1.104 +public:
1.105 + CTDeviceRotationStep();
1.106 +protected:
1.107 + //from CTGraphicsStep
1.108 + virtual CTGraphicsBase* CreateTestL();
1.109 + };
1.110 +
1.111 +_LIT(KTDeviceRotationStep,"TDeviceRotation");
1.112 +
1.113 +#endif //TDEVICERORATION