os/graphics/windowing/windowserver/test/tauto/TWSGRAPHS.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TWSGRAPHS.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,172 @@
     1.4 +
     1.5 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of "Eclipse Public License v1.0"
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +/**
    1.21 + @file
    1.22 + @test
    1.23 + @internalComponent - Internal Symbian test code
    1.24 +*/
    1.25 +
    1.26 +#ifndef __TWSGRAPHS_H__
    1.27 +#define __TWSGRAPHS_H__
    1.28 +
    1.29 +#include <e32std.h>
    1.30 +#include <w32std.h>
    1.31 +#include "../tlib/testbase.h"
    1.32 +#include "AUTO.H"
    1.33 +#include "W32STDGRAPHIC.H"
    1.34 +#include "wsredir.h"
    1.35 +#include "wslisten.h"
    1.36 +#include "TGraphicsHarness.h"
    1.37 +#include "wsframerate.h"
    1.38 +#include "wscontaindrawer.h"
    1.39 +#include "wssimpledrawer.h"
    1.40 +#include "listener.h"
    1.41 +#include "wsgdcov.h"
    1.42 +
    1.43 +//
    1.44 +class CCrWin: public CBase
    1.45 +	{
    1.46 +public:
    1.47 +	static CCrWin* NewL(TInt aScreenId,TBool aDraw=ETrue);
    1.48 +	~CCrWin();
    1.49 +	void DrawFirstHalf();
    1.50 +	void DrawSecondHalf();
    1.51 +	void DrawGraphic(TInt aWsId=0);
    1.52 +	void SetTextCursor(const TPoint &aPos, const TTextCursor &aCursor);
    1.53 +	void CancelTextCursor();
    1.54 +private:
    1.55 +	void ConstructL(TInt aScreenId,TBool aDraw);
    1.56 +	void Draw();
    1.57 +private:
    1.58 +	RWsSession iWs;
    1.59 +	CWsScreenDevice* iScr;
    1.60 +	RWindowGroup iGroup;
    1.61 +	RWindow iWin;
    1.62 +	CWindowGc* iGc;
    1.63 +	};
    1.64 +
    1.65 +class CCrAlphaWin: public CBase
    1.66 +	{
    1.67 +public:
    1.68 +	static CCrAlphaWin* NewL(TInt aScreenId);
    1.69 +	~CCrAlphaWin();
    1.70 +private:
    1.71 +	void ConstructL(TInt aScreenId);
    1.72 +private:
    1.73 +	RWsSession iWs;
    1.74 +	CWsScreenDevice* iScr;
    1.75 +	RWindowGroup iGroup;
    1.76 +	RWindow iWin;
    1.77 +	};
    1.78 +
    1.79 +class CTWsGraphs : public CTWsGraphicsBase
    1.80 +	{
    1.81 +public:
    1.82 +	enum TTestCursorType
    1.83 +		{
    1.84 +		ETestStandardTextCursor,
    1.85 +		ETestCustomTextCursor
    1.86 +		};
    1.87 +public:
    1.88 +	CTWsGraphs(CTestStep* aStep);
    1.89 +	~CTWsGraphs();
    1.90 +	void ConstructL();
    1.91 +public: // list of test cases
    1.92 +	void LaunchNewProcess(const TDesC& aExecutable);
    1.93 +protected:
    1.94 +//from 	CTGraphicsStep
    1.95 +	virtual void RunTestCaseL(TInt aCurTestCase);
    1.96 +
    1.97 +private:
    1.98 +#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
    1.99 +	TestState TestInterfaceExtensionL();
   1.100 +	TestState TestScreenRedirectionL();
   1.101 +	TestState TestTextCursorUnderRedirectionL(TTestCursorType aCursorType);
   1.102 +	TestState TestFlickerRedirectionL();
   1.103 +	TestState TestRedirectionUsingWsBackBufferL();
   1.104 +	void TestScreenModeChangeL();
   1.105 +#endif
   1.106 +	TestState TestEventNotificationL();
   1.107 +	void TestAddSwapGDArrayL();
   1.108 +	TestState TestSuccessiveMessageL();
   1.109 +	void ReportNegativeResultfail(TInt aLine,TInt aResult,TInt aExpectedResult);
   1.110 +	void DoTestLeakInServiceL();
   1.111 +	void TestNestedDrawerCRP();
   1.112 +	void CheckResult();
   1.113 +	void TestNotifyRemoval();
   1.114 +	TestState TestWindowGroupChangeL();
   1.115 +	TestState TestFrameRateL();
   1.116 +	static TInt PluginCallBack(TAny* aArg);
   1.117 +	void CreateWindowL(TBool aDraw=ETrue);
   1.118 +	void DestroyWindowL();
   1.119 +	void CreateAlphaWindowL();
   1.120 +	void DestroyAlphaWindowL();
   1.121 +	TBool CompareBitmapArea16Bpp(CFbsBitmap* aBmp1, const TPoint& aPos1, CFbsBitmap* aBmp2, const TPoint& aPos2, const TSize& aSize);
   1.122 +
   1.123 +	TBool PosTestAddSwapGDArrayL(TInt testcase);
   1.124 +	struct WrapTestCall;
   1.125 +	TBool NegTestAddSwapGDArrayL(TInt failcase,WrapTestCall*aWrappedParams=NULL);
   1.126 +	static TInt	DoNegTestCall(TInt /*aInt*/, TAny *aPtr);
   1.127 +	TBool	LaunchNegTestCall(TUint		aTestCount,TUint aPanicCode,const TDesC &aPanicCategory);
   1.128 +	TestState TestGraphicDrawerCoverage();
   1.129 +	// For WsBuffer CRP tests
   1.130 +#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
   1.131 +	void TestMWsUiBufferL();
   1.132 +	TBool IsWhiteLine(TInt aWhiteLinePos);
   1.133 +#endif
   1.134 +	
   1.135 +private:
   1.136 +#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
   1.137 +	CWsRedir* iRedir;
   1.138 +	CFbsBitmap* iFrontCopy;
   1.139 +	CFbsBitmap* iBackCopy;
   1.140 +	TRedirectorInfo iRedirInfo;
   1.141 +	CFbsBitmap* iBefore;
   1.142 +	CFbsBitmap* iAfter;
   1.143 +	TTextCursor iTextCursor;
   1.144 +	RArray<TSpriteMember> iSpriteMemberArray;
   1.145 +#endif
   1.146 +	CWsListen* iListen;
   1.147 +	CWsNotify* iNotify1;
   1.148 +	CWsNotify* iNotify2;
   1.149 +	TListenerInfo iListenInfo;
   1.150 +	TInt iSubState;
   1.151 +	CCrWin* iWin;
   1.152 +	CCrAlphaWin* iAlpha;
   1.153 +	TInt iOriginalWindowGroupId;
   1.154 +	CCrWin* iNewWin;
   1.155 +	CGraphicTestFrameRate* iTestframerate;
   1.156 +	TAnimRate iAnimCount;
   1.157 +	CWsGdCoverage* iGdCoverage;
   1.158 +	};
   1.159 +
   1.160 +class CTWsGraphsStep : public CTGraphicsStep
   1.161 +	{
   1.162 +public:
   1.163 +	CTWsGraphsStep();
   1.164 +
   1.165 +protected:
   1.166 +	//from CTGraphicsStep
   1.167 +	virtual CTGraphicsBase* CreateTestL();
   1.168 +	};
   1.169 +
   1.170 +
   1.171 +
   1.172 +_LIT(KTWsGraphsStep,"TWsGraphs");
   1.173 +
   1.174 +
   1.175 +#endif