os/graphics/windowing/windowserver/test/tauto/TPANIC.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.
     1 
     2 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 // All rights reserved.
     4 // This component and the accompanying materials are made available
     5 // under the terms of "Eclipse Public License v1.0"
     6 // which accompanies this distribution, and is available
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 //
     9 // Initial Contributors:
    10 // Nokia Corporation - initial contribution.
    11 //
    12 // Contributors:
    13 //
    14 // Description:
    15 //
    16 
    17 /**
    18  @file
    19  @test
    20  @internalComponent - Internal Symbian test code
    21 */
    22 
    23 #ifndef __TPANIC_H__
    24 #define __TPANIC_H__
    25 
    26 #include <e32std.h>
    27 #include <w32std.h>
    28 #include "../tlib/testbase.h"
    29 #include "AUTO.H"
    30 #include "AUTODLL.H"
    31 #include "TGraphicsHarness.h"
    32 
    33 enum TPanicRedrawMode
    34 	{
    35 	EPanicRedrawModeBackedUpWindow,	// Draw to a RBackedUpWindow; no BeginRedraw()/EndRedraw() needed
    36 	EPanicRedrawModeNormalRedraw,	// Draw in a redraw
    37 	EPanicRedrawModeTransRedraw,	// Draw to a window under a transparent window in a redraw
    38 	EPanicRedrawModeInvisRedraw,	// Draw to an invisible window in a redraw
    39 	};
    40 
    41 class CTPanic : public CTWsGraphicsBase
    42 	{
    43 public:
    44 	struct TPanicParams
    45 		{
    46 	public:
    47 		TInt iScreen;
    48 		TPanicRedrawMode iRedrawMode;
    49 		TInt iSubTest;
    50 		};
    51 	
    52 	enum TCancelCaptureType
    53 		{
    54 		ECancelCaptureKey,
    55 		ECancelCaptureKeyUpAndDowns,
    56 		ECancelCaptureLongKey
    57 		};
    58 public:
    59 	CTPanic(CTestStep* aStep);
    60 	~CTPanic();
    61 	void ConstructL();
    62 private:
    63 	void TestDeletedParentPanicsL();
    64 	void TestScreenDevicePanicsL();
    65 	void TestGraphicsPanicsL(TClientPanic aExitReason, TInt aIndex, CTPanic::TPanicParams* aPanicParams);
    66 	void TestGraphicsPanicsL();
    67 	void TestGraphicsPanicsL(TPanicRedrawMode aRedrawMode);
    68 	void TestMiscPanicsL();
    69 	void TestComputeModePanicsL();
    70 	void TestCaptureKeyPanicsL();
    71 	void TestEventPanicsL();
    72 	void TestTPtrPanicsL();
    73 	void TestOpcodePanicsL();
    74 	void TestMultiInitPanicL();
    75 	void TestSpritePanicsL();
    76 	void TestMoveToGroupPanicsL();
    77 	void TestHandleReUseL();
    78 	void TestDeleteScreenPanicL();
    79 	void TestWinHandleErrors();
    80 	void TestGetEventErrors();
    81 	void TestUnInitPanicL();
    82 	void TestAlphaBlendingPanicL();
    83 	void TestDoubleConstructionL();
    84 	void TestDoubleConstructionNoPanic();
    85 	void TestSpriteActivatePanicL();
    86 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA	
    87 	void TestNonRedrawRedrawerL();
    88 #endif	
    89 	void TestMismatchedCaptureCancelPanicL();
    90 	void LogHeapInfo();
    91 	void TestEnableAdvancePointerActivatePanicL();
    92 protected:
    93 //from 	CTGraphicsStep
    94 	virtual void RunTestCaseL(TInt aCurTestCase);
    95 private:
    96 	TSize iWinSize;
    97 	};
    98 
    99 class CTPanicStep : public CTGraphicsStep
   100 	{
   101 public:
   102 	CTPanicStep();
   103 protected:	
   104 	//from CTGraphicsStep
   105 	virtual CTGraphicsBase* CreateTestL();
   106 	};
   107 
   108 _LIT(KTPanicStep,"TPanic");
   109 
   110 class RUnInitalisedConnect : public RSessionBase
   111 	{
   112 	public:
   113 	TInt Connect(const TDesC &aName, const TVersion &aVersion);
   114 	TInt Send(const TInt aMsg);
   115 	};
   116 
   117 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
   118 class CNonRedrawWin : public CBase{
   119 	public:
   120 		~CNonRedrawWin();
   121 		static CNonRedrawWin* NewL(RWsSession &aSession, CWindowGc *aGc);
   122 		virtual void Redraw();
   123 		RWsSession &GetSession();
   124 		void Invalidate();
   125 					
   126 	protected:
   127 		CNonRedrawWin(RWsSession &aSession, CWindowGc *aGc);
   128 		void ConstrucL();
   129 
   130 		class CRedrawer : public CActive{
   131 			public:
   132 				CRedrawer(CNonRedrawWin* aWd);
   133 				~CRedrawer();		
   134 			private:
   135 				void HandleReDrawEvent();
   136 				void RunL();
   137 				void DoCancel();
   138 				void HandleRedrawEvent();
   139 				
   140 			private:
   141 				CNonRedrawWin* iWd;
   142 		};
   143 			
   144 	private:		
   145 		RWsSession &iSession;
   146 		RWindowGroup iWdGrp;
   147 		RWindow iWd;
   148 		CWindowGc *iGc;
   149 		
   150 		CRedrawer *iRedrawer;			
   151 		
   152 };
   153 #endif
   154 
   155 #endif