1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TPANIC.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,155 @@
1.4 +
1.5 +// Copyright (c) 1996-2010 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 __TPANIC_H__
1.27 +#define __TPANIC_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 "AUTODLL.H"
1.34 +#include "TGraphicsHarness.h"
1.35 +
1.36 +enum TPanicRedrawMode
1.37 + {
1.38 + EPanicRedrawModeBackedUpWindow, // Draw to a RBackedUpWindow; no BeginRedraw()/EndRedraw() needed
1.39 + EPanicRedrawModeNormalRedraw, // Draw in a redraw
1.40 + EPanicRedrawModeTransRedraw, // Draw to a window under a transparent window in a redraw
1.41 + EPanicRedrawModeInvisRedraw, // Draw to an invisible window in a redraw
1.42 + };
1.43 +
1.44 +class CTPanic : public CTWsGraphicsBase
1.45 + {
1.46 +public:
1.47 + struct TPanicParams
1.48 + {
1.49 + public:
1.50 + TInt iScreen;
1.51 + TPanicRedrawMode iRedrawMode;
1.52 + TInt iSubTest;
1.53 + };
1.54 +
1.55 + enum TCancelCaptureType
1.56 + {
1.57 + ECancelCaptureKey,
1.58 + ECancelCaptureKeyUpAndDowns,
1.59 + ECancelCaptureLongKey
1.60 + };
1.61 +public:
1.62 + CTPanic(CTestStep* aStep);
1.63 + ~CTPanic();
1.64 + void ConstructL();
1.65 +private:
1.66 + void TestDeletedParentPanicsL();
1.67 + void TestScreenDevicePanicsL();
1.68 + void TestGraphicsPanicsL(TClientPanic aExitReason, TInt aIndex, CTPanic::TPanicParams* aPanicParams);
1.69 + void TestGraphicsPanicsL();
1.70 + void TestGraphicsPanicsL(TPanicRedrawMode aRedrawMode);
1.71 + void TestMiscPanicsL();
1.72 + void TestComputeModePanicsL();
1.73 + void TestCaptureKeyPanicsL();
1.74 + void TestEventPanicsL();
1.75 + void TestTPtrPanicsL();
1.76 + void TestOpcodePanicsL();
1.77 + void TestMultiInitPanicL();
1.78 + void TestSpritePanicsL();
1.79 + void TestMoveToGroupPanicsL();
1.80 + void TestHandleReUseL();
1.81 + void TestDeleteScreenPanicL();
1.82 + void TestWinHandleErrors();
1.83 + void TestGetEventErrors();
1.84 + void TestUnInitPanicL();
1.85 + void TestAlphaBlendingPanicL();
1.86 + void TestDoubleConstructionL();
1.87 + void TestDoubleConstructionNoPanic();
1.88 + void TestSpriteActivatePanicL();
1.89 +#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
1.90 + void TestNonRedrawRedrawerL();
1.91 +#endif
1.92 + void TestMismatchedCaptureCancelPanicL();
1.93 + void LogHeapInfo();
1.94 + void TestEnableAdvancePointerActivatePanicL();
1.95 +protected:
1.96 +//from CTGraphicsStep
1.97 + virtual void RunTestCaseL(TInt aCurTestCase);
1.98 +private:
1.99 + TSize iWinSize;
1.100 + };
1.101 +
1.102 +class CTPanicStep : public CTGraphicsStep
1.103 + {
1.104 +public:
1.105 + CTPanicStep();
1.106 +protected:
1.107 + //from CTGraphicsStep
1.108 + virtual CTGraphicsBase* CreateTestL();
1.109 + };
1.110 +
1.111 +_LIT(KTPanicStep,"TPanic");
1.112 +
1.113 +class RUnInitalisedConnect : public RSessionBase
1.114 + {
1.115 + public:
1.116 + TInt Connect(const TDesC &aName, const TVersion &aVersion);
1.117 + TInt Send(const TInt aMsg);
1.118 + };
1.119 +
1.120 +#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
1.121 +class CNonRedrawWin : public CBase{
1.122 + public:
1.123 + ~CNonRedrawWin();
1.124 + static CNonRedrawWin* NewL(RWsSession &aSession, CWindowGc *aGc);
1.125 + virtual void Redraw();
1.126 + RWsSession &GetSession();
1.127 + void Invalidate();
1.128 +
1.129 + protected:
1.130 + CNonRedrawWin(RWsSession &aSession, CWindowGc *aGc);
1.131 + void ConstrucL();
1.132 +
1.133 + class CRedrawer : public CActive{
1.134 + public:
1.135 + CRedrawer(CNonRedrawWin* aWd);
1.136 + ~CRedrawer();
1.137 + private:
1.138 + void HandleReDrawEvent();
1.139 + void RunL();
1.140 + void DoCancel();
1.141 + void HandleRedrawEvent();
1.142 +
1.143 + private:
1.144 + CNonRedrawWin* iWd;
1.145 + };
1.146 +
1.147 + private:
1.148 + RWsSession &iSession;
1.149 + RWindowGroup iWdGrp;
1.150 + RWindow iWd;
1.151 + CWindowGc *iGc;
1.152 +
1.153 + CRedrawer *iRedrawer;
1.154 +
1.155 +};
1.156 +#endif
1.157 +
1.158 +#endif