sl@0: sl@0: // Copyright (c) 1996-2010 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 __TPANIC_H__ sl@0: #define __TPANIC_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include "../tlib/testbase.h" sl@0: #include "AUTO.H" sl@0: #include "AUTODLL.H" sl@0: #include "TGraphicsHarness.h" sl@0: sl@0: enum TPanicRedrawMode sl@0: { sl@0: EPanicRedrawModeBackedUpWindow, // Draw to a RBackedUpWindow; no BeginRedraw()/EndRedraw() needed sl@0: EPanicRedrawModeNormalRedraw, // Draw in a redraw sl@0: EPanicRedrawModeTransRedraw, // Draw to a window under a transparent window in a redraw sl@0: EPanicRedrawModeInvisRedraw, // Draw to an invisible window in a redraw sl@0: }; sl@0: sl@0: class CTPanic : public CTWsGraphicsBase sl@0: { sl@0: public: sl@0: struct TPanicParams sl@0: { sl@0: public: sl@0: TInt iScreen; sl@0: TPanicRedrawMode iRedrawMode; sl@0: TInt iSubTest; sl@0: }; sl@0: sl@0: enum TCancelCaptureType sl@0: { sl@0: ECancelCaptureKey, sl@0: ECancelCaptureKeyUpAndDowns, sl@0: ECancelCaptureLongKey sl@0: }; sl@0: public: sl@0: CTPanic(CTestStep* aStep); sl@0: ~CTPanic(); sl@0: void ConstructL(); sl@0: private: sl@0: void TestDeletedParentPanicsL(); sl@0: void TestScreenDevicePanicsL(); sl@0: void TestGraphicsPanicsL(TClientPanic aExitReason, TInt aIndex, CTPanic::TPanicParams* aPanicParams); sl@0: void TestGraphicsPanicsL(); sl@0: void TestGraphicsPanicsL(TPanicRedrawMode aRedrawMode); sl@0: void TestMiscPanicsL(); sl@0: void TestComputeModePanicsL(); sl@0: void TestCaptureKeyPanicsL(); sl@0: void TestEventPanicsL(); sl@0: void TestTPtrPanicsL(); sl@0: void TestOpcodePanicsL(); sl@0: void TestMultiInitPanicL(); sl@0: void TestSpritePanicsL(); sl@0: void TestMoveToGroupPanicsL(); sl@0: void TestHandleReUseL(); sl@0: void TestDeleteScreenPanicL(); sl@0: void TestWinHandleErrors(); sl@0: void TestGetEventErrors(); sl@0: void TestUnInitPanicL(); sl@0: void TestAlphaBlendingPanicL(); sl@0: void TestDoubleConstructionL(); sl@0: void TestDoubleConstructionNoPanic(); sl@0: void TestSpriteActivatePanicL(); sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: void TestNonRedrawRedrawerL(); sl@0: #endif sl@0: void TestMismatchedCaptureCancelPanicL(); sl@0: void LogHeapInfo(); sl@0: void TestEnableAdvancePointerActivatePanicL(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: private: sl@0: TSize iWinSize; sl@0: }; sl@0: sl@0: class CTPanicStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTPanicStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: _LIT(KTPanicStep,"TPanic"); sl@0: sl@0: class RUnInitalisedConnect : public RSessionBase sl@0: { sl@0: public: sl@0: TInt Connect(const TDesC &aName, const TVersion &aVersion); sl@0: TInt Send(const TInt aMsg); sl@0: }; sl@0: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: class CNonRedrawWin : public CBase{ sl@0: public: sl@0: ~CNonRedrawWin(); sl@0: static CNonRedrawWin* NewL(RWsSession &aSession, CWindowGc *aGc); sl@0: virtual void Redraw(); sl@0: RWsSession &GetSession(); sl@0: void Invalidate(); sl@0: sl@0: protected: sl@0: CNonRedrawWin(RWsSession &aSession, CWindowGc *aGc); sl@0: void ConstrucL(); sl@0: sl@0: class CRedrawer : public CActive{ sl@0: public: sl@0: CRedrawer(CNonRedrawWin* aWd); sl@0: ~CRedrawer(); sl@0: private: sl@0: void HandleReDrawEvent(); sl@0: void RunL(); sl@0: void DoCancel(); sl@0: void HandleRedrawEvent(); sl@0: sl@0: private: sl@0: CNonRedrawWin* iWd; sl@0: }; sl@0: sl@0: private: sl@0: RWsSession &iSession; sl@0: RWindowGroup iWdGrp; sl@0: RWindow iWd; sl@0: CWindowGc *iGc; sl@0: sl@0: CRedrawer *iRedrawer; sl@0: sl@0: }; sl@0: #endif sl@0: sl@0: #endif