os/graphics/windowing/windowserver/test/tauto/tdevicerotation.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Set of tests for Tracing Device Rotation. These tests generally test
sl@0
    15
// the RWsSession::IndicateAppOrientation(...) API.
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @test
sl@0
    21
 @internalComponent - Internal Nokia test code
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef __TDEVICERORATION_H__
sl@0
    25
#define __TDEVICERORATION_H__
sl@0
    26
sl@0
    27
#include <e32std.h>
sl@0
    28
#include <w32std.h>
sl@0
    29
#include <e32property.h>
sl@0
    30
#include <test/testexecutestepbase.h>
sl@0
    31
#include "../tlib/testbase.h"
sl@0
    32
#include "AUTO.H"
sl@0
    33
#include "TGraphicsHarness.h"
sl@0
    34
#include <wspublishandsubscribedata.h>
sl@0
    35
sl@0
    36
//
sl@0
    37
// CTDeviceRotation Definition
sl@0
    38
//
sl@0
    39
sl@0
    40
class CTDeviceRotation: public CTGraphicsBase
sl@0
    41
	{
sl@0
    42
public:
sl@0
    43
    CTDeviceRotation(CTestStep* aStep);
sl@0
    44
	~CTDeviceRotation();
sl@0
    45
	/*Sets the windowing environment,*/
sl@0
    46
	void ConstructL();
sl@0
    47
sl@0
    48
protected:
sl@0
    49
	//from 	CTGraphicsStep - Calls the device rotation test.
sl@0
    50
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
    51
private: 
sl@0
    52
	//tool functions
sl@0
    53
	void SimulateThemeServerOrientation(TRenderOrientation aExpectedaOrientation);
sl@0
    54
	void CheckHalSetting(TRenderOrientation aOrientation);
sl@0
    55
	void IsOrientationCorrect(TRenderOrientation aOrientation);
sl@0
    56
	void TestIndicateAppOrientation(TRenderOrientation aOrientation);
sl@0
    57
	void TestIndicateAppOrientation(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
sl@0
    58
	void TestIgnoredAppOrientation(TRenderOrientation aSecondOrientation, TInt aThemeServerOrientation, TInt aExpectedOrientation);
sl@0
    59
	void TestAppOrientationOnSwap(TRenderOrientation aOrientation, TRenderOrientation aSecondOrientation);
sl@0
    60
	//For TESTL
sl@0
    61
	inline void testBooleanTrueL(TBool aCondition, const TText8* aFile, TInt aLine) 
sl@0
    62
	    {
sl@0
    63
	    iStep->testBooleanTrueL(aCondition, aFile, aLine, ETrue);
sl@0
    64
	    }
sl@0
    65
private:
sl@0
    66
	//Test Cases
sl@0
    67
	void TestInitialOrientation();
sl@0
    68
	void TestFixedOrientations();
sl@0
    69
	void TestAutoOrientation();
sl@0
    70
	void TestIgnoreOrientation();
sl@0
    71
	void TestFixedOrientationsOnWindowSwap();
sl@0
    72
	void TestAutoOrientationOnWindowSwap();
sl@0
    73
	void TestIgnoreOrientationOnWindowSwap();
sl@0
    74
	void TestIgnoreAutoOrientationOnWindowSwap();
sl@0
    75
	void TestInvalidAppOrientation();
sl@0
    76
	void TestInvalidThemeServerOrientation();
sl@0
    77
	
sl@0
    78
private:
sl@0
    79
	//members
sl@0
    80
	// First Session and Window Group
sl@0
    81
	RWsSession iWs;
sl@0
    82
	RWindowGroup iWindowGroup;
sl@0
    83
    RWindow iChildWindow;
sl@0
    84
    // Second Session and Window Group
sl@0
    85
	RWsSession iSecondWs;
sl@0
    86
	RWindowGroup iSecondWindowGroup;
sl@0
    87
	RWindow iSecondChildWindow;
sl@0
    88
		
sl@0
    89
	RProperty iRenderOrientationProperty;
sl@0
    90
	RTimer iPublishTimer;
sl@0
    91
	TRequestStatus iPublishTimerStatus;
sl@0
    92
	TRequestStatus iRenderOrientationStatus;
sl@0
    93
	RProperty iThemeServerOrientationProperty;
sl@0
    94
sl@0
    95
	TRenderOrientation iCurrentThemeServerOrientation;
sl@0
    96
	TBool iWaitForPublishOnNextTest; //Set to EFalse to skip waiting for publish on next test, default ETrue, Resets to ETrue on each Test.
sl@0
    97
	};
sl@0
    98
sl@0
    99
class CTDeviceRotationStep : public CTGraphicsStep
sl@0
   100
	{
sl@0
   101
public:
sl@0
   102
	CTDeviceRotationStep();
sl@0
   103
protected:
sl@0
   104
	//from CTGraphicsStep
sl@0
   105
	virtual CTGraphicsBase* CreateTestL();
sl@0
   106
	};
sl@0
   107
sl@0
   108
_LIT(KTDeviceRotationStep,"TDeviceRotation");
sl@0
   109
sl@0
   110
#endif //TDEVICERORATION