windowing/windowserver/tauto/TPANIC.H
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 
       
     2 // Copyright (c) 1996-2009 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 protected:
       
    92 //from 	CTGraphicsStep
       
    93 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    94 private:
       
    95 	TSize iWinSize;
       
    96 	};
       
    97 
       
    98 class CTPanicStep : public CTGraphicsStep
       
    99 	{
       
   100 public:
       
   101 	CTPanicStep();
       
   102 protected:	
       
   103 	//from CTGraphicsStep
       
   104 	virtual CTGraphicsBase* CreateTestL();
       
   105 	};
       
   106 
       
   107 _LIT(KTPanicStep,"TPanic");
       
   108 
       
   109 class RUnInitalisedConnect : public RSessionBase
       
   110 	{
       
   111 	public:
       
   112 	TInt Connect(const TDesC &aName, const TVersion &aVersion);
       
   113 	TInt Send(const TInt aMsg);
       
   114 	};
       
   115 
       
   116 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
       
   117 class CNonRedrawWin : public CBase{
       
   118 	public:
       
   119 		~CNonRedrawWin();
       
   120 		static CNonRedrawWin* NewL(RWsSession &aSession, CWindowGc *aGc);
       
   121 		virtual void Redraw();
       
   122 		RWsSession &GetSession();
       
   123 		void Invalidate();
       
   124 					
       
   125 	protected:
       
   126 		CNonRedrawWin(RWsSession &aSession, CWindowGc *aGc);
       
   127 		void ConstrucL();
       
   128 
       
   129 		class CRedrawer : public CActive{
       
   130 			public:
       
   131 				CRedrawer(CNonRedrawWin* aWd);
       
   132 				~CRedrawer();		
       
   133 			private:
       
   134 				void HandleReDrawEvent();
       
   135 				void RunL();
       
   136 				void DoCancel();
       
   137 				void HandleRedrawEvent();
       
   138 				
       
   139 			private:
       
   140 				CNonRedrawWin* iWd;
       
   141 		};
       
   142 			
       
   143 	private:		
       
   144 		RWsSession &iSession;
       
   145 		RWindowGroup iWdGrp;
       
   146 		RWindow iWd;
       
   147 		CWindowGc *iGc;
       
   148 		
       
   149 		CRedrawer *iRedrawer;			
       
   150 		
       
   151 };
       
   152 #endif
       
   153 
       
   154 #endif