First public contribution.
1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Screen device test code
21 @internalComponent - Internal Symbian test code
26 //Define this to get visible pauses (in test 6: DeviceResSwitchL)
27 //#define VISIBLE_PAUSES
29 //Define this to get extra logging which may be useful in tracking down a fail
30 //#define EXTRA_LOGGING
32 CTScreenDevice::CTScreenDevice(CTestStep* aStep) : CTWsGraphicsBase(aStep)
35 CTScreenDevice::~CTScreenDevice()
38 void CTScreenDevice::ConstructL()
40 //The following is just another test... it doesn't leave any resources for use by the test class AFAICT...
42 CWsScreenDevice *device1;
43 CWsScreenDevice *device2;
44 CWsScreenDevice *device3;
47 device1=new(ELeave) CWsScreenDevice(aSession);
48 device1->Construct(iTest->iScreenNumber);
50 device1=new(ELeave) CWsScreenDevice(aSession);
51 device1->Construct(iTest->iScreenNumber);
52 device2=new(ELeave) CWsScreenDevice(aSession);
53 device2->Construct(iTest->iScreenNumber);
54 device3=new(ELeave) CWsScreenDevice(aSession);
55 device3->Construct(iTest->iScreenNumber);
58 User::LeaveIfError(device1->GetNearestFontToDesignHeightInTwips((CFont *&)font,TFontSpec()));
59 RWindowGroup group(aSession);
61 group.SetOwningWindowGroup(TheClient->iGroup->GroupWin()->Identifier());
62 RWindow win(aSession);
63 win.Construct(group,77);
64 CWindowGc *gc=new(ELeave) CWindowGc(device1);
68 device1->ReleaseFont(font);
79 void CTScreenDevice::TestTwipPixelConversions()
81 TInt result=TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(1234));
84 INFO_PRINTF3(_L("TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(1234) return value - Expected: %d, Actual: %d"), 1234, result);
86 result=TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(1234));
89 INFO_PRINTF3(_L("TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(1234) return value - Expected: %d, Actual: %d"), 1234, result);
91 TSize pixels=TheClient->iScreen->SizeInPixels();
92 TSize twips=TheClient->iScreen->SizeInTwips();
93 TInt conv=TheClient->iScreen->HorizontalPixelsToTwips(pixels.iWidth);
94 TEST(conv==twips.iWidth);
95 if (conv!=twips.iWidth)
96 INFO_PRINTF3(_L("TheClient->iScreen->HorizontalPixelsToTwips(pixels.iWidth) return value - Expected: %d, Actual: %d"), twips.iWidth, conv);
98 conv=TheClient->iScreen->VerticalPixelsToTwips(pixels.iHeight);
99 TEST(conv==twips.iHeight);
100 if (conv!=twips.iHeight)
101 INFO_PRINTF3(_L("TheClient->iScreen->VerticalPixelsToTwips(pixels.iHeight) return value - Expected: %d, Actual: %d"), twips.iHeight, conv);
104 #define TEST_VALUE 100000000
105 void CTScreenDevice::TestTwipPixelOverflow()
107 TInt result=TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE));
108 TEST(result==TEST_VALUE);
109 if (result!=TEST_VALUE)
110 INFO_PRINTF3(_L("TheClient->iScreen->HorizontalTwipsToPixels(TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE)) return value - Expected: %d, Actual: %d"), TEST_VALUE, result);
112 result=TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE));
113 TEST(result==TEST_VALUE);
114 if (result!=TEST_VALUE)
115 INFO_PRINTF3(_L("TheClient->iScreen->VerticalTwipsToPixels(TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE)) return value - Expected: %d, Actual: %d"), TEST_VALUE, result);
117 result = TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE);
120 INFO_PRINTF3(_L("TheClient->iScreen->HorizontalPixelsToTwips(TEST_VALUE) return value - Expected: %d less than, Actual: %d"), 0, result);
122 result = TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE);
125 INFO_PRINTF3(_L("TheClient->iScreen->VerticalPixelsToTwips(TEST_VALUE) return value - Expected: %d less than, Actual: %d"), 0, result);
127 result = TheClient->iScreen->HorizontalTwipsToPixels(TEST_VALUE);
130 INFO_PRINTF3(_L("TheClient->iScreen->HorizontalTwipsToPixels(TEST_VALUE) return value - Expected: %d less than, Actual: %d"), 0, result);
132 result = TheClient->iScreen->VerticalTwipsToPixels(TEST_VALUE);
135 INFO_PRINTF3(_L("TheClient->iScreen->VerticalTwipsToPixels(TEST_VALUE) return value - Expected: %d less than, Actual: %d"), 0, result);
138 void CTScreenDevice::TwipsCacheFlushL()
141 CWsScreenDevice* device;
144 const TFontSpec fontspec(KTestFontTypefaceName,250);
145 TPixelsTwipsAndRotation sizeAndRotation;
147 // create a CWsScreenDevice instance
148 User::LeaveIfError(session.Connect());
149 device=new(ELeave) CWsScreenDevice(session);
150 device->Construct(iTest->iScreenNumber);
152 // Record a font height for use by latter tests
153 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
154 const TInt height0=font->HeightInPixels();
155 device->ReleaseFont(font);
157 // 1. find font with best-matching height in twips,
158 // 2. change twips size of the screen (leaving pixel-size same),
159 // 3. find font with best-matching height in twips,
160 // 4. make sure that the newly found font is not the same as previous and has the different height in pixels
161 device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
162 #if defined(EXTRA_LOGGING)
163 _LIT(KLog1,"Font height: %d for unchanged device. pixels=%d,%d twips=%d,%d");
164 LOG_MESSAGE6(KLog1,height0,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
165 ,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
167 sizeAndRotation.iTwipsSize.iHeight=2000;
168 sizeAndRotation.iTwipsSize.iWidth =3000;
169 device->SetScreenSizeAndRotation(sizeAndRotation);
171 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
172 TInt height=font->HeightInPixels();
173 #if defined(EXTRA_LOGGING)
174 _LIT(KLog2,"Font height: %d for device with twips set to 2000x3000");
175 LOG_MESSAGE2(KLog2,height);
177 TFontSpec returnedSpec=font->FontSpecInTwips();
179 sizeAndRotation.iTwipsSize.iHeight=4000;
180 sizeAndRotation.iTwipsSize.iWidth =6000;
181 device->SetScreenSizeAndRotation(sizeAndRotation);
183 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
184 TInt height2=font2->HeightInPixels();
185 TFontSpec returnedSpec2 = font2->FontSpecInTwips();
186 #if defined(EXTRA_LOGGING)
187 _LIT(KLog3,"Font height: %d for device with twips set to 4000x6000");
188 LOG_MESSAGE2(KLog3,height2);
192 TEST(height!=height2);
193 _LIT(KLogErrM,"Font Heights in pixels match unexpectantly, height=%d");
195 INFO_PRINTF2(KLogErrM,height);
197 device->ReleaseFont(font2);
198 device->ReleaseFont(font);
200 // 1. find font with best-matching height in twips,
201 // 2. change pixel size of the screen (leaving twip-size same),
202 // 3. find font with best-matching height in twips,
203 // 4. make sure that the newly found font is not the same as previous and has the different height in pixels
204 device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
205 sizeAndRotation.iPixelSize.iHeight=240;
206 sizeAndRotation.iPixelSize.iWidth =640;
207 device->SetScreenSizeAndRotation(sizeAndRotation);
209 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
210 height=font->HeightInPixels();
211 returnedSpec=font->FontSpecInTwips();
212 #if defined(EXTRA_LOGGING)
213 _LIT(KLog4,"Font height: %d for device with pixels set to 240x640 twips=%d,%d");
214 LOG_MESSAGE4(KLog4,height,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
217 sizeAndRotation.iPixelSize.iHeight=480;
218 sizeAndRotation.iPixelSize.iWidth =1280;
219 device->SetScreenSizeAndRotation(sizeAndRotation);
221 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
222 height2=font2->HeightInPixels();
223 returnedSpec2=font2->FontSpecInTwips();
224 #if defined(EXTRA_LOGGING)
225 _LIT(KLog5,"Font height: %d for device with pixels set to 480x1280");
226 LOG_MESSAGE2(KLog5,height2);
230 TEST(height!=height2);
232 INFO_PRINTF2(KLogErrM,height);
234 device->ReleaseFont(font2);
235 device->ReleaseFont(font);
237 // 1. double the width and height of screen in both pixels and twips
238 // 2. find font with best-matching height in twips,
239 // 3. make sure that the newly found font is the same as previous and has the same height in pixels
240 device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
241 device->SetScreenSizeAndRotation(sizeAndRotation);
242 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
243 sizeAndRotation.iPixelSize.iHeight*=2;
244 sizeAndRotation.iPixelSize.iWidth *=2;
245 sizeAndRotation.iTwipsSize.iHeight*=2;
246 sizeAndRotation.iTwipsSize.iWidth *=2;
247 device->SetScreenSizeAndRotation(sizeAndRotation);
249 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
250 height2=font2->HeightInPixels();
251 #if defined(EXTRA_LOGGING)
252 _LIT(KLog6,"Font height: %d for device doubled size. pixels=%d,%d twips=%d,%d");
253 LOG_MESSAGE6(KLog6,height2,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
254 ,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
258 TEST(height0==height2);
259 _LIT(KLogErrD,"Font Heights in pixels don't match, expected=%d, actual=%d");
260 if (height0!=height2)
261 INFO_PRINTF3(KLogErrD,height0,height2);
263 device->ReleaseFont(font2);
264 device->ReleaseFont(font);
266 // 1. swap width and height sizes of screen for both pixels and twips
267 // 2. find font with best-matching height in twips,
268 // 3. make sure that the newly found font is the same as previous and has the same height in pixels
269 device->GetDefaultScreenSizeAndRotation(sizeAndRotation);
270 device->SetScreenSizeAndRotation(sizeAndRotation);
271 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font,fontspec));
272 TInt swap=sizeAndRotation.iPixelSize.iHeight;
273 sizeAndRotation.iPixelSize.iHeight=sizeAndRotation.iPixelSize.iWidth;
274 sizeAndRotation.iPixelSize.iWidth =swap;
275 swap=sizeAndRotation.iTwipsSize.iHeight;
276 sizeAndRotation.iTwipsSize.iHeight=sizeAndRotation.iTwipsSize.iWidth;
277 sizeAndRotation.iTwipsSize.iWidth =swap;
278 device->SetScreenSizeAndRotation(sizeAndRotation);
279 User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips(font2,fontspec));
280 height2 = font2->HeightInPixels();
281 #if defined(EXTRA_LOGGING)
282 _LIT(KLog7,"Font height: %d for device rotated size. pixels=%d,%d twips=%d,%d");
283 LOG_MESSAGE6(KLog7,height2,sizeAndRotation.iPixelSize.iWidth,sizeAndRotation.iPixelSize.iHeight
284 ,sizeAndRotation.iTwipsSize.iWidth,sizeAndRotation.iTwipsSize.iHeight);
288 TEST(height0==height2);
289 if (height0!=height2)
290 INFO_PRINTF3(KLogErrD,height0,height2);
292 device->ReleaseFont(font2);
293 device->ReleaseFont(font);
299 void CTScreenDevice::CheckBitmapL(CFbsBitmap *aBitmap, const TRect &aRect)
301 CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(aBitmap);
302 CleanupStack::PushL(device);
303 TInt height=Min(aRect.Size().iHeight,aBitmap->SizeInPixels().iHeight);
304 TInt width=Min(aRect.Size().iWidth,aBitmap->SizeInPixels().iWidth);
306 TInt bufLen=CFbsBitmap::ScanLineLength(width,EGray4);
307 TAny *buf1=User::AllocLC(bufLen);
308 TAny *buf2=User::AllocLC(bufLen);
309 TPtr8 scanBuf1((TUint8 *)buf1,bufLen);
310 TPtr8 scanBuf2((TUint8 *)buf2,bufLen);
311 TInt oddPixels=width%4;
313 for(;pos.iY<height;pos.iY++)
315 TheClient->iScreen->GetScanLine(scanBuf1,pos+aRect.iTl,width,EGray4);
316 device->GetScanLine(scanBuf2,pos,width,EGray4);
319 byte1=(scanBuf1[bufLen-1]<<(2*(4-oddPixels)))%256;
320 byte2=(scanBuf2[bufLen-1]<<(2*(4-oddPixels)))%256;
323 INFO_PRINTF3(_L("byte1==byte2 - byte1: %d, byte2 Height: %d"), byte1, byte2);
325 scanBuf1=scanBuf1.Left(bufLen-1);
326 scanBuf2=scanBuf2.Left(bufLen-1);
328 TBool retVal = !scanBuf1.Compare(scanBuf2);
331 INFO_PRINTF3(_L("!scanBuf1.Compare(scanBuf2) return value - Expected: %d, Actual: %d"), ETrue, retVal);
333 CleanupStack::PopAndDestroy(3);
336 void CTScreenDevice::doTestScreenToBitmapL()
338 RBlankWindow shieldWin(TheClient->iWs);
339 shieldWin.Construct(*TheClient->iGroup->GroupWin(),1);
340 shieldWin.SetOrdinalPosition(0,-1);
341 shieldWin.SetColor(TRgb::Gray4(1));
342 shieldWin.Activate();
343 CleanupStack::PushL(TCleanupItem(CleanUpWindow,&shieldWin));
344 TSize scrSize(TheClient->iScreen->SizeInPixels());
345 CWsBitmap *wsBitmap=new(ELeave) CWsBitmap(TheClient->iWs);
346 CleanupStack::PushL(wsBitmap);
347 User::LeaveIfError(wsBitmap->Create(scrSize,EGray4));
348 CFbsBitmap *bitmap=new(ELeave) CFbsBitmap;
349 CleanupStack::PushL(bitmap);
351 TheClient->iWs.Finish();
352 TheClient->WaitForRedrawsToFinish();
354 User::LeaveIfError(bitmap->Create(TSize(30,10),EGray4));
356 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(wsBitmap));
357 CheckBitmapL(wsBitmap,TRect(scrSize));
359 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap));
360 CheckBitmapL(bitmap,TRect(scrSize));
362 TRect rect1(111,10,222,20);
363 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(wsBitmap,rect1));
364 CheckBitmapL(wsBitmap,rect1);
366 TRect rect2(10,20,100,200);
367 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,rect2));
368 CheckBitmapL(bitmap,rect2);
370 // Now some mad values
372 // Right edge left of left edge
373 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,TRect(100,20,90,200)));
374 // Off the edge of the screen
375 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,TRect(-10,20,-5,200)));
376 // Off the edge of the screen again
377 User::LeaveIfError(TheClient->iScreen->CopyScreenToBitmap(bitmap,TRect(scrSize.AsPoint()+TPoint(5,5),TSize(10,10))));
379 CleanupStack::PopAndDestroy(3);
384 void CTScreenDevice::TestScreenToBitmap()
386 TRAPD(ret,doTestScreenToBitmapL());
389 INFO_PRINTF3(_L("doTestScreenToBitmapL() return value - Expected: %d, Actual: %d"), KErrNone, ret);
393 CCachePanic::~CCachePanic()
399 void CCachePanic::ConstructL(TInt aScreenNumber, TInt aInt)
401 iScreenNumber = aScreenNumber;
404 User::LeaveIfError(iWs.Connect());
405 iWsScrDev=new(ELeave) CWsScreenDevice(iWs);
406 User::LeaveIfError(iWsScrDev->Construct(iScreenNumber));
409 TInt CCachePanic::DoTest(CCachePanic* aTestClass)
411 CActiveScheduler* activeScheduler=new(ELeave) CActiveScheduler;
412 CActiveScheduler::Install(activeScheduler);
413 CleanupStack::PushL(activeScheduler);
414 TRAP_IGNORE(aTestClass->TestL());
415 CleanupStack::PopAndDestroy(activeScheduler);
416 return EWsExitReasonFinished;
419 void CCachePanic::TestL()
421 AutoPanic(EAutoPanicTestFailed);
424 TInt CTwipsPanic::RunTest(TInt aInt, TAny* aPtr)
426 TInt error = KErrNone;
428 CTwipsPanic* self=new(ELeave) CTwipsPanic();
429 CleanupStack::PushL(self);
431 TRAP(error, self->ConstructL((TInt)aPtr, aInt));
434 error = CCachePanic::DoTest(self);
436 CleanupStack::PopAndDestroy(self);
440 void CTwipsPanic::TestL()
442 TPixelsTwipsAndRotation sizeAndRotation;
443 TFontSpec fontspec(KTestFontTypefaceName,250);
448 iWsScrDev->GetDefaultScreenSizeAndRotation(sizeAndRotation);
449 sizeAndRotation.iTwipsSize.iHeight = 2000;
450 sizeAndRotation.iTwipsSize.iWidth = 3000;
451 iWsScrDev->SetScreenSizeAndRotation(sizeAndRotation);
452 iWsScrDev->GetNearestFontToDesignHeightInTwips((CFont *&)font,fontspec);
453 iWsScrDev->GetNearestFontToDesignHeightInTwips((CFont *&)font2,fontspec);
454 sizeAndRotation.iTwipsSize.iHeight = 4000;
455 sizeAndRotation.iTwipsSize.iWidth = 6000;
456 iWsScrDev->SetScreenSizeAndRotation(sizeAndRotation);
457 iWsScrDev->ReleaseFont(font);
460 TInt CScanLinePanic::RunTest(TInt aInt, TAny* aPtr)
462 TInt error = KErrNone;
464 CScanLinePanic* self=new(ELeave) CScanLinePanic();
465 CleanupStack::PushL(self);
467 TRAP(error, self->ConstructL((TInt)aPtr, aInt));
470 error = CCachePanic::DoTest(self);
472 CleanupStack::PopAndDestroy(self);
476 void CScanLinePanic::TestL()
480 case TESTCASE_GRAPHICS_WSERV_0473:
481 TestLengthInvariant();
483 case TESTCASE_GRAPHICS_WSERV_0474:
484 TestBufferInvariant();
489 void CScanLinePanic::TestLengthInvariant()
493 TUint8* buffer=new(ELeave) TUint8[buffLength];
494 TPtr8 scanline(buffer, buffLength, buffLength);
495 iWsScrDev->GetScanLine(scanline, TPoint(), length, EColor64K);
499 void CScanLinePanic::TestBufferInvariant()
503 TUint8* buffer=new(ELeave) TUint8[buffLength];
504 TPtr8 scanline(buffer, buffLength, buffLength);
505 iWsScrDev->GetScanLine(scanline, TPoint(), length, EColor64K);
509 void CTScreenDevice::RunTestCaseL(TInt /*aCurTestCase*/)
511 ((CTScreenDeviceStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
512 switch(++iTest->iState)
515 @SYMTestCaseID GRAPHICS-WSERV-0080
519 @SYMTestCaseDesc Test twips to pixels conversions
521 @SYMTestPriority High
523 @SYMTestStatus Implemented
525 @SYMTestActions Converts pixels to twips and then back the result back to pixels. Checks screen size request methods both in pixels and twips
527 @SYMTestExpectedResults Expects that back and forth conversions preserve an original value.
530 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0080"));
531 iTest->LogSubTest(_L("Screen Device 1"));
532 TestTwipPixelConversions();
535 @SYMTestCaseID GRAPHICS-WSERV-0081
539 @SYMTestCaseDesc Tests CWsScreenDevice::CopyScreenToBitmap method
541 @SYMTestPriority High
543 @SYMTestStatus Implemented
545 @SYMTestActions Creates a blank window on the screen and uses CWsScreenDevice::CopyScreenToBitmap to copy parts of the screen image to either CWsBitmap or CFbsBitmap
547 @SYMTestExpectedResults Expects that the method will not fail and that the image is copied correctly making pixel-to-pixel comparisons
550 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0081"));
551 iTest->LogSubTest(_L("Copy Screen To Bitmap"));
552 TestScreenToBitmap();
555 @SYMTestCaseID GRAPHICS-WSERV-0082
559 @SYMTestCaseDesc Test for integrity of twips to pixels conversions providing big values
561 @SYMTestPriority High
563 @SYMTestStatus Implemented
565 @SYMTestActions Calls twips to pixels (and backward) conversions for 100000000 value
567 @SYMTestExpectedResults Expects that back and forth conversions preserve an original value. Make sure that the result is always greater that 0.
570 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0082"));
571 iTest->LogSubTest(_L("Twip To Pixels Overflow"));
572 TestTwipPixelOverflow();
575 @SYMTestCaseID GRAPHICS-WSERV-0083
579 @SYMTestCaseDesc Test that twips-in-pixel ratio change for screen size affects twips-in-pixel ratio of font
581 @SYMTestPriority High
583 @SYMTestStatus Implemented
585 @SYMTestActions Changes number of twips on screen (leaving number of pixels same), changes number of pixels on screen (leaving number of twips same), makes proportional changes of screen size for both twips and pixels
587 @SYMTestExpectedResults Expects that twips-in-pixel ratio of font leaves the same only when screen size was changed through multipying of width by a coefficient (same for both twips and pixels) and multipying of height by a coefficient (same for both twips and pixels)
590 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0083"));
591 iTest->LogSubTest(_L("Twips cache flush after device size change"));
595 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0083"));
596 iTest->LogSubTest(_L("Twips cache reset"));
597 // not expecting any panic
598 TEST(iTest->TestPanicL(CTwipsPanic::RunTest, 0, 0, (TAny*)iTest->iScreenNumber, _L("")));
601 @SYMTestCaseID GRAPHICS-WSERV-0473
605 @SYMTestCaseDesc Invariant testing length parameter of less then 0 values in CWsScreenDevice::GetScanLine()
608 @SYMTestActions Calls CWsScreenDevice::GetScanLine with aLength of -1.
612 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0473"));
613 iTest->LogSubTest(_L("Testing ScanLine length invariant"));
614 TEST(iTest->TestPanicL(CScanLinePanic::RunTest, EWservPanicInvalidParameter,
615 CScanLinePanic::TESTCASE_GRAPHICS_WSERV_0473,
616 (TAny*)iTest->iScreenNumber, _L("WSERV")));
619 @SYMTestCaseID GRAPHICS-WSERV-0474
623 @SYMTestCaseDesc Invariant testing buffer parameter for required size.
625 @SYMTestActions Calls CWsScreenDevice::GetScanLine with buffer too small to contain requested data.
628 ((CTScreenDeviceStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0474"));
629 iTest->LogSubTest(_L("Testing ScanLine buffer invariant"));
630 TEST(iTest->TestPanicL(CScanLinePanic::RunTest, EWservPanicInvalidParameter,
631 CScanLinePanic::TESTCASE_GRAPHICS_WSERV_0474,
632 (TAny*)iTest->iScreenNumber, _L("WSERV")));
635 ((CTScreenDeviceStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
636 ((CTScreenDeviceStep*)iStep)->CloseTMSGraphicsStep();
639 ((CTScreenDeviceStep*)iStep)->RecordTestResultL();
642 __WS_CONSTRUCT_STEP__(ScreenDevice)