windowing/windowserver/tauto/TSCRMODE.CPP
branchRCL_3
changeset 97 0e9202c0340c
parent 0 5d03bc08d59c
equal deleted inserted replaced
82:65f103b6ab60 97:0e9202c0340c
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    20  @test
    20  @test
    21  @internalComponent - Internal Symbian test code
    21  @internalComponent - Internal Symbian test code
    22 */
    22 */
    23 
    23 
    24 #include "TSCRMODE.H"
    24 #include "TSCRMODE.H"
       
    25 #include <hal.h>
       
    26 #include <hal_data.h>
    25 
    27 
    26 const TInt KBlankWinPosX=10;
    28 const TInt KBlankWinPosX=10;
    27 const TInt KBlankWinPosY=20;
    29 const TInt KBlankWinPosY=20;
    28 const TInt KBlankWinSizeX=30;
    30 const TInt KBlankWinSizeX=30;
    29 const TInt KBlankWinSizeY=25;
    31 const TInt KBlankWinSizeY=25;
    30 
    32 
    31 const TInt KScreenMode0=0;
    33 const TInt KScreenMode0=0;
    32 const TInt KScreenMode1=1;
    34 const TInt KScreenMode1=1;
    33 _LIT(KScreenModeDisplayMode,"GetScreenModeDisplayMode");
       
    34 
    35 
    35 
    36 
    36 CTScrMode::CTScrMode(CTestStep* aStep) : CTWsGraphicsBase(aStep)
    37 CTScrMode::CTScrMode(CTestStep* aStep) : CTWsGraphicsBase(aStep)
    37 	{
    38 	{}
    38 	}
       
    39 
    39 
    40 //
    40 //
    41 // Static func to check windows
    41 // Static func to check windows
    42 //
    42 //
    43 
    43 
    44 LOCAL_C TInt DoPanicTest(TInt aInt, TAny *aScreenNumber)
    44 LOCAL_C TInt DoPanicTest(TInt aInt, TAny* aScreenNumber)
    45 	{
    45 	{
    46 	RWsSession ws;
    46 	RWsSession ws;
    47 	CWsScreenDevice *screen=NULL;
    47 	CWsScreenDevice* screen=NULL;
    48 	if (ws.Connect()==KErrNone)
    48 	if (ws.Connect()==KErrNone)
    49 		{
    49 		{
    50 		screen = new (ELeave) CWsScreenDevice(ws);
    50 		screen = new (ELeave) CWsScreenDevice(ws);
    51 		if (screen && screen->Construct((TInt)aScreenNumber)==KErrNone)
    51 		if (screen && screen->Construct((TInt)aScreenNumber)==KErrNone)
    52 			{
    52 			{
    91 					ws.PointerCursorArea(aInt==12?1003:-2);
    91 					ws.PointerCursorArea(aInt==12?1003:-2);
    92 					break;
    92 					break;
    93 				case 14:
    93 				case 14:
    94 				case 15:
    94 				case 15:
    95 					{
    95 					{
    96 					CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
    96 					CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
    97 					screen->GetRotationsList(aInt==12?1003:-2,rotations);
    97 					screen->GetRotationsList(aInt==12?1003:-2,rotations);
    98 					}
    98 					}
    99 					break;
    99 					break;
   100 				case 100:
   100 				case 100:
   101 					rot=CFbsBitGc::EGraphicsOrientationRotated90;
   101 					rot=CFbsBitGc::EGraphicsOrientationRotated90;
   127 	{
   127 	{
   128 	CleanupClosePushL(aWindow);
   128 	CleanupClosePushL(aWindow);
   129 	User::LeaveIfError(aWindow.Construct(*TheClient->iGroup->GroupWin(), (TUint)&aWindow));
   129 	User::LeaveIfError(aWindow.Construct(*TheClient->iGroup->GroupWin(), (TUint)&aWindow));
   130 	aWindow.SetExtent(aPos, aSize);
   130 	aWindow.SetExtent(aPos, aSize);
   131 	User::LeaveIfError(aWindow.SetRequiredDisplayMode(aDisplayMode));
   131 	User::LeaveIfError(aWindow.SetRequiredDisplayMode(aDisplayMode));
       
   132 	aWindow.SetBackgroundColor(TRgb(255,127,0));		//Orange
   132 	aWindow.Activate();
   133 	aWindow.Activate();
   133 	}
   134 	}
   134 
   135 
   135 void CTScrMode::TestPanicsL()
   136 void CTScrMode::TestPanicsL()
   136 	{
   137 	{
   195 	const TInt KLineLength=10;
   196 	const TInt KLineLength=10;
   196 	const TInt KXScaleFactor=4;
   197 	const TInt KXScaleFactor=4;
   197 	const TInt KYScaleFactor=3;
   198 	const TInt KYScaleFactor=3;
   198 //
   199 //
   199 	// Draw rectangle onto TestWin
   200 	// Draw rectangle onto TestWin
   200  	CWindowGc *gc=TheClient->iGc;
   201  	CWindowGc* gc=TheClient->iGc;
   201 	gc->Activate(*(TestWin->Win()));
   202 	gc->Activate(*(TestWin->Win()));
   202 	gc->SetBrushColor(KRgbBlack);
   203 	gc->SetBrushColor(KRgbBlack);
   203 	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
   204 	gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
   204 	gc->DrawRect(TRect(TPoint(KLineXPos,KLineYPos),TSize(KLineLength*KXScaleFactor,KYScaleFactor)));
   205 	gc->DrawRect(TRect(TPoint(KLineXPos,KLineYPos),TSize(KLineLength*KXScaleFactor,KYScaleFactor)));
   205 	gc->Deactivate();
   206 	gc->Deactivate();
   206 //
   207 //
   207 	// Draw scaled bitmap onto BaseWin
   208 	// Draw scaled bitmap onto BaseWin
   208 	TSize bitSize(KLineLength,1);
   209 	TSize bitSize(KLineLength,1);
   209 	TSize bitTwipSize(TheClient->iScreen->HorizontalPixelsToTwips(bitSize.iWidth*KXScaleFactor),
   210 	TSize bitTwipSize(TheClient->iScreen->HorizontalPixelsToTwips(bitSize.iWidth*KXScaleFactor),
   210 					  TheClient->iScreen->VerticalPixelsToTwips(bitSize.iHeight*KYScaleFactor));
   211 					  TheClient->iScreen->VerticalPixelsToTwips(bitSize.iHeight*KYScaleFactor));
   211 	CFbsBitGc *bitGc=NULL;
   212 	CFbsBitGc* bitGc=NULL;
   212 	CFbsBitmapDevice *device=NULL;
   213 	CFbsBitmapDevice* device=NULL;
   213 	CFbsBitmap *bitmap=NULL;
   214 	CFbsBitmap* bitmap=NULL;
   214 	bitmap=new(ELeave) CFbsBitmap();
   215 	bitmap=new(ELeave) CFbsBitmap();
   215 	CleanupStack::PushL(bitmap);
   216 	CleanupStack::PushL(bitmap);
   216 	User::LeaveIfError(bitmap->Create(bitSize,EGray16));
   217 	User::LeaveIfError(bitmap->Create(bitSize,EGray16));
   217 	bitmap->SetSizeInTwips(bitTwipSize);
   218 	bitmap->SetSizeInTwips(bitTwipSize);
   218 	device=CFbsBitmapDevice::NewL(bitmap);
   219 	device=CFbsBitmapDevice::NewL(bitmap);
   231 	CleanupStack::PopAndDestroy(2);	// bitmap,device
   232 	CleanupStack::PopAndDestroy(2);	// bitmap,device
   232 
   233 
   233 	CompareWindows(_L("CTScrMode::ScaledDrawingL() CompareWindows() failed"));
   234 	CompareWindows(_L("CTScrMode::ScaledDrawingL() CompareWindows() failed"));
   234 	}
   235 	}
   235 
   236 
   236 void CTScrMode::ValidateWin(TestWindow *aWin, TRgb aColor)
   237 void CTScrMode::ValidateWin(TestWindow* aWin, TRgb aColor)
   237 	{
   238 	{
   238 	aWin->Win()->Invalidate();
   239 	aWin->Win()->Invalidate();
   239 	RedrawWin(*aWin->Win(),aColor);
   240 	RedrawWin(*aWin->Win(),aColor);
   240 	}
   241 	}
   241 
   242 
   259 	CompareWindows(_L("CTScrMode::CheckWindows() CompareWindows() failed"));
   260 	CompareWindows(_L("CTScrMode::CheckWindows() CompareWindows() failed"));
   260 	}
   261 	}
   261 
   262 
   262 void CTScrMode::ScreenRotationsL()
   263 void CTScrMode::ScreenRotationsL()
   263 	{
   264 	{
   264 	CWsScreenDevice *screen=TheClient->iScreen;
   265 	CWsScreenDevice* screen=TheClient->iScreen;
   265 	CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
   266 	CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
   266 	CFbsBitGc::TGraphicsOrientation currentRotation;
   267 	CFbsBitGc::TGraphicsOrientation currentRotation;
   267 	TPixelsAndRotation sizeAndRotation;
   268 	TPixelsAndRotation sizeAndRotation;
   268 	TPixelsTwipsAndRotation sizeAndRotation2;
   269 	TPixelsTwipsAndRotation sizeAndRotation2;
   269 	TBool found;
   270 	TBool found;
   270 	TInt numModes=TheClient->iScreenModes.Count();
   271 	TInt numModes=TheClient->iScreenModes.Count();
   276 		TInt mode=TheClient->iScreenModes[ii];
   277 		TInt mode=TheClient->iScreenModes[ii];
   277 		User::LeaveIfError(screen->GetRotationsList(mode,rotations));
   278 		User::LeaveIfError(screen->GetRotationsList(mode,rotations));
   278 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   279 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   279 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
   280 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
   280 		TEST(sizeAndRotation.iPixelSize.iWidth==sizeAndRotation2.iPixelSize.iWidth);
   281 		TEST(sizeAndRotation.iPixelSize.iWidth==sizeAndRotation2.iPixelSize.iWidth);
   281 		if (sizeAndRotation.iPixelSize.iWidth!=sizeAndRotation2.iPixelSize.iWidth)
       
   282 			INFO_PRINTF3(_L("sizeAndRotation.iPixelSize.iWidth==sizeAndRotation2.iPixelSize.iWidth  - Expected: %d, Actual: %d"), sizeAndRotation.iPixelSize.iWidth, sizeAndRotation2.iPixelSize.iWidth);
       
   283 
       
   284 		TEST(sizeAndRotation.iPixelSize.iHeight==sizeAndRotation2.iPixelSize.iHeight);
   282 		TEST(sizeAndRotation.iPixelSize.iHeight==sizeAndRotation2.iPixelSize.iHeight);
   285 		if (sizeAndRotation.iPixelSize.iHeight!=sizeAndRotation2.iPixelSize.iHeight)
   283 		if (sizeAndRotation.iPixelSize.iWidth!=sizeAndRotation2.iPixelSize.iWidth
   286 			INFO_PRINTF3(_L("sizeAndRotation.iPixelSize.iHeight==sizeAndRotation2.iPixelSize.iHeight  - Expected: %d, Actual: %d"), sizeAndRotation.iPixelSize.iHeight, sizeAndRotation2.iPixelSize.iHeight);
   284 					|| sizeAndRotation.iPixelSize.iHeight!=sizeAndRotation2.iPixelSize.iHeight)
   287 
   285 			{
       
   286 			_LIT(KLog,"Height and/or Width don't match (%d,%d)!=(%d,%d) for mode %d");
       
   287 			LOG_MESSAGE6(KLog,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
       
   288 							,sizeAndRotation2.iPixelSize.iWidth,sizeAndRotation2.iPixelSize.iHeight,ii);
       
   289 			}
   288 		count=rotations->Count();
   290 		count=rotations->Count();
   289 		TEST(count>=1);
   291 		TEST(count>=1);
   290 		if (count<1)
   292 		if (count<1)
   291 			INFO_PRINTF3(_L("rotations->Count() return value  - Expected: %d or more, Actual: %d"), 1, count);
   293 			{
   292 
   294 			_LIT(KLog,"No rotations supported for mode %d");
   293 		TBool retVal;
   295 			LOG_MESSAGE2(KLog,ii);
   294 
   296 			}
       
   297 		TBool match;
   295 		if (sizeAndRotation.iPixelSize.iWidth!=sizeAndRotation.iPixelSize.iHeight)
   298 		if (sizeAndRotation.iPixelSize.iWidth!=sizeAndRotation.iPixelSize.iHeight)
   296 			{
   299 			{
   297 			TEST(count<=2);
   300 			TEST(count<=2);
   298 			if (count>2)
   301 			if (count>2)
   299 				INFO_PRINTF3(_L("rotations->Count() return value  - Expected: %d or less, Actual: %d"), 2, count);
   302 				{
   300 
   303 				_LIT(KLog,"Non-square mode %d supports more than 2 rotations (actual rotations=%d)");
       
   304 				LOG_MESSAGE3(KLog,ii,count);
       
   305 				}
   301 			if (count==2)
   306 			if (count==2)
   302 				{
   307 				{
   303 				retVal = (*rotations)[0]+2==(*rotations)[1];
   308 				match=((*rotations)[0]+2==(*rotations)[1]);
   304 				TEST(retVal);		//Must only have rotations 180 degrees apart
   309 				TEST(match);		//Must only have rotations 180 degrees apart
   305 				if (!retVal)
   310 				if (!match)
   306 					INFO_PRINTF3(_L("(*rotations)[0]+2==(*rotations)[1]  - Expected: %d, Actual: %d"), ETrue, retVal);
   311 					{
       
   312 					_LIT(KLog,"In non-square mode %d the two rotations do not differ by 180degrees, rot1=%d, rot2=%d");
       
   313 					LOG_MESSAGE4(KLog,ii,(*rotations)[0],(*rotations)[1]);
       
   314 					}
   307 				}
   315 				}
   308 			}
   316 			}
   309 		found=EFalse;
   317 		found=EFalse;
   310 		for (jj=0;jj<count;++jj)
   318 		for (jj=0;jj<count;++jj)
   311 			{
   319 			{
   312 			if ((*rotations)[jj]==sizeAndRotation.iRotation)
   320 			if ((*rotations)[jj]==sizeAndRotation.iRotation)
   313 				{
   321 				{
   314 				retVal = (*rotations)[jj]==sizeAndRotation2.iRotation;
   322 				match=((*rotations)[jj]==sizeAndRotation2.iRotation);
   315 				TEST(retVal);
   323 				TEST(match);
   316 				if (!retVal)
   324 				if (!match)
   317 					INFO_PRINTF3(_L("(*rotations)[jj]==sizeAndRotation2.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
   325 					{
   318 
   326 					_LIT(KLog,"Rotations don't match %d!=%d for mode %d");
       
   327 					LOG_MESSAGE4(KLog,sizeAndRotation.iRotation,sizeAndRotation2.iRotation,ii);
       
   328 					}
   319 				found=ETrue;
   329 				found=ETrue;
   320 				break;
   330 				break;
   321 				}
   331 				}
   322 			}
   332 			}
   323 		TEST(found);
   333 		TEST(found);
   324 		if (!found)
   334 		if (!found)
   325 				INFO_PRINTF3(_L("found  - Expected: %d, Actual: %d"), ETrue, found);
   335 			{
       
   336 			_LIT(KLog,"In mode %d the current rotation (%d) is not one of the allowable rotations");
       
   337 			LOG_MESSAGE3(KLog,ii,sizeAndRotation.iRotation);
       
   338 			}
   326 
   339 
   327 		if (count>1)
   340 		if (count>1)
   328 			{
   341 			{
   329 			currentRotation=sizeAndRotation.iRotation;
   342 			currentRotation=sizeAndRotation.iRotation;
   330 			for (jj=0;jj<count;++jj)
   343 			for (jj=0;jj<count;++jj)
   331 				{
   344 				{
   332 				screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,(*rotations)[jj]));
   345 				screen->SetCurrentRotations(mode,reinterpret_cast<CFbsBitGc::TGraphicsOrientation&>((*rotations)[jj]));
   333 				screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   346 				screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   334 				screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
   347 				screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
   335 				retVal = (*rotations)[jj]==sizeAndRotation.iRotation;
   348 				match=(((*rotations)[jj]==sizeAndRotation.iRotation) && ((*rotations)[jj]==sizeAndRotation2.iRotation));
   336 				TEST(retVal);
   349 				TEST(match);
   337 				if (!retVal)
   350 				if (!match)
   338 					INFO_PRINTF3(_L("(*rotations)[jj]==sizeAndRotation.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
   351 					{
   339 
   352 					_LIT(KLog,"Rotations don't match %d!=%d (both should be %d) after switching to rotation number %d of mode %d");
   340 				retVal = (*rotations)[jj]==sizeAndRotation2.iRotation;
   353 					LOG_MESSAGE6(KLog,sizeAndRotation.iRotation,sizeAndRotation2.iRotation,(*rotations)[jj],jj,ii);
   341 				TEST(retVal);
   354 					}
   342 				if (!retVal)
       
   343 					INFO_PRINTF3(_L("(*rotations)[jj]==sizeAndRotation2.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
       
   344 
       
   345 				}
   355 				}
   346 			screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
   356 			screen->SetCurrentRotations(mode,reinterpret_cast<CFbsBitGc::TGraphicsOrientation&>(currentRotation));
   347 			screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   357 			screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   348 			screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
   358 			screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation2);
   349 
   359 			match=((currentRotation==sizeAndRotation.iRotation) && (currentRotation==sizeAndRotation2.iRotation));
   350 			retVal = currentRotation==sizeAndRotation.iRotation;
   360 			TEST(match);
   351 			TEST(retVal);
   361 			if (!match)
   352 			if (!retVal)
   362 					{
   353 				INFO_PRINTF3(_L("currentRotation==sizeAndRotation.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
   363 					_LIT(KLog,"Rotations don't match %d!=%d (both should be %d) after switching to the original rotation of mode %d");
   354 
   364 					LOG_MESSAGE5(KLog,sizeAndRotation.iRotation,sizeAndRotation2.iRotation,currentRotation,ii);
   355 			retVal = currentRotation==sizeAndRotation2.iRotation;
   365 					}
   356 			TEST(retVal);
   366 			}
   357 			if (!retVal)
   367 		}
   358 				INFO_PRINTF3(_L("currentRotation==sizeAndRotation2.iRotation  - Expected: %d, Actual: %d"), ETrue, retVal);
   368 	CleanupStack::PopAndDestroy(rotations);
   359 			}
   369 	}
   360 		}
   370 /**
   361 	CleanupStack::PopAndDestroy();
   371   Validate that the screen orienation matchs wiht the screeen orientation stored/set by Wserv in the HAL storage attribute. 
   362 	}
   372   @param aGcOrientation Input orientation to valudate.
       
   373  */
       
   374 void CTScrMode::CheckHalSetting(TInt aGcOrientation)
       
   375     {
       
   376     HALData::TDigitiserOrientation halOrientationExp = static_cast<HALData::TDigitiserOrientation>
       
   377             (HALData::EDigitiserOrientation_000 + (aGcOrientation - CFbsBitGc::EGraphicsOrientationNormal));
       
   378     TInt halOrientation;
       
   379     TInt err = HAL::Get(iTest->iScreenNumber, HALData::EDigitiserOrientation, halOrientation);
       
   380     // Validate if it's supported by HAL
       
   381     if (err != KErrNotSupported)
       
   382         {
       
   383         if (err != KErrNone)
       
   384             {
       
   385             _LIT(KLog,"Getting HAL orientation attribute returned error %d when no error expected");
       
   386             LOG_MESSAGE2(KLog,err);
       
   387             }
       
   388         TEST(err==KErrNone);
       
   389         if (halOrientationExp != halOrientation)
       
   390             {
       
   391             _LIT(KLog,"HAL orientation is %d when expected to be %d");
       
   392             LOG_MESSAGE3(KLog,halOrientation,halOrientationExp);
       
   393             }
       
   394         TEST(halOrientationExp==halOrientation);
       
   395         }
       
   396     else
       
   397         {
       
   398         _LIT(KLog,"HAL-Orientation HALData::EDigitiserOrientation isn't supported by Driver");
       
   399         LOG_MESSAGE(KLog);
       
   400         }
       
   401     }
   363 
   402 
   364 void CTScrMode::MoreScreenRotationsL()
   403 void CTScrMode::MoreScreenRotationsL()
   365 	{
   404 	{
   366 	RWindow shield4Gray(TheClient->iWs);
   405 	RWindow shield64Color(TheClient->iWs);
   367 	// The default display mode needs to be updated to EColor64K for Oghma integ
   406 	SetupTestRWindowLC(shield64Color,TPoint(),TSize(100000,100000),EColor64K);
   368 	SetupTestRWindowLC(shield4Gray,TPoint(),TSize(100000,100000),EColor64K);
   407 	CWsScreenDevice* screen=TheClient->iScreen;
   369 //
       
   370 	CWsScreenDevice *screen=TheClient->iScreen;
       
   371 	//CFbsBitGc::TGraphicsOrientation currentRotation;
       
   372 	TPixelsAndRotation sizeAndRotation;
   408 	TPixelsAndRotation sizeAndRotation;
   373 	TInt currentRotation;
   409 	TInt currentRotation;
   374 	TInt currentMode=FindCurrentMode();
   410 	TInt currentMode=FindCurrentMode();
   375 	TInt numModes=TheClient->iScreenModes.Count();
   411 	TInt numModes=TheClient->iScreenModes.Count();
   376 	TInt currentScreenMode;
   412 	TInt currentScreenMode;
   377 	TInt count;
   413 	TInt count;
   378 	TInt ii,jj;
   414 	TInt ii;
   379 	CArrayFixFlat<TInt> *currentRotations=new(ELeave) CArrayFixFlat<TInt>(1);
   415 	TInt jj;
       
   416 	CArrayFixFlat<TInt>* currentRotations=new(ELeave) CArrayFixFlat<TInt>(1);
   380 	CleanupStack::PushL(currentRotations);
   417 	CleanupStack::PushL(currentRotations);
   381 	currentRotations->ResizeL(numModes);
   418 	currentRotations->ResizeL(numModes);
   382 	CArrayFixFlat<TInt> *originalRotation=new(ELeave) CArrayFixFlat<TInt>(1);
   419 	CArrayFixFlat<TInt>* originalRotation=new(ELeave) CArrayFixFlat<TInt>(1);
   383 	CleanupStack::PushL(originalRotation);
   420 	CleanupStack::PushL(originalRotation);
   384 	originalRotation->ResizeL(numModes);
   421 	originalRotation->ResizeL(numModes);
   385 	CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
   422 	CArrayFixFlat<TInt>* rotations=new(ELeave) CArrayFixFlat<TInt>(1);
   386 	CleanupStack::PushL(rotations);
   423 	CleanupStack::PushL(rotations);
   387 	for (ii=0;ii<numModes;++ii)
   424 	for (ii=0;ii<numModes;++ii)
   388 		{
   425 		{
   389 		TInt mode=TheClient->iScreenModes[ii];
   426 		TInt mode=TheClient->iScreenModes[ii];
   390 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   427 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   391 		(*currentRotations)[ii]=sizeAndRotation.iRotation;
   428 		(*currentRotations)[ii]=sizeAndRotation.iRotation;
   392 		(*originalRotation)[ii]=sizeAndRotation.iRotation;
   429 		(*originalRotation)[ii]=sizeAndRotation.iRotation;
   393 		}
   430 		}
       
   431 	_LIT(KModeSwitchFail,"Change to screen mode %d, resulted in screen being in mode %d");
       
   432 	_LIT(KRotDiff,"Rotations dont match %d!=%d for mode %d");
   394 	for (ii=0;ii<numModes;++ii)
   433 	for (ii=0;ii<numModes;++ii)
   395 		{
   434 		{
   396 		TInt mode=TheClient->iScreenModes[ii];
   435 		TInt mode=TheClient->iScreenModes[ii];
   397 		screen->SetScreenMode(mode);
   436 		screen->SetScreenMode(mode);
   398 		currentScreenMode = screen->CurrentScreenMode();
   437 		currentScreenMode=screen->CurrentScreenMode();
   399 		TEST(currentScreenMode == mode);
   438 		TEST(currentScreenMode==mode);
   400 		if (currentScreenMode != mode)
   439 		if (currentScreenMode!=mode)
   401 			INFO_PRINTF3(_L("screen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), mode, currentScreenMode);
   440 			LOG_MESSAGE3(KModeSwitchFail,mode,currentScreenMode);
   402 
   441 
   403 		screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
   442 		screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
   404 		currentRotation=(*currentRotations)[ii];
   443 		currentRotation=sizeAndRotation.iRotation;
   405 		TEST(sizeAndRotation.iRotation==currentRotation);
   444 		TEST((*currentRotations)[ii]==currentRotation);
   406 
   445 		if ((*currentRotations)[ii]!=currentRotation)
       
   446 			LOG_MESSAGE4(KRotDiff,(*currentRotations)[ii],currentRotation,ii);
   407 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   447 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   408 		TEST(sizeAndRotation.iRotation==currentRotation);
   448 		TEST(sizeAndRotation.iRotation==currentRotation);
       
   449 		if (sizeAndRotation.iRotation!=currentRotation)
       
   450 			LOG_MESSAGE4(KRotDiff,sizeAndRotation.iRotation,currentRotation,ii);
       
   451 		CheckHalSetting(currentRotation);
   409 
   452 
   410 		User::LeaveIfError(screen->GetRotationsList(mode,rotations));
   453 		User::LeaveIfError(screen->GetRotationsList(mode,rotations));
   411 		count=rotations->Count();
   454 		count=rotations->Count();
   412 		if (count>1)
   455 		if (count>1)
   413 			{
   456 			{
   417 					break;
   460 					break;
   418 				}
   461 				}
   419 			if (jj==count)
   462 			if (jj==count)
   420 				jj=0;
   463 				jj=0;
   421 			currentRotation=(*rotations)[jj];
   464 			currentRotation=(*rotations)[jj];
   422 			screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,currentRotation));
   465 			screen->SetCurrentRotations(mode,reinterpret_cast<CFbsBitGc::TGraphicsOrientation&>(currentRotation));
   423 			(*currentRotations)[ii]=currentRotation;
   466 			(*currentRotations)[ii]=currentRotation;
   424 			}
   467 			}
   425 		}
   468 		}
   426 	for (ii=0;ii<numModes;++ii)
   469 	for (ii=0;ii<numModes;++ii)
   427 		{
   470 		{
   428 		TInt mode=TheClient->iScreenModes[ii];
   471 		TInt mode=TheClient->iScreenModes[ii];
   429 		screen->SetScreenMode(mode);
   472 		screen->SetScreenMode(mode);
   430 		currentScreenMode = screen->CurrentScreenMode();
   473 		currentScreenMode=screen->CurrentScreenMode();
   431 		TEST(currentScreenMode == mode);
   474 		TEST(currentScreenMode==mode);
   432 		if (currentScreenMode != mode)
   475 		if (currentScreenMode!=mode)
   433 			INFO_PRINTF3(_L("(screen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), mode, currentScreenMode);
   476 			LOG_MESSAGE3(KModeSwitchFail,mode,currentScreenMode);
   434 
   477 
       
   478 		_LIT(KRotDiff,"Switching to mode %d with rotations %d caused the rotation to become %d");
   435 		screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
   479 		screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
   436 		currentRotation=(*currentRotations)[ii];
   480 		currentRotation=(*currentRotations)[ii];
   437 		TEST(sizeAndRotation.iRotation==currentRotation);
   481 		TEST(sizeAndRotation.iRotation==currentRotation);
   438 		if (sizeAndRotation.iRotation != currentRotation)
   482 		if (sizeAndRotation.iRotation!=currentRotation)
   439 			INFO_PRINTF3(_L("(screen->GetDefaultScreenSizeAndRotation() return value - Expected: %d, Actual: %d"), currentRotation, sizeAndRotation.iRotation);
   483 			{
   440 
   484 			_LIT(KRotDiff,"Switching to mode %d with rotations %d caused the rotation to become %d");
       
   485 			LOG_MESSAGE4(KRotDiff,mode,currentRotation,sizeAndRotation.iRotation);
       
   486 			}
   441 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   487 		screen->GetScreenModeSizeAndRotation(mode,sizeAndRotation);
   442 		TEST(sizeAndRotation.iRotation==currentRotation);
   488 		TEST(sizeAndRotation.iRotation==currentRotation);
   443 		if (sizeAndRotation.iRotation != currentRotation)
   489 		if (sizeAndRotation.iRotation!=currentRotation)
   444 			INFO_PRINTF3(_L("(screen->GetDefaultScreenSizeAndRotation() return value - Expected: %d, Actual: %d"), currentRotation, sizeAndRotation.iRotation);
   490 			LOG_MESSAGE4(KRotDiff,sizeAndRotation.iRotation,currentRotation,ii);
       
   491 		CheckHalSetting(currentRotation);
   445 
   492 
   446 		if (currentRotation!=(*originalRotation)[ii])
   493 		if (currentRotation!=(*originalRotation)[ii])
   447 			screen->SetCurrentRotations(mode,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,(*originalRotation)[ii]));
   494 			{
       
   495 			screen->SetCurrentRotations(mode,reinterpret_cast<CFbsBitGc::TGraphicsOrientation&>((*originalRotation)[ii]));
       
   496 			CheckHalSetting(currentRotation);
       
   497 			}
   448 		}
   498 		}
   449 	screen->SetScreenMode(currentMode);
   499 	screen->SetScreenMode(currentMode);
   450 	currentScreenMode = screen->CurrentScreenMode();
   500 	currentScreenMode=screen->CurrentScreenMode();
   451 	TEST(currentScreenMode == currentMode);
   501 	TEST(currentScreenMode==currentMode);
   452 	if (currentScreenMode != currentMode)
   502 	if (currentScreenMode!=currentMode)
   453 		INFO_PRINTF3(_L("(screen->CurrentScreenMode() return value - Expected: %d, Actual: %d"), currentMode, currentScreenMode);
   503 		LOG_MESSAGE3(KModeSwitchFail,currentMode,currentScreenMode);
   454 
   504 
   455 	CleanupStack::PopAndDestroy(4,&shield4Gray);
   505 	CleanupStack::PopAndDestroy(4,&shield64Color);
   456 	}
   506 	}
   457 
   507 
   458 TInt CTScrMode::FindCurrentMode()
   508 TInt CTScrMode::FindCurrentMode()
   459 	{
   509 	{
   460 	CWsScreenDevice *screen=TheClient->iScreen;
   510 	CWsScreenDevice* screen=TheClient->iScreen;
   461 	TPixelsTwipsAndRotation sizeAndRotation;
   511 	TPixelsTwipsAndRotation sizeAndRotation;
   462 	TPixelsTwipsAndRotation sizeAndRotation2;
   512 	TPixelsTwipsAndRotation sizeAndRotation2;
   463 	TInt numModes=TheClient->iScreenModes.Count();
   513 	TInt numModes=TheClient->iScreenModes.Count();
   464 	TInt ii;
   514 	TInt ii;
   465 	screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
   515 	screen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
   485 	return ETrue;
   535 	return ETrue;
   486 	}
   536 	}
   487 
   537 
   488 TBool CTScrMode::RectClearBugL()
   538 TBool CTScrMode::RectClearBugL()
   489 	{
   539 	{
   490 	CWsScreenDevice *screen=TheClient->iScreen;
   540 	CWsScreenDevice* screen=TheClient->iScreen;
   491 	TPixelsTwipsAndRotation sizeAndRotation1;
   541 	TPixelsTwipsAndRotation sizeAndRotation1;
   492 	TPixelsTwipsAndRotation sizeAndRotation2;
   542 	TPixelsTwipsAndRotation sizeAndRotation2;
   493 	TInt screenMode=FindCurrentMode();
   543 	TInt screenMode=FindCurrentMode();
   494 	TInt largeMode=0;
   544 	TInt largeMode=0;
   495 	TInt smallMode=1;
   545 	TInt smallMode=1;
   508 	if (screenMode!=largeMode)
   558 	if (screenMode!=largeMode)
   509 	{
   559 	{
   510 		INFO_PRINTF2(_L("Large Mode %d\r\n"),largeMode);
   560 		INFO_PRINTF2(_L("Large Mode %d\r\n"),largeMode);
   511 		screen->SetScreenMode(largeMode);
   561 		screen->SetScreenMode(largeMode);
   512 	}
   562 	}
   513 	CBlankWindow *blankWin=new(ELeave) CBlankWindow(TRgb::Gray256(204));
   563 	CBlankWindow* blankWin=new(ELeave) CBlankWindow(TRgb::Gray256(204));
   514 	CleanupStack::PushL(blankWin);
   564 	CleanupStack::PushL(blankWin);
   515 	blankWin->SetUpL(TPoint(),winSize,TheClient->iGroup,*TheClient->iGc);
   565 	blankWin->SetUpL(TPoint(),winSize,TheClient->iGroup,*TheClient->iGc);
   516 	TheClient->iGc->Activate(*blankWin->Win());		//blankWin->Win()->Invalidate();
   566 	TheClient->iGc->Activate(*blankWin->Win());		//blankWin->Win()->Invalidate();
   517 	blankWin->Draw();
   567 	blankWin->Draw();
   518 	TheClient->iWs.Flush();
   568 	TheClient->iWs.Flush();
   689 
   739 
   690 //To test the APIs GetScreenModeDisplayMode() & GetDefModeMaxNumColors()
   740 //To test the APIs GetScreenModeDisplayMode() & GetDefModeMaxNumColors()
   691 void CTScrMode::GetScreenDisplayMode()
   741 void CTScrMode::GetScreenDisplayMode()
   692 	{
   742 	{
   693 	TInt color,gray;
   743 	TInt color,gray;
   694 	CWsScreenDevice *screen=TheClient->iScreen;
   744 	CWsScreenDevice* screen=TheClient->iScreen;
   695 	TInt currentScreenMode=screen->CurrentScreenMode(); //finding the current screen mode
   745 	TInt currentScreenMode=screen->CurrentScreenMode(); //finding the current screen mode
   696 	screen->SetScreenMode(KScreenMode1); //changing the current screen mode to 1
   746 	screen->SetScreenMode(KScreenMode1); //changing the current screen mode to 1
   697 
   747 
   698 	//testing the display mode of Screen Mode using the API GetScreenModeDisplayMode()
   748 	//testing the display mode of Screen Mode using the API GetScreenModeDisplayMode()
   699 	TDisplayMode displayMode=screen->GetScreenModeDisplayMode(KScreenMode1);
   749 	TDisplayMode displayMode=screen->GetScreenModeDisplayMode(KScreenMode1);
  1104 	SetWsAndAppScreenModes(TheClient->iScreenModes[0]);
  1154 	SetWsAndAppScreenModes(TheClient->iScreenModes[0]);
  1105 	}
  1155 	}
  1106 
  1156 
  1107 void CTScrMode::RunTestCaseL(TInt /*aCurTestCase*/)
  1157 void CTScrMode::RunTestCaseL(TInt /*aCurTestCase*/)
  1108 	{
  1158 	{
       
  1159 	_LIT(KTest1,"Orientation1");
       
  1160 	_LIT(KTest2,"Orientation2");
       
  1161 	_LIT(KTest3,"Rect Clear Defect");
       
  1162 	_LIT(KTest4,"ScreenModeChange");
       
  1163 	_LIT(KScreenModeDisplayMode,"GetScreenModeDisplayMode");
  1109 	TBuf<32> buf;
  1164 	TBuf<32> buf;
  1110 	TBool checkWindowParam=EFalse;
  1165 	TBool checkWindowParam=EFalse;
  1111 	TInt count=0;
  1166 	TInt count=0;
  1112 	TInt mode=0;
  1167 	TInt mode=0;
  1113 	TBool enable=EFalse;
  1168 	TBool enable=EFalse;
  1114 	TBool disable=EFalse;
  1169 	TBool disable=EFalse;
  1115 	TInt retVal;
  1170 	TInt retVal;
  1116 	
  1171 
  1117 	((CTScrModeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
       
  1118 	switch(++iTest->iState)
  1172 	switch(++iTest->iState)
  1119 		{
  1173 		{
  1120 /**
  1174 /**
  1121 
       
  1122   @SYMTestCaseID GRAPHICS-WSERV-0296
  1175   @SYMTestCaseID GRAPHICS-WSERV-0296
  1123 
  1176 
  1124   @SYMDEF  			DEF081259
  1177   @SYMTestCaseDesc Test that sizes and rotations returned by the various 
  1125 
  1178 					GetScreenModeSizeAndRotation function are consistent.
  1126   @SYMTestCaseDesc Test screen modes can be set while the screen is rotated
  1179 					Also test that the rotations can be set within each mode.
  1127   					through 180 degrees.
       
  1128 
  1180 
  1129   @SYMTestPriority High
  1181   @SYMTestPriority High
  1130 
  1182 
  1131   @SYMTestStatus Implemented
  1183   @SYMTestStatus Implemented
  1132 
  1184 
  1133   @SYMTestActions Rotate the screen through 180 degrees while setting each
  1185   @SYMTestActions Read the size and rotation of each mode 
  1134   					of the screen modes available
  1186   					and set all allowable rotations.
  1135 
  1187 
  1136   @SYMTestExpectedResults The screen is rotated and screen modes set correctly
  1188   @SYMTestExpectedResults The rotations and sizes are consistent 
  1137 
  1189   							and the rotations get set correctly.
  1138 */
  1190 */
  1139 		case 1:
  1191 	case 1:
  1140 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0296"));
  1192 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0296"));
  1141 			iTest->LogSubTest(_L("Orientation1"));
  1193 		iTest->LogSubTest(KTest1);
  1142 			ScreenRotationsL();
  1194 		ScreenRotationsL();
  1143 			break;
  1195 		break;
       
  1196 
  1144 /**
  1197 /**
  1145 
       
  1146   @SYMTestCaseID GRAPHICS-WSERV-0297
  1198   @SYMTestCaseID GRAPHICS-WSERV-0297
  1147 
  1199 
  1148   @SYMDEF  			DEF081259
  1200   @SYMTestCaseDesc That right rotation is achieved when screen mode is changed.
  1149 
       
  1150   @SYMTestCaseDesc Change the screen orientation then test screen modes can
       
  1151   					be set while the screen is rotated through 180 degrees.
       
  1152 
  1201 
  1153   @SYMTestPriority High
  1202   @SYMTestPriority High
  1154 
  1203 
  1155   @SYMTestStatus Implemented
  1204   @SYMTestStatus Implemented
  1156 
  1205 
  1157   @SYMTestActions Rotate the screen through 180 degrees while setting each
  1206   @SYMTestActions Change the screen modes and rotations in each screen mode (where possible).
  1158   					of the screen modes available
  1207 
  1159 
  1208   @SYMTestExpectedResults The screen ends up in the right rotation
  1160   @SYMTestExpectedResults The screen is rotated and screen modes set correctly
       
  1161 
       
  1162 */
  1209 */
  1163 		case 2:
  1210 	case 2:
  1164 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0297"));
  1211 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0297"));
  1165 			iTest->LogSubTest(_L("Orientation2"));
  1212 		iTest->LogSubTest(KTest2);
  1166 			MoreScreenRotationsL();
  1213 		MoreScreenRotationsL();
  1167 			iSubState=0;
  1214 		iSubState=0;
  1168 			break;
  1215 		break;
       
  1216 
  1169 /**
  1217 /**
  1170 
       
  1171   @SYMTestCaseID GRAPHICS-WSERV-0298
  1218   @SYMTestCaseID GRAPHICS-WSERV-0298
  1172 
  1219 
  1173   @SYMDEF  			DEF081259
  1220   @SYMDEF  			DEF081259
  1174 
  1221 
  1175   @SYMTestCaseDesc Test for the rect clear defect while setting screen mode
  1222   @SYMTestCaseDesc Test for the rect clear defect while setting screen mode
  1180 
  1227 
  1181   @SYMTestActions Change the screen mode and check the rect clear defect is
  1228   @SYMTestActions Change the screen mode and check the rect clear defect is
  1182   					not present
  1229   					not present
  1183 
  1230 
  1184   @SYMTestExpectedResults The defect is not present
  1231   @SYMTestExpectedResults The defect is not present
  1185 
       
  1186 */
  1232 */
  1187 		case 3:
  1233 	case 3:
  1188 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0298"));
  1234 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0298"));
  1189 			iTest->LogSubTest(_L("Rect Clear Defect"));
  1235 		iTest->LogSubTest(KTest3);
  1190 			RectClearBugL();
  1236 		RectClearBugL();
  1191 			break;
  1237 		break;
  1192 		case 4:
  1238 
  1193 /**
  1239 /**
  1194 
       
  1195   @SYMTestCaseID GRAPHICS-WSERV-0299
  1240   @SYMTestCaseID GRAPHICS-WSERV-0299
  1196 
  1241 
  1197   @SYMDEF  			DEF081259
  1242   @SYMDEF  			DEF081259
  1198 
  1243 
  1199   @SYMTestCaseDesc Test display mode can be set for test windows and
  1244   @SYMTestCaseDesc Test display mode can be set for test windows and
  1207   					methods on the windows
  1252   					methods on the windows
  1208 
  1253 
  1209   @SYMTestExpectedResults The windows function correctly
  1254   @SYMTestExpectedResults The windows function correctly
  1210 
  1255 
  1211 */
  1256 */
  1212 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0299"));
  1257 	case 4:
  1213 
  1258 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0299"));
  1214 			iTest->LogSubTest(_L("ScreenModeChange"));
  1259 		iTest->LogSubTest(KTest4);
  1215 			ScreenModeChange1L();
  1260 		ScreenModeChange1L();
  1216 			ScreenModeChange2L();
  1261 		ScreenModeChange2L();
  1217 			break;
  1262 		break;
       
  1263 
  1218 /**
  1264 /**
  1219 
       
  1220   @SYMTestCaseID GRAPHICS-WSERV-0300
  1265   @SYMTestCaseID GRAPHICS-WSERV-0300
  1221 
  1266 
  1222   @SYMDEF  			DEF081259
  1267   @SYMDEF  			DEF081259
  1223 
  1268 
  1224   @SYMTestCaseDesc Test display mode can be set and retrieved
  1269   @SYMTestCaseDesc Test display mode can be set and retrieved
  1229 
  1274 
  1230   @SYMTestActions Set the display mode in a window and the retrieve it
  1275   @SYMTestActions Set the display mode in a window and the retrieve it
  1231 
  1276 
  1232   @SYMTestExpectedResults The display mode retrieved is the same as the
  1277   @SYMTestExpectedResults The display mode retrieved is the same as the
  1233   							one set.
  1278   							one set.
  1234 
       
  1235 */
  1279 */
  1236 		case 5:
  1280 	case 5:
  1237 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0300"));
  1281 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0300"));
  1238 			iTest->LogSubTest(KScreenModeDisplayMode);
  1282 		iTest->LogSubTest(KScreenModeDisplayMode);
  1239 			GetScreenDisplayMode();
  1283 		GetScreenDisplayMode();
  1240 			break;
  1284 		break;
  1241 
  1285 
  1242 	
       
  1243 #if defined(SCREEN_MODE_TESTING)
  1286 #if defined(SCREEN_MODE_TESTING)
  1244 /**
  1287 /**
  1245 
       
  1246   @SYMTestCaseID GRAPHICS-WSERV-0301
  1288   @SYMTestCaseID GRAPHICS-WSERV-0301
  1247 
  1289 
  1248   @SYMDEF  			DEF081259
  1290   @SYMDEF  			DEF081259
  1249 
  1291 
  1250   @SYMTestCaseDesc Case 101 to 105 tests that the screen is drawn correctly
  1292   @SYMTestCaseDesc Case 101 to 105 tests that the screen is drawn correctly
  1257 
  1299 
  1258   @SYMTestActions Set different screen modes and orientations for the screen and
  1300   @SYMTestActions Set different screen modes and orientations for the screen and
  1259   					redraw the screen
  1301   					redraw the screen
  1260 
  1302 
  1261   @SYMTestExpectedResults The screen is drawn correctly for each setting
  1303   @SYMTestExpectedResults The screen is drawn correctly for each setting
  1262 
       
  1263 */
  1304 */
  1264 		case 101:
  1305 	case 101:
  1265 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0301"));
  1306 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0301"));
  1266 			iSubState = 0;
  1307 		iSubState = 0;
  1267 			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1308 		buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1268 			INFO_PRINTF1(buf);
  1309 		INFO_PRINTF1(buf);
  1269 			checkWindowParam=ETrue;
  1310 		checkWindowParam=ETrue;
  1270 			mode=1;
  1311 		mode=1;
  1271 			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1312 		if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1272 				count+=3;
  1313 			count+=3;
  1273 			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1314 		else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1274 				count+=6;
  1315 			count+=6;
  1275 			if (iSecondConnection->DeviceMessageCount()!=count)
  1316 		if (iSecondConnection->DeviceMessageCount()!=count)
  1276 				{
  1317 			{
  1277 				TLogMessageText buf;
  1318 			TLogMessageText buf;
  1278 				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1319 			_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1279 				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1320 			buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1280 				TheClient->iWs.LogMessage(buf);
  1321 			TheClient->iWs.LogMessage(buf);
  1281 				TheClient->iWs.Flush();
       
  1282 				}
       
  1283 			retVal = iSecondConnection->DeviceMessageCount();
       
  1284 			TEST(retVal==count);
       
  1285 			if (retVal!=count)
       
  1286 				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1287 			
       
  1288 			CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
       
  1289 			if (enable)
       
  1290 				iSecondConnection->EnableMessages();
       
  1291 			if (disable)
       
  1292 				iSecondConnection->DisableMessages();
       
  1293 			TheClient->iScreen->SetScreenMode(mode);
       
  1294 			TheClient->iWs.Flush();
  1322 			TheClient->iWs.Flush();
  1295 			iSubState++;
  1323 			}
  1296 			break;
  1324 		retVal = iSecondConnection->DeviceMessageCount();
  1297 		case 102:
  1325 		TEST(retVal==count);
       
  1326 		if (retVal!=count)
       
  1327 			INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1328 		
       
  1329 		CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
       
  1330 		if (enable)
       
  1331 			iSecondConnection->EnableMessages();
       
  1332 		if (disable)
       
  1333 			iSecondConnection->DisableMessages();
       
  1334 		TheClient->iScreen->SetScreenMode(mode);
       
  1335 		TheClient->iWs.Flush();
       
  1336 		iSubState++;
       
  1337 		break;
       
  1338 
  1298 /**
  1339 /**
  1299   @SYMTestCaseID GRAPHICS-WSERV-0521
  1340   @SYMTestCaseID GRAPHICS-WSERV-0521
  1300 */
  1341 */
  1301 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0521"));
  1342 	case 102:
  1302 			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1343 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0521"));
  1303 			INFO_PRINTF1(buf);
  1344 		buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1304 			checkWindowParam=EFalse;
  1345 		INFO_PRINTF1(buf);
  1305 			enable=ETrue;
  1346 		checkWindowParam=EFalse;
  1306 			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1347 		enable=ETrue;
  1307 				count+=3;
  1348 		if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1308 			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1349 			count+=3;
  1309 				count+=6;
  1350 		else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1310 			if (iSecondConnection->DeviceMessageCount()!=count)
  1351 			count+=6;
  1311 				{
  1352 		if (iSecondConnection->DeviceMessageCount()!=count)
  1312 				TLogMessageText buf;
  1353 			{
  1313 				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1354 			TLogMessageText buf;
  1314 				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1355 			_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1315 				TheClient->iWs.LogMessage(buf);
  1356 			buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1316 				TheClient->iWs.Flush();
  1357 			TheClient->iWs.LogMessage(buf);
  1317 				}
       
  1318 			retVal = iSecondConnection->DeviceMessageCount();
       
  1319 			TEST(retVal==count);
       
  1320 			if (retVal!=count)
       
  1321 				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1322 
       
  1323 			if (enable)
       
  1324 				iSecondConnection->EnableMessages();
       
  1325 			if (disable)
       
  1326 				iSecondConnection->DisableMessages();
       
  1327 			TheClient->iScreen->SetScreenMode(mode);
       
  1328 			TheClient->iWs.Flush();
  1358 			TheClient->iWs.Flush();
  1329 			iSubState++;
  1359 			}
  1330 			break;
  1360 		retVal = iSecondConnection->DeviceMessageCount();
  1331 		case 103:
  1361 		TEST(retVal==count);
       
  1362 		if (retVal!=count)
       
  1363 			INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1364 
       
  1365 		if (enable)
       
  1366 			iSecondConnection->EnableMessages();
       
  1367 		if (disable)
       
  1368 			iSecondConnection->DisableMessages();
       
  1369 		TheClient->iScreen->SetScreenMode(mode);
       
  1370 		TheClient->iWs.Flush();
       
  1371 		iSubState++;
       
  1372 		break;
       
  1373 
  1332 /**
  1374 /**
  1333   @SYMTestCaseID GRAPHICS-WSERV-0522
  1375   @SYMTestCaseID GRAPHICS-WSERV-0522
  1334 */
  1376 */
  1335 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0522"));
  1377 	case 103:
  1336 			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1378 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0522"));
  1337 			INFO_PRINTF1(buf);
  1379 		buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1338 			count=1;
  1380 		INFO_PRINTF1(buf);
  1339 			mode=1;
  1381 		count=1;
  1340 			checkWindowParam=ETrue;
  1382 		mode=1;
  1341 			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1383 		checkWindowParam=ETrue;
  1342 				count+=3;
  1384 		if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1343 			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1385 			count+=3;
  1344 				count+=6;
  1386 		else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1345 			if (iSecondConnection->DeviceMessageCount()!=count)
  1387 			count+=6;
  1346 				{
  1388 		if (iSecondConnection->DeviceMessageCount()!=count)
  1347 				TLogMessageText buf;
  1389 			{
  1348 				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1390 			TLogMessageText buf;
  1349 				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1391 			_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1350 				TheClient->iWs.LogMessage(buf);
  1392 			buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1351 				TheClient->iWs.Flush();
  1393 			TheClient->iWs.LogMessage(buf);
  1352 				}
       
  1353 			retVal = iSecondConnection->DeviceMessageCount();
       
  1354 			TEST(retVal==count);
       
  1355 			if (retVal!=count)
       
  1356 				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1357 
       
  1358 			CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
       
  1359 			if (enable)
       
  1360 				iSecondConnection->EnableMessages();
       
  1361 			if (disable)
       
  1362 				iSecondConnection->DisableMessages();
       
  1363 			TheClient->iScreen->SetScreenMode(mode);
       
  1364 			TheClient->iWs.Flush();
  1394 			TheClient->iWs.Flush();
  1365 			iSubState++;
  1395 			}
  1366 			break;
  1396 		retVal = iSecondConnection->DeviceMessageCount();
  1367 		case 104:
  1397 		TEST(retVal==count);
       
  1398 		if (retVal!=count)
       
  1399 			INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1400 
       
  1401 		CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
       
  1402 		if (enable)
       
  1403 			iSecondConnection->EnableMessages();
       
  1404 		if (disable)
       
  1405 			iSecondConnection->DisableMessages();
       
  1406 		TheClient->iScreen->SetScreenMode(mode);
       
  1407 		TheClient->iWs.Flush();
       
  1408 		iSubState++;
       
  1409 		break;
       
  1410 
  1368 /**
  1411 /**
  1369   @SYMTestCaseID GRAPHICS-WSERV-0523
  1412   @SYMTestCaseID GRAPHICS-WSERV-0523
  1370 */
  1413 */
  1371 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0523"));
  1414 	case 104:
  1372 			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1415 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0523"));
  1373 			INFO_PRINTF1(buf);
  1416 		buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1374 			checkWindowParam=ETrue;
  1417 		INFO_PRINTF1(buf);
  1375 			count=2;
  1418 		checkWindowParam=ETrue;
  1376 			disable=ETrue;
  1419 		count=2;
  1377 			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1420 		disable=ETrue;
  1378 				count+=3;
  1421 		if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1379 			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1422 			count+=3;
  1380 				count+=6;
  1423 		else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1381 			if (iSecondConnection->DeviceMessageCount()!=count)
  1424 			count+=6;
  1382 				{
  1425 		if (iSecondConnection->DeviceMessageCount()!=count)
  1383 				TLogMessageText buf;
  1426 			{
  1384 				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1427 			TLogMessageText buf;
  1385 				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1428 			_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1386 				TheClient->iWs.LogMessage(buf);
  1429 			buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1387 				TheClient->iWs.Flush();
  1430 			TheClient->iWs.LogMessage(buf);
  1388 				}
       
  1389 			retVal = iSecondConnection->DeviceMessageCount();
       
  1390 			TEST(retVal==count);
       
  1391 			if (retVal!=count)
       
  1392 				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1393 
       
  1394 			if (enable)
       
  1395 				iSecondConnection->EnableMessages();
       
  1396 			if (disable)
       
  1397 				iSecondConnection->DisableMessages();
       
  1398 			TheClient->iScreen->SetScreenMode(mode);
       
  1399 			TheClient->iWs.Flush();
  1431 			TheClient->iWs.Flush();
  1400 			iSubState++;
  1432 			}
  1401 			break;
  1433 		retVal = iSecondConnection->DeviceMessageCount();
  1402 		case 105:
  1434 		TEST(retVal==count);
       
  1435 		if (retVal!=count)
       
  1436 			INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1437 
       
  1438 		if (enable)
       
  1439 			iSecondConnection->EnableMessages();
       
  1440 		if (disable)
       
  1441 			iSecondConnection->DisableMessages();
       
  1442 		TheClient->iScreen->SetScreenMode(mode);
       
  1443 		TheClient->iWs.Flush();
       
  1444 		iSubState++;
       
  1445 		break;
       
  1446 
  1403 /**
  1447 /**
  1404   @SYMTestCaseID GRAPHICS-WSERV-0524
  1448   @SYMTestCaseID GRAPHICS-WSERV-0524
  1405 */
  1449 */
  1406 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0524"));
  1450 	case 105:
  1407 			buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1451 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0524"));
  1408 			INFO_PRINTF1(buf);
  1452 		buf.Format(TRefByValue<const TDesC>(_L("Screen mode %d:%d")),101,iSubState);
  1409 			checkWindowParam=EFalse;
  1453 		INFO_PRINTF1(buf);
  1410 			count=2;
  1454 		checkWindowParam=EFalse;
  1411 			enable=ETrue;
  1455 		count=2;
  1412 			if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1456 		enable=ETrue;
  1413 				count+=3;
  1457 		if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1414 			else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1458 			count+=3;
  1415 				count+=6;
  1459 		else if (iCurEnforcement==ESizeEnforcementPixelsTwipsAndRotation)
  1416 			if (iSecondConnection->DeviceMessageCount()!=count)
  1460 			count+=6;
  1417 				{
  1461 		if (iSecondConnection->DeviceMessageCount()!=count)
  1418 				TLogMessageText buf;
  1462 			{
  1419 				_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1463 			TLogMessageText buf;
  1420 				buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1464 			_LIT(KFailCount,"Event Mismatch, Exp=%d, Act=%d");
  1421 				TheClient->iWs.LogMessage(buf);
  1465 			buf.Format(KFailCount,count,iSecondConnection->DeviceMessageCount());
  1422 				TheClient->iWs.Flush();
  1466 			TheClient->iWs.LogMessage(buf);
  1423 				}
       
  1424 			retVal = iSecondConnection->DeviceMessageCount();
       
  1425 			TEST(retVal==count);
       
  1426 			if (retVal!=count)
       
  1427 				INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1428 
       
  1429 			CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
       
  1430 			if (enable)
       
  1431 				iSecondConnection->EnableMessages();
       
  1432 			if (disable)
       
  1433 				iSecondConnection->DisableMessages();
       
  1434 			TheClient->iScreen->SetScreenMode(mode);
       
  1435 			TheClient->iWs.Flush();
  1467 			TheClient->iWs.Flush();
  1436 
  1468 			}
  1437 
  1469 		retVal = iSecondConnection->DeviceMessageCount();
       
  1470 		TEST(retVal==count);
       
  1471 		if (retVal!=count)
       
  1472 			INFO_PRINTF3(_L("(iSecondConnection->DeviceMessageCount() return value - Expected: %d, Actual: %d"),count ,retVal);
       
  1473 
       
  1474 		CheckWindows(iCurEnforcement==ESizeEnforcementNone?ETrue:checkWindowParam);
       
  1475 		if (enable)
       
  1476 			iSecondConnection->EnableMessages();
       
  1477 		if (disable)
  1438 			iSecondConnection->DisableMessages();
  1478 			iSecondConnection->DisableMessages();
  1439 			if (iCurEnforcement==ESizeEnforcementNone)
  1479 		TheClient->iScreen->SetScreenMode(mode);
  1440 				{	// Do it again with different enforcement mode
  1480 		TheClient->iWs.Flush();
  1441 				SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
  1481 
  1442 				ResetCounter(100);
  1482 
  1443 				}
  1483 		iSecondConnection->DisableMessages();
  1444 			else if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1484 		if (iCurEnforcement==ESizeEnforcementNone)
  1445 				{	// Do it again with different enforcement mode
  1485 			{	// Do it again with different enforcement mode
  1446 				SetScreenModeEnforcement(ESizeEnforcementPixelsTwipsAndRotation);
  1486 			SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
  1447 				ResetCounter(100);
  1487 			ResetCounter(100);
  1448 				}
  1488 			}
  1449 			else
  1489 		else if (iCurEnforcement==ESizeEnforcementPixelsAndRotation)
  1450 				{
  1490 			{	// Do it again with different enforcement mode
  1451 				SetScreenModeEnforcement(ESizeEnforcementNone);
  1491 			SetScreenModeEnforcement(ESizeEnforcementPixelsTwipsAndRotation);
  1452 				delete iSecondConnection;
  1492 			ResetCounter(100);
  1453 				iSecondConnection=NULL;
  1493 			}
  1454 				}
  1494 		else
  1455 			TheClient->iWs.Flush();
  1495 			{
  1456 			break;
  1496 			SetScreenModeEnforcement(ESizeEnforcementNone);
       
  1497 			delete iSecondConnection;
       
  1498 			iSecondConnection=NULL;
       
  1499 			}
       
  1500 		TheClient->iWs.Flush();
       
  1501 		break;
       
  1502 
  1457 /**
  1503 /**
  1458 
       
  1459   @SYMTestCaseID GRAPHICS-WSERV-0302
  1504   @SYMTestCaseID GRAPHICS-WSERV-0302
  1460 
  1505 
  1461   @SYMDEF  			DEF099638
  1506   @SYMDEF  			DEF099638
  1462 
  1507 
  1463   @SYMTestCaseDesc Test that a drawing can be scaled while different screen
  1508   @SYMTestCaseDesc Test that a drawing can be scaled while different screen
  1468   @SYMTestStatus Implemented
  1513   @SYMTestStatus Implemented
  1469 
  1514 
  1470   @SYMTestActions Set different screen modes and scale a drawing
  1515   @SYMTestActions Set different screen modes and scale a drawing
  1471 
  1516 
  1472   @SYMTestExpectedResults The drawing is redrawn to scale
  1517   @SYMTestExpectedResults The drawing is redrawn to scale
  1473 
       
  1474 */
  1518 */
  1475 		case 110:
  1519 	case 110:
  1476 			{
  1520 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0302"));
  1477 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0302"));
  1521 		// Ensure that the TestWin and BaseWin will be drawn properly in all screen modes
  1478 			// Ensure that the TestWin and BaseWin will be drawn properly in all screen modes
  1522 		SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
  1479 			SetScreenModeEnforcement(ESizeEnforcementPixelsAndRotation);
  1523 		TheClient->SetTestClientScreenMode(0);
  1480 			TheClient->SetTestClientScreenMode(0);
  1524 		INFO_PRINTF1(_L("Scaled drawing - screen mode 0"));
  1481 			INFO_PRINTF1(_L("Scaled drawing - screen mode 0"));
  1525 		ScaledDrawingL();
  1482 			ScaledDrawingL();
  1526 		TheClient->SetTestClientScreenMode(1);
  1483 			TheClient->SetTestClientScreenMode(1);
  1527 		INFO_PRINTF1(_L("Scaled drawing - screen mode 1"));
  1484 			INFO_PRINTF1(_L("Scaled drawing - screen mode 1"));
  1528 		ScaledDrawingL();
  1485 			ScaledDrawingL();
  1529 		// Restore screen mode and enforcement mode				
  1486 			// Restore screen mode and enforcement mode				
  1530 		TheClient->SetTestClientScreenMode(0);
  1487 			TheClient->SetTestClientScreenMode(0);
  1531 		SetScreenModeEnforcement(iOldEnfMode);
  1488 			SetScreenModeEnforcement(iOldEnfMode);
  1532 		break;
  1489 			break;
       
  1490 			}
       
  1491 
  1533 
  1492 /**
  1534 /**
  1493 
       
  1494   @SYMTestCaseID GRAPHICS-WSERV-0303
  1535   @SYMTestCaseID GRAPHICS-WSERV-0303
  1495 
  1536 
  1496   @SYMDEF  			DEF081259
  1537   @SYMDEF  			DEF081259
  1497 
  1538 
  1498   @SYMTestCaseDesc Test screen mode and rotation panic messages
  1539   @SYMTestCaseDesc Test screen mode and rotation panic messages
  1503 
  1544 
  1504   @SYMTestActions Test the panics fro screen mode and rotation respond as
  1545   @SYMTestActions Test the panics fro screen mode and rotation respond as
  1505   					expected
  1546   					expected
  1506 
  1547 
  1507   @SYMTestExpectedResults Panics respond as expected
  1548   @SYMTestExpectedResults Panics respond as expected
  1508 
       
  1509 */
  1549 */
  1510 		case 111:
  1550 	case 111:
  1511 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0303"));
  1551 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0303"));
  1512 			INFO_PRINTF1(_L("Panic"));
  1552 		INFO_PRINTF1(_L("Panic"));
  1513 			TestPanicsL();
  1553 		TestPanicsL();
  1514 			break;
  1554 		break;
  1515 #endif
  1555 #endif
       
  1556 
  1516 /**
  1557 /**
  1517 
       
  1518   @SYMTestCaseID GRAPHICS-WSERV-0304
  1558   @SYMTestCaseID GRAPHICS-WSERV-0304
  1519 
  1559 
  1520   @SYMDEF  			DEF081259
  1560   @SYMDEF  			DEF081259
  1521 
  1561 
  1522   @SYMTestCaseDesc Test that if there are invisible windows and then the
  1562   @SYMTestCaseDesc Test that if there are invisible windows and then the
  1528 
  1568 
  1529   @SYMTestActions Create some windows, make some invisible, change the screen
  1569   @SYMTestActions Create some windows, make some invisible, change the screen
  1530   					mode and redraw the windows
  1570   					mode and redraw the windows
  1531 
  1571 
  1532   @SYMTestExpectedResults The windows are redrawn without error
  1572   @SYMTestExpectedResults The windows are redrawn without error
  1533 
       
  1534 */
  1573 */
  1535 		case 112:
  1574 	case 112:
  1536 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0304"));
  1575 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0304"));
  1537 			INFO_PRINTF1(_L("Invisible Wnds And Infinite Redraw Bugs")); // two defects one problem
  1576 		INFO_PRINTF1(_L("Invisible Wnds And Infinite Redraw Bugs")); // two defects one problem
  1538 			InvisibleWndAndInfiniteRedrawBugL();
  1577 		InvisibleWndAndInfiniteRedrawBugL();
  1539 			break;
  1578 		break;
       
  1579 
  1540 /**
  1580 /**
  1541 
       
  1542   @SYMTestCaseID GRAPHICS-WSERV-0358
  1581   @SYMTestCaseID GRAPHICS-WSERV-0358
  1543 
  1582 
  1544   @SYMDEF  			PDEF096151
  1583   @SYMDEF  			PDEF096151
  1545 
  1584 
  1546   @SYMTestCaseDesc Ensure that wserv does not panic when calling CWsScreenDevice::SetScreenMode()
  1585   @SYMTestCaseDesc Ensure that wserv does not panic when calling CWsScreenDevice::SetScreenMode()
  1559                   Calls SetScreenMode on the second screen device
  1598                   Calls SetScreenMode on the second screen device
  1560                     (this step triggered the defect - panicking wserv)
  1599                     (this step triggered the defect - panicking wserv)
  1561                   Cleans up the above
  1600                   Cleans up the above
  1562 
  1601 
  1563   @SYMTestExpectedResults The call to SetScreenMode should not cause wserv to panic
  1602   @SYMTestExpectedResults The call to SetScreenMode should not cause wserv to panic
  1564 
       
  1565 */
  1603 */
  1566  		case 113:
  1604 	case 113:
  1567  			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0358"));
  1605 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0358"));
  1568 			INFO_PRINTF1(_L("Set screen mode after a client has deleted the screen device"));
  1606 		INFO_PRINTF1(_L("Set screen mode after a client has deleted the screen device"));
  1569 			SetScreenModeAfterScreenDeviceDeletedL();
  1607 		SetScreenModeAfterScreenDeviceDeletedL();
  1570 			break;
  1608 		break;
  1571 		case 114:
  1609 
  1572 			INFO_PRINTF1(_L("Rotate/screen mode test"));
       
  1573 /**
  1610 /**
  1574   @SYMTestCaseID GRAPHICS-WSERV-0525
  1611   @SYMTestCaseID GRAPHICS-WSERV-0525
  1575 */
  1612 */
  1576 			((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0525"));
  1613 	case 114:
  1577 			TestRotateAndScreenModeL();
  1614 		INFO_PRINTF1(_L("Rotate/screen mode test"));
  1578 			break;
  1615 		((CTScrModeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0525"));
  1579 		default:
  1616 		TestRotateAndScreenModeL();
  1580             ((CTScrModeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
  1617 		break;
  1581 			if (iTest->iState==115 || iTest->iState>1000)
  1618 	default:
  1582 				TestComplete();
  1619 		((CTScrModeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
  1583 			break;
  1620 		if (iTest->iState==115 || iTest->iState>1000)
       
  1621 			TestComplete();
       
  1622 		break;
  1584 		}
  1623 		}
  1585 	((CTScrModeStep*)iStep)->RecordTestResultL();
  1624 	((CTScrModeStep*)iStep)->RecordTestResultL();
  1586 	}
  1625 	}
  1587 
  1626 
  1588 //
  1627 //
  1596 	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
  1635 	iGroup->GroupWin()->EnableReceiptOfFocus(EFalse);	// Stop auto group switching on close
  1597 	delete iGroup;
  1636 	delete iGroup;
  1598 	delete iClient;
  1637 	delete iClient;
  1599 	}
  1638 	}
  1600 
  1639 
  1601 void CSecondConnection::ConstructL(TInt aScreenNumber,const TRect &aWinRect, CTestBase *aTest, CTestStep* aTestStep)
  1640 void CSecondConnection::ConstructL(TInt aScreenNumber,const TRect &aWinRect, CTestBase* aTest, CTestStep* aTestStep)
  1602 	{
  1641 	{
  1603 	iClient=new(ELeave) CTClient;
  1642 	iClient=new(ELeave) CTClient;
  1604 	iClient->SetScreenNumber(aScreenNumber);
  1643 	iClient->SetScreenNumber(aScreenNumber);
  1605 	iClient->ConstructL();
  1644 	iClient->ConstructL();
  1606 	iGroup=new(ELeave) CSecondConnectionGroup(iClient,this,aTest,aTestStep);
  1645 	iGroup=new(ELeave) CSecondConnectionGroup(iClient,this,aTest,aTestStep);
  1655 
  1694 
  1656 //
  1695 //
  1657 // CSecondConnectionGroup
  1696 // CSecondConnectionGroup
  1658 //
  1697 //
  1659 
  1698 
  1660 CSecondConnectionGroup::CSecondConnectionGroup(CTClient *aClient, CSecondConnection *aSecondConnection, CTestBase *aTest, CTestStep* aTestStep) : CTWindowGroup(aClient), iTest(aTest), iSecondConnection(aSecondConnection), iTestStep(aTestStep)
  1699 CSecondConnectionGroup::CSecondConnectionGroup(CTClient* aClient, CSecondConnection* aSecondConnection, CTestBase* aTest, CTestStep* aTestStep) : CTWindowGroup(aClient), iTest(aTest), iSecondConnection(aSecondConnection), iTestStep(aTestStep)
  1661 	{}
  1700 	{}
  1662 
  1701 
  1663 void CSecondConnectionGroup::ScreenDeviceChanged()
  1702 void CSecondConnectionGroup::ScreenDeviceChanged()
  1664 	{
  1703 	{
  1665 	iSecondConnection->ScreenDeviceChanged();
  1704 	iSecondConnection->ScreenDeviceChanged();