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