os/graphics/windowing/windowserver/test/tauto/TWINDOW.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) 1996-2009 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
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent - Internal Symbian test code
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef __TWINDOW_H__
sl@0
    23
#define __TWINDOW_H__
sl@0
    24
sl@0
    25
#include <e32std.h>
sl@0
    26
#include <w32std.h>
sl@0
    27
#include "AUTO.H"
sl@0
    28
sl@0
    29
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
sl@0
    30
#include "../nonnga/CLIENT/w32comm.h"
sl@0
    31
#endif
sl@0
    32
sl@0
    33
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
sl@0
    34
#include "../nga/CLIENT/w32comm.h"
sl@0
    35
#endif
sl@0
    36
sl@0
    37
#include "../tlib/testbase.h"
sl@0
    38
#include "TGraphicsHarness.h"
sl@0
    39
sl@0
    40
struct TWindowThreadParam
sl@0
    41
	{
sl@0
    42
	TInt iCommand;
sl@0
    43
	TInt iScreenNumber;
sl@0
    44
	};
sl@0
    45
sl@0
    46
class CWinTestWindow : public CBlankWindow
sl@0
    47
	{
sl@0
    48
public:
sl@0
    49
	CWinTestWindow(TRgb aCol);
sl@0
    50
	~CWinTestWindow();
sl@0
    51
	void ConstructL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TInt aDepth);
sl@0
    52
public:
sl@0
    53
	CWinTestWindow *iChild;
sl@0
    54
	};
sl@0
    55
sl@0
    56
class CEvWindowGroup : public CTWindowGroup
sl@0
    57
	{
sl@0
    58
public:
sl@0
    59
	static CEvWindowGroup* NewLC(CTClient* aClient,CTWsGraphicsBase* aTest);
sl@0
    60
	CEvWindowGroup(CTClient* aClient,CTWsGraphicsBase* aTest);
sl@0
    61
	void SetExpectedEvent(TInt aType);
sl@0
    62
	void SendEvent(TInt aType);
sl@0
    63
	//Virtual functions from CTWindowGroup
sl@0
    64
	void ConstructL();
sl@0
    65
	void UserEvent(TInt aEventType);
sl@0
    66
private:
sl@0
    67
	CTWsGraphicsBase* iTest;
sl@0
    68
	TInt iExpectedEvent;
sl@0
    69
	TBool iExpectingEvent;
sl@0
    70
	};
sl@0
    71
sl@0
    72
class CTWindowTest : public CTWsGraphicsBase
sl@0
    73
	{
sl@0
    74
public:
sl@0
    75
	enum {EWinTypeFactor=1000};
sl@0
    76
	enum
sl@0
    77
		{
sl@0
    78
		EIdMask=0x0000FFFF,
sl@0
    79
		EPosMask=0xFFFF0000,
sl@0
    80
		EPosShift=16
sl@0
    81
		};
sl@0
    82
private:
sl@0
    83
	enum TCorner {ECornerTL,ECornerTR,ECornerBL,ECornerBR};
sl@0
    84
public:
sl@0
    85
	CTWindowTest(CTestStep* aStep);
sl@0
    86
	~CTWindowTest();
sl@0
    87
	TestState DoTestL();
sl@0
    88
	void ConstructL();
sl@0
    89
	void CreateTestWindowL();
sl@0
    90
	void CheckAndDestroyWindows();
sl@0
    91
	void DestroyWindowWithActiveGc();
sl@0
    92
	void DestroyWindowWithActiveGc2L();
sl@0
    93
	void DrawWindows(CWinTestWindow *aWin);
sl@0
    94
	void ClearRedraw(RWindow &aWindow, TRgb aRgb);
sl@0
    95
	void TestInvalidFunctionsL();
sl@0
    96
	void ShadowAutoClearTest();
sl@0
    97
	void CreateMegaTree();
sl@0
    98
	void TiledWindowTestL();
sl@0
    99
	void TiledWindowTest2L();
sl@0
   100
	void CornerTests();
sl@0
   101
	void ColorTestL();
sl@0
   102
	void TestInvalidFunctions2L();
sl@0
   103
	void Bug1L();
sl@0
   104
	void Bug2L();
sl@0
   105
	void Bug3L();
sl@0
   106
	void TestDeletedParentPanics1L();
sl@0
   107
	void TestDeletedParentPanics2L();
sl@0
   108
	void BackColorBugL();
sl@0
   109
	void FocusChangedL();
sl@0
   110
	void FadeRegionsL();
sl@0
   111
	void FadeRegionsWithRedrawStoringL();
sl@0
   112
	void EventsToAllL();
sl@0
   113
	void ErrorCodesL();
sl@0
   114
	void GroupIdL();
sl@0
   115
	void doCornerTestsL();
sl@0
   116
	void doCornerTest(TCornerType aCornerType, TInt aFlags);
sl@0
   117
	void CheckCorner(TCorner aCorner, const TInt *aInsetList);
sl@0
   118
	void ShadowTestL();
sl@0
   119
	void TestWindowDelete();
sl@0
   120
	void SaturateSendEvent();
sl@0
   121
	void TestNotSupportedFunctionality();
sl@0
   122
protected:
sl@0
   123
//from 	CTGraphicsStep
sl@0
   124
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
   125
private:
sl@0
   126
	static TInt MoveGroup(TAny* aParam);
sl@0
   127
	void DoFadeRegionsL(TBool aRedrawStoring);
sl@0
   128
private:
sl@0
   129
	CWinTestWindow *iWin;
sl@0
   130
	CTBlankWindow *iBlankWin1;
sl@0
   131
	CTBlankWindow *iBlankWin2;
sl@0
   132
	CWsScreenDevice *iScreenDev;
sl@0
   133
	TThreadStartUp iFirstFunction;
sl@0
   134
	TWindowThreadParam iThreadParam;
sl@0
   135
	};
sl@0
   136
sl@0
   137
class CTWindowTestStep : public CTGraphicsStep
sl@0
   138
	{
sl@0
   139
public:
sl@0
   140
	CTWindowTestStep();
sl@0
   141
protected:
sl@0
   142
	//from CTGraphicsStep
sl@0
   143
	virtual CTGraphicsBase* CreateTestL();
sl@0
   144
	};
sl@0
   145
sl@0
   146
_LIT(KTWindowTestStep,"TWindowTest");
sl@0
   147
sl@0
   148
sl@0
   149
#endif