1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tdynamicres/inc/wsdynamicresbasic.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,187 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 +*/
1.22 +
1.23 +#ifndef __WSDYNAMICRESBASIC_H__
1.24 +#define __WSDYNAMICRESBASIC_H__
1.25 +
1.26 +#include "wsdynamicresbase.h"
1.27 +#include <graphics/displayconfiguration.h>
1.28 +#include <graphics/displaycontrol.h>
1.29 +#include <graphics/displaymapping.h>
1.30 +#include <e32math.h>
1.31 +/**
1.32 + *
1.33 + **/
1.34 +
1.35 +static TBool cSCLogged =EFalse;
1.36 +
1.37 +
1.38 +class CWsDynamicResBasic : public CWsDynamicResBase
1.39 +{
1.40 + typedef CWsDynamicResBase MyBase;
1.41 +private:
1.42 + struct TBitmapRegionPair
1.43 + {
1.44 + CFbsBitmap* bitmap;
1.45 + RRegion* region;
1.46 + TRect drawRect;
1.47 + };
1.48 +
1.49 +public:
1.50 + CWsDynamicResBasic();
1.51 + virtual ~CWsDynamicResBasic();
1.52 + virtual void SetupL();
1.53 + virtual void TearDownL();
1.54 + virtual void TearDownFromDeleteL();
1.55 +
1.56 + static CTestSuite* CreateSuiteL( const TDesC& aName );
1.57 +
1.58 + void ResetScreens();
1.59 +
1.60 +protected:
1.61 +//tests
1.62 +
1.63 + //BASIC
1.64 + void GRAPHICS_WSERV_DYNAMICRES_0001L();
1.65 + void GRAPHICS_WSERV_DYNAMICRES_0002L();
1.66 + void GRAPHICS_WSERV_DYNAMICRES_0003L();
1.67 + void GRAPHICS_WSERV_DYNAMICRES_0004L();
1.68 + void GRAPHICS_WSERV_DYNAMICRES_0005L();
1.69 + void GRAPHICS_WSERV_DYNAMICRES_0006L();
1.70 + void GRAPHICS_WSERV_DYNAMICRES_0007L();
1.71 + void GRAPHICS_WSERV_DYNAMICRES_0008L();
1.72 + void GRAPHICS_WSERV_DYNAMICRES_0009L();
1.73 + void GRAPHICS_WSERV_DYNAMICRES_0010L();
1.74 + void GRAPHICS_WSERV_DYNAMICRES_0011L();
1.75 + void GRAPHICS_WSERV_DYNAMICRES_0012L();
1.76 + void GRAPHICS_WSERV_DYNAMICRES_0013L();
1.77 + void GRAPHICS_WSERV_DYNAMICRES_0014L();
1.78 + void GRAPHICS_WSERV_DYNAMICRES_0015L();
1.79 + void GRAPHICS_WSERV_DYNAMICRES_0016L();
1.80 + void GRAPHICS_WSERV_DYNAMICRES_0017L();
1.81 + void GRAPHICS_WSERV_DYNAMICRES_0018L();
1.82 +
1.83 + //NEGATIVE
1.84 + void GRAPHICS_WSERV_DYNAMICRES_0021L(TBool aScaleMode);
1.85 +
1.86 + //OOM
1.87 + void GRAPHICS_WSERV_DYNAMICRES_0031L();
1.88 + void GRAPHICS_WSERV_DYNAMICRES_0032L();
1.89 + void GRAPHICS_WSERV_DYNAMICRES_0033L();
1.90 + void GRAPHICS_WSERV_DYNAMICRES_0034L();
1.91 +
1.92 + //SCREEN CAPTURE
1.93 + void GRAPHICS_WSERV_DYNAMICRES_0041L(TBool aIsSurface);
1.94 + void GRAPHICS_WSERV_DYNAMICRES_0042L(TBool aIsSurface);
1.95 +
1.96 + //DYNAMIC SCREEN MODE
1.97 + void GRAPHICS_WSERV_DYNAMICRES_0051L();
1.98 + void GRAPHICS_WSERV_DYNAMICRES_0052L();
1.99 + void GRAPHICS_WSERV_DYNAMICRES_0053L();
1.100 +
1.101 + //DEFECT
1.102 + void GRAPHICS_WSERV_DYNAMICRES_0101L();
1.103 + void GRAPHICS_WSERV_DYNAMICRES_0102L();
1.104 +
1.105 +
1.106 + void SetRotation (TDisplayConfiguration& aConfig, const MDisplayControl::TResolution& aResolution);
1.107 + TBool Compare(const CFbsBitmap& aBitmap, const TRect& aRect1,
1.108 + const TRect& aRect2, RArray<TBitmapRegionPair>& aRegionArray, TBool aIsSurface);
1.109 + TRgb GreatestColor(TRgb& aColor) const;
1.110 +
1.111 +//data members:
1.112 +private:
1.113 + CActiveScheduler iScheduler;
1.114 +};
1.115 +
1.116 +class CWsDisplayEvent : public CActive
1.117 + {
1.118 +
1.119 +public:
1.120 + CWsDisplayEvent(RWsSession *aWs);
1.121 + ~CWsDisplayEvent();
1.122 + void Request();
1.123 + TInt ConfigSpinner() {return iConfigSpinner;}
1.124 + TInt ResListSpinner() {return iResListSpinner;}
1.125 + TInt ReceivedEventCount() {return iReceivedEventCount;}
1.126 + TInt ReceivedDeviceEventCount() {return iReceivedDeviceEventCount;}
1.127 + TInt ReceivedPointerEventCount() {return iReceivedPointerEventCount;}
1.128 + void SetExpectedPointPos(const TPoint& aPos) {iPointerPos = aPos;}
1.129 + TBool PointerTestPassed() {return iPointerPosTestPass;}
1.130 +protected:
1.131 + void DoCancel();
1.132 + void RunL();
1.133 +
1.134 +private:
1.135 + RWsSession *iWs;
1.136 + TInt iConfigSpinner;
1.137 + TInt iResListSpinner;
1.138 + TInt iReceivedEventCount;
1.139 + TInt iReceivedDeviceEventCount;
1.140 + TInt iReceivedPointerEventCount;
1.141 + TPoint iPointerPos;
1.142 + TBool iPointerPosTestPass;
1.143 + };
1.144 +
1.145 +class CEventTimer : public CActive
1.146 + {
1.147 +public:
1.148 + static CEventTimer* NewL();
1.149 + ~CEventTimer();
1.150 + void Wait(TInt aDelay);
1.151 + // From CActive:
1.152 + void RunL();
1.153 + void DoCancel();
1.154 +
1.155 +protected:
1.156 + CEventTimer();
1.157 + void ConstructL();
1.158 + protected:
1.159 +RTimer iTimer;
1.160 +};
1.161 +
1.162 +
1.163 +
1.164 +class CDSATestDrawing: public CTimer, public MDirectScreenAccess
1.165 + {
1.166 +public:
1.167 +
1.168 + void Draw();
1.169 +
1.170 +
1.171 +
1.172 + static CDSATestDrawing* NewL();
1.173 + void ConstructL();
1.174 + //from MDirectScreenAccess
1.175 + void Restart(RDirectScreenAccess::TTerminationReasons aReason);
1.176 + void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
1.177 + ~CDSATestDrawing();
1.178 + void SetDSA(CDirectScreenAccess *aDSA){iDSA = aDSA;}
1.179 + void SetWindow(RWindow &aWindow){iWin = &aWindow;}
1.180 + void StartDrawingL(CDirectScreenAccess *aDSA);
1.181 + void RunL();
1.182 +
1.183 +private:
1.184 + CDSATestDrawing();
1.185 + TRect iRect;
1.186 + RWindow* iWin;
1.187 + CDirectScreenAccess *iDSA;
1.188 + };
1.189 +
1.190 +#endif /*__WSDYNAMICRESBASIC_H__*/