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