windowing/windowserver/tauto/TWSGRAPHS.H
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 
       
     2 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 
       
    17 /**
       
    18  @file
       
    19  @test
       
    20  @internalComponent - Internal Symbian test code
       
    21 */
       
    22 
       
    23 #ifndef __TWSGRAPHS_H__
       
    24 #define __TWSGRAPHS_H__
       
    25 
       
    26 #include <e32std.h>
       
    27 #include <w32std.h>
       
    28 #include "../tlib/testbase.h"
       
    29 #include "AUTO.H"
       
    30 #include "W32STDGRAPHIC.H"
       
    31 #include "wsredir.h"
       
    32 #include "wslisten.h"
       
    33 #include "TGraphicsHarness.h"
       
    34 #include "wsframerate.h"
       
    35 #include "wscontaindrawer.h"
       
    36 #include "wssimpledrawer.h"
       
    37 #include "listener.h"
       
    38 #include "wsgdcov.h"
       
    39 
       
    40 //
       
    41 class CCrWin: public CBase
       
    42 	{
       
    43 public:
       
    44 	static CCrWin* NewL(TInt aScreenId,TBool aDraw=ETrue);
       
    45 	~CCrWin();
       
    46 	void DrawFirstHalf();
       
    47 	void DrawSecondHalf();
       
    48 	void DrawGraphic(TInt aWsId=0);
       
    49 	void SetTextCursor(const TPoint &aPos, const TTextCursor &aCursor);
       
    50 	void CancelTextCursor();
       
    51 private:
       
    52 	void ConstructL(TInt aScreenId,TBool aDraw);
       
    53 	void Draw();
       
    54 private:
       
    55 	RWsSession iWs;
       
    56 	CWsScreenDevice* iScr;
       
    57 	RWindowGroup iGroup;
       
    58 	RWindow iWin;
       
    59 	CWindowGc* iGc;
       
    60 	};
       
    61 
       
    62 class CCrAlphaWin: public CBase
       
    63 	{
       
    64 public:
       
    65 	static CCrAlphaWin* NewL(TInt aScreenId);
       
    66 	~CCrAlphaWin();
       
    67 private:
       
    68 	void ConstructL(TInt aScreenId);
       
    69 private:
       
    70 	RWsSession iWs;
       
    71 	CWsScreenDevice* iScr;
       
    72 	RWindowGroup iGroup;
       
    73 	RWindow iWin;
       
    74 	};
       
    75 
       
    76 class CTWsGraphs : public CTWsGraphicsBase
       
    77 	{
       
    78 public:
       
    79 	enum TTestCursorType
       
    80 		{
       
    81 		ETestStandardTextCursor,
       
    82 		ETestCustomTextCursor
       
    83 		};
       
    84 public:
       
    85 	CTWsGraphs(CTestStep* aStep);
       
    86 	~CTWsGraphs();
       
    87 	void ConstructL();
       
    88 public: // list of test cases
       
    89 	void LaunchNewProcess(const TDesC& aExecutable);
       
    90 protected:
       
    91 //from 	CTGraphicsStep
       
    92 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    93 
       
    94 private:
       
    95 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
       
    96 	TestState TestInterfaceExtensionL();
       
    97 	TestState TestScreenRedirectionL();
       
    98 	TestState TestTextCursorUnderRedirectionL(TTestCursorType aCursorType);
       
    99 	TestState TestFlickerRedirectionL();
       
   100 	TestState TestRedirectionUsingWsBackBufferL();
       
   101 	void TestScreenModeChangeL();
       
   102 #endif
       
   103 	TestState TestEventNotificationL();
       
   104 	void TestAddSwapGDArrayL();
       
   105 	TestState TestSuccessiveMessageL();
       
   106 	void ReportNegativeResultfail(TInt aLine,TInt aResult,TInt aExpectedResult);
       
   107 	void DoTestLeakInServiceL();
       
   108 	void TestNestedDrawerCRP();
       
   109 	void CheckResult();
       
   110 	void TestNotifyRemoval();
       
   111 	TestState TestWindowGroupChangeL();
       
   112 	TestState TestFrameRateL();
       
   113 	static TInt PluginCallBack(TAny* aArg);
       
   114 	void CreateWindowL(TBool aDraw=ETrue);
       
   115 	void DestroyWindowL();
       
   116 	void CreateAlphaWindowL();
       
   117 	void DestroyAlphaWindowL();
       
   118 	TBool CompareBitmapArea16Bpp(CFbsBitmap* aBmp1, const TPoint& aPos1, CFbsBitmap* aBmp2, const TPoint& aPos2, const TSize& aSize);
       
   119 
       
   120 	TBool PosTestAddSwapGDArrayL(TInt testcase);
       
   121 	struct WrapTestCall;
       
   122 	TBool NegTestAddSwapGDArrayL(TInt failcase,WrapTestCall*aWrappedParams=NULL);
       
   123 	static TInt	DoNegTestCall(TInt /*aInt*/, TAny *aPtr);
       
   124 	TBool	LaunchNegTestCall(TUint		aTestCount,TUint aPanicCode,const TDesC &aPanicCategory);
       
   125 	TestState TestGraphicDrawerCoverage();
       
   126 	// For WsBuffer CRP tests
       
   127 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
       
   128 	void TestMWsUiBufferL();
       
   129 	TBool IsWhiteLine(TInt aWhiteLinePos);
       
   130 #endif
       
   131 	
       
   132 private:
       
   133 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
       
   134 	CWsRedir* iRedir;
       
   135 	CFbsBitmap* iFrontCopy;
       
   136 	CFbsBitmap* iBackCopy;
       
   137 	TRedirectorInfo iRedirInfo;
       
   138 	CFbsBitmap* iBefore;
       
   139 	CFbsBitmap* iAfter;
       
   140 	TTextCursor iTextCursor;
       
   141 	RArray<TSpriteMember> iSpriteMemberArray;
       
   142 #endif
       
   143 	CWsListen* iListen;
       
   144 	CWsNotify* iNotify1;
       
   145 	CWsNotify* iNotify2;
       
   146 	TListenerInfo iListenInfo;
       
   147 	TInt iSubState;
       
   148 	CCrWin* iWin;
       
   149 	CCrAlphaWin* iAlpha;
       
   150 	TInt iOriginalWindowGroupId;
       
   151 	CCrWin* iNewWin;
       
   152 	CGraphicTestFrameRate* iTestframerate;
       
   153 	TAnimRate iAnimCount;
       
   154 	CWsGdCoverage* iGdCoverage;
       
   155 	};
       
   156 
       
   157 class CTWsGraphsStep : public CTGraphicsStep
       
   158 	{
       
   159 public:
       
   160 	CTWsGraphsStep();
       
   161 
       
   162 protected:
       
   163 	//from CTGraphicsStep
       
   164 	virtual CTGraphicsBase* CreateTestL();
       
   165 	};
       
   166 
       
   167 
       
   168 
       
   169 _LIT(KTWsGraphsStep,"TWsGraphs");
       
   170 
       
   171 
       
   172 #endif