sl@0: sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #ifndef __TWSGRAPHS_H__ sl@0: #define __TWSGRAPHS_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include "../tlib/testbase.h" sl@0: #include "AUTO.H" sl@0: #include "W32STDGRAPHIC.H" sl@0: #include "wsredir.h" sl@0: #include "wslisten.h" sl@0: #include "TGraphicsHarness.h" sl@0: #include "wsframerate.h" sl@0: #include "wscontaindrawer.h" sl@0: #include "wssimpledrawer.h" sl@0: #include "listener.h" sl@0: #include "wsgdcov.h" sl@0: sl@0: // sl@0: class CCrWin: public CBase sl@0: { sl@0: public: sl@0: static CCrWin* NewL(TInt aScreenId,TBool aDraw=ETrue); sl@0: ~CCrWin(); sl@0: void DrawFirstHalf(); sl@0: void DrawSecondHalf(); sl@0: void DrawGraphic(TInt aWsId=0); sl@0: void SetTextCursor(const TPoint &aPos, const TTextCursor &aCursor); sl@0: void CancelTextCursor(); sl@0: private: sl@0: void ConstructL(TInt aScreenId,TBool aDraw); sl@0: void Draw(); sl@0: private: sl@0: RWsSession iWs; sl@0: CWsScreenDevice* iScr; sl@0: RWindowGroup iGroup; sl@0: RWindow iWin; sl@0: CWindowGc* iGc; sl@0: }; sl@0: sl@0: class CCrAlphaWin: public CBase sl@0: { sl@0: public: sl@0: static CCrAlphaWin* NewL(TInt aScreenId); sl@0: ~CCrAlphaWin(); sl@0: private: sl@0: void ConstructL(TInt aScreenId); sl@0: private: sl@0: RWsSession iWs; sl@0: CWsScreenDevice* iScr; sl@0: RWindowGroup iGroup; sl@0: RWindow iWin; sl@0: }; sl@0: sl@0: class CTWsGraphs : public CTWsGraphicsBase sl@0: { sl@0: public: sl@0: enum TTestCursorType sl@0: { sl@0: ETestStandardTextCursor, sl@0: ETestCustomTextCursor sl@0: }; sl@0: public: sl@0: CTWsGraphs(CTestStep* aStep); sl@0: ~CTWsGraphs(); sl@0: void ConstructL(); sl@0: public: // list of test cases sl@0: void LaunchNewProcess(const TDesC& aExecutable); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: sl@0: private: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA sl@0: TestState TestInterfaceExtensionL(); sl@0: TestState TestScreenRedirectionL(); sl@0: TestState TestTextCursorUnderRedirectionL(TTestCursorType aCursorType); sl@0: TestState TestFlickerRedirectionL(); sl@0: TestState TestRedirectionUsingWsBackBufferL(); sl@0: void TestScreenModeChangeL(); sl@0: #endif sl@0: TestState TestEventNotificationL(); sl@0: void TestAddSwapGDArrayL(); sl@0: TestState TestSuccessiveMessageL(); sl@0: void ReportNegativeResultfail(TInt aLine,TInt aResult,TInt aExpectedResult); sl@0: void DoTestLeakInServiceL(); sl@0: void TestNestedDrawerCRP(); sl@0: void CheckResult(); sl@0: void TestNotifyRemoval(); sl@0: TestState TestWindowGroupChangeL(); sl@0: TestState TestFrameRateL(); sl@0: static TInt PluginCallBack(TAny* aArg); sl@0: void CreateWindowL(TBool aDraw=ETrue); sl@0: void DestroyWindowL(); sl@0: void CreateAlphaWindowL(); sl@0: void DestroyAlphaWindowL(); sl@0: TBool CompareBitmapArea16Bpp(CFbsBitmap* aBmp1, const TPoint& aPos1, CFbsBitmap* aBmp2, const TPoint& aPos2, const TSize& aSize); sl@0: sl@0: TBool PosTestAddSwapGDArrayL(TInt testcase); sl@0: struct WrapTestCall; sl@0: TBool NegTestAddSwapGDArrayL(TInt failcase,WrapTestCall*aWrappedParams=NULL); sl@0: static TInt DoNegTestCall(TInt /*aInt*/, TAny *aPtr); sl@0: TBool LaunchNegTestCall(TUint aTestCount,TUint aPanicCode,const TDesC &aPanicCategory); sl@0: TestState TestGraphicDrawerCoverage(); sl@0: // For WsBuffer CRP tests sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: void TestMWsUiBufferL(); sl@0: TBool IsWhiteLine(TInt aWhiteLinePos); sl@0: #endif sl@0: sl@0: private: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA sl@0: CWsRedir* iRedir; sl@0: CFbsBitmap* iFrontCopy; sl@0: CFbsBitmap* iBackCopy; sl@0: TRedirectorInfo iRedirInfo; sl@0: CFbsBitmap* iBefore; sl@0: CFbsBitmap* iAfter; sl@0: TTextCursor iTextCursor; sl@0: RArray iSpriteMemberArray; sl@0: #endif sl@0: CWsListen* iListen; sl@0: CWsNotify* iNotify1; sl@0: CWsNotify* iNotify2; sl@0: TListenerInfo iListenInfo; sl@0: TInt iSubState; sl@0: CCrWin* iWin; sl@0: CCrAlphaWin* iAlpha; sl@0: TInt iOriginalWindowGroupId; sl@0: CCrWin* iNewWin; sl@0: CGraphicTestFrameRate* iTestframerate; sl@0: TAnimRate iAnimCount; sl@0: CWsGdCoverage* iGdCoverage; sl@0: }; sl@0: sl@0: class CTWsGraphsStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTWsGraphsStep(); sl@0: sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: sl@0: sl@0: _LIT(KTWsGraphsStep,"TWsGraphs"); sl@0: sl@0: sl@0: #endif