Update contrib.
1 // Copyright (c) 2007-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.
16 #include "tdirectgdicontext.h"
19 #include <graphics/directgdicontext.h>
22 _LIT16(KAbcd,"Abcd efgh ijkl mnop");
24 CTDirectGdiContext::CTDirectGdiContext()
26 SetTestStepName(KTDirectGdiContextStep);
29 CTDirectGdiContext::~CTDirectGdiContext()
39 GRAPHICS-DIRECTGDI-CONTEXT-0001
57 Use case - Single context and single target.
60 Single context is created and activated on a single target.
61 Then some draw operations are done.
63 @SYMTestExpectedResults
64 It should be able to draw using the correct context and target.
69 void CTDirectGdiContext::OneContextOneTarget()
71 _LIT(KTestName, "Context-OneContextOneTarget");
74 INFO_PRINTF1(KTestName);
78 iGc->SetPenColor(TRgb(255, 0, 0));
79 TEST(iGc->PenColor() == TRgb(255, 0, 0));
80 iGc->DrawEllipse(TRect(0, 0, 60, 60));
81 TESTNOERROR(iGc->GetError());
82 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(KTestName)));
87 GRAPHICS-DIRECTGDI-CONTEXT-0002
105 Use case - Draw to two separate targets using a single context.
108 Test that a single context can be activated on two different targets.
109 - A single context is created and activated on a target then a green circle is drawn.
110 - The same context then activated on a second target and a red circle is drawn.
112 @SYMTestExpectedResults
113 It should be able to draw using the correct context and target and context should
114 be able to switch between the targets. The first target should have a green circle
115 only drawn on it, the second target should have a red circle only drawn on it.
120 void CTDirectGdiContext::OneContextTwoTargets()
122 TBuf<KTestCaseLength> testCaseNameA;
123 TBuf<KTestCaseLength> testCaseNameB;
124 _LIT(KTestCase, "Context-OneContextTwoTargets");
125 testCaseNameA.Append(KTestCase);
126 testCaseNameB.Append(KTestCase);
127 if(iCaseNum == EOneContextTwoTargets_SamePixelType)
129 testCaseNameA.Append(KSamePixelType);
130 testCaseNameB.Append(KSamePixelType);
134 testCaseNameA.Append(KDifferentPixelType);
135 testCaseNameB.Append(KDifferentPixelType);
137 testCaseNameA.Append(KTarget1);
138 testCaseNameB.Append(KTarget2);
139 if(!iRunningOomTests)
141 INFO_PRINTF1(KTestCase);
144 iGc->SetPenColor(TRgb(0, 255, 0));
145 TEST(iGc->PenColor() == TRgb(0, 255, 0));
146 iGc->DrawEllipse(TRect(0, 0, 60, 60));
147 TESTNOERROR(iGc->GetError());
148 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameA)));
150 iGdiTarget2->Activate(iGc);
153 iGc->SetPenColor(TRgb(255, 0, 0));
154 TEST(iGc->PenColor() == TRgb(255, 0, 0));
155 iGc->DrawEllipse(TRect(0, 0, 60, 60));
156 TESTNOERROR(iGc->GetError());
157 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameB),iGdiTarget2));
162 GRAPHICS-DIRECTGDI-CONTEXT-0003
180 Use case - draw to a single target using two different contexts.
183 Test context's creation and activation when drawing using two different contexts to a single target.
184 - Activate the first context on the target and draw a red circle.
185 - Write out the contents of the target.
186 - Activate the second context on the target, clear it and draw a smaller black circle.
187 - Write out the contents of the target.
189 @SYMTestExpectedResults
190 It should be able to draw using the correct context and target. The first image written out
191 should contain a red circle, the second image written out should contain a smaller black circle.
196 void CTDirectGdiContext::TwoContextsOneTarget()
198 TBuf<KTestCaseLength> testCaseNameA;
199 TBuf<KTestCaseLength> testCaseNameB;
200 _LIT(KTestCase, "Context-TwoContextsOneTarget");
201 testCaseNameA.Append(KTestCase);
202 testCaseNameB.Append(KTestCase);
203 testCaseNameA.Append(KContext1);
204 testCaseNameB.Append(KContext2);
206 if(!iRunningOomTests)
208 INFO_PRINTF1(KTestCase);
210 iGdiTarget->Activate(iGc);
212 iGc->SetPenColor(TRgb(255, 0, 0));
213 TEST(iGc->PenColor() == TRgb(255, 0, 0));
214 iGc->DrawEllipse(TRect(0, 0, 60, 60));
215 TESTNOERROR(iGc->GetError());
216 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameA)));
218 iGdiTarget->Activate(iGc2);
221 iGc2->SetPenColor(TRgb(0, 0, 0));
222 TEST(iGc2->PenColor() == TRgb(0, 0, 0));
223 iGc2->DrawEllipse(TRect(0, 0, 30, 30));
224 TESTNOERROR(iGc2->GetError());
225 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameB)));
230 GRAPHICS-DIRECTGDI-CONTEXT-0004
248 Use case - Two contexts and two targets, but there is no sharing
251 Two contexts are created and activated on two different targets. There is no sharing between the contexts and targets, they
252 are completely isolated.
253 Then some draw operations are done.
255 @SYMTestExpectedResults
256 It should be able to draw using the correct context and target.
261 void CTDirectGdiContext::TwoContextsTwoTargets_WithoutSharingL()
263 TBuf<KTestCaseLength> testCaseNameA;
264 TBuf<KTestCaseLength> testCaseNameB;
265 _LIT(KTestCase, "Context-TwoContextsTwoTargets_NotSharing");
266 testCaseNameA.Append(KTestCase);
267 testCaseNameB.Append(KTestCase);
268 if(iCaseNum == ETwoContextsTwoTargets_WithoutSharing_SamePixelType)
270 testCaseNameA.Append(KSamePixelType);
271 testCaseNameB.Append(KSamePixelType);
275 testCaseNameA.Append(KDifferentPixelType);
276 testCaseNameB.Append(KDifferentPixelType);
278 testCaseNameA.Append(KTarget1);
279 testCaseNameB.Append(KTarget2);
281 if(!iRunningOomTests)
283 INFO_PRINTF1(KTestCase);
285 iGdiTarget->Activate(iGc);
287 iGc->SetPenColor(TRgb(255, 0, 0));
288 TEST(iGc->PenColor() == TRgb(255, 0, 0));
289 iGc->DrawEllipse(TRect(0, 0, 60, 60));
290 TESTNOERROR(iGc->GetError());
292 iGdiTarget2->Activate(iGc2);
295 iGc2->SetPenColor(TRgb(0, 255, 0));
296 TEST(iGc2->PenColor() == TRgb(0, 255, 0));
297 iGc2->DrawEllipse(TRect(0, 0, 30, 30));
298 TESTNOERROR(iGc2->GetError());
300 // Draw to both again twice to make sure that context switching works.
301 iGc->DrawEllipse(TRect(0,0,60,60));
302 TESTNOERROR(iGc->GetError());
303 iGc2->DrawEllipse(TRect(0, 0, 30, 30));
304 TESTNOERROR(iGc2->GetError());
306 iGc->DrawEllipse(TRect(0,0,60,60));
307 TESTNOERROR(iGc->GetError());
308 iGc2->DrawEllipse(TRect(0, 0, 30, 30));
309 TESTNOERROR(iGc2->GetError());
310 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameA)));
311 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameB),iGdiTarget2));
316 GRAPHICS-DIRECTGDI-CONTEXT-0005
334 Use case - Draw using two contexts and two targets, swapping the targets over half way through the test.
337 Test that a context can draw to a target that has been previously drawn to using a different context.
338 Two contexts are created and activated on two different targets. Then some draw operations are done,
339 a red circle is drawn on the first target and a black circle is drawn on the second target.
340 Then these contexts are activated on the opposite targets. There is sharing between the contexts
341 and targets (contexts are activated on each other's targets).
342 Then again some draw operations are done, the targets are cleared and a red circle is drawn on each target.
345 @SYMTestExpectedResults
346 It should be able to draw using the correct context and target and context should be able to switch between
348 The target 1 drawn to with context 1 should show a red circle,
349 target 2 drawn to with context2 should show a black circle,
350 target 1 drawn to with context 2 should show a red circle,
351 target 2 drawn to with context 1 should show a red circle.
356 void CTDirectGdiContext::TwoContextsTwoTargets_WithSharingL()
358 TBuf<KTestCaseLength> testCaseNameA;
359 TBuf<KTestCaseLength> testCaseNameB;
360 TBuf<KTestCaseLength> testCaseNameAB;
361 TBuf<KTestCaseLength> testCaseNameBA;
363 _LIT(KTestCase, "Context-TwoContextsTwoTargets_Sharing");
364 testCaseNameA.Append(KTestCase);
365 testCaseNameB.Append(KTestCase);
366 testCaseNameAB.Append(KTestCase);
367 testCaseNameBA.Append(KTestCase);
369 if(iCaseNum == ETwoContextsTwoTargets_WithSharing_SamePixelType)
371 testCaseNameA.Append(KSamePixelType);
372 testCaseNameB.Append(KSamePixelType);
373 testCaseNameAB.Append(KSamePixelType);
374 testCaseNameBA.Append(KSamePixelType);
378 testCaseNameA.Append(KDifferentPixelType);
379 testCaseNameB.Append(KDifferentPixelType);
380 testCaseNameAB.Append(KDifferentPixelType);
381 testCaseNameBA.Append(KDifferentPixelType);
383 testCaseNameA.Append(KContext1);
384 testCaseNameA.Append(KTarget1);
385 testCaseNameB.Append(KContext2);
386 testCaseNameB.Append(KTarget2);
387 testCaseNameAB.Append(KContext1);
388 testCaseNameAB.Append(KTarget2);
389 testCaseNameBA.Append(KContext2);
390 testCaseNameBA.Append(KTarget1);
392 if(!iRunningOomTests)
394 INFO_PRINTF1(KTestCase);
396 iGdiTarget->Activate(iGc);
398 iGc->SetPenColor(TRgb(255, 0, 0));
399 TEST(iGc->PenColor() == TRgb(255, 0, 0));
400 iGc->DrawEllipse(TRect(0, 0, 60, 60));
401 TESTNOERROR(iGc->GetError());
402 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameA)));
404 iGdiTarget2->Activate(iGc2);
407 iGc2->SetPenColor(TRgb(0, 0, 0));
408 TEST(iGc2->PenColor() == TRgb(0, 0, 0));
409 iGc2->DrawEllipse(TRect(0, 0, 30, 30));
410 TESTNOERROR(iGc2->GetError());
411 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameB),iGdiTarget2));
413 iGdiTarget->Activate(iGc2);
414 iGdiTarget2->Activate(iGc);
417 iGc->SetPenColor(TRgb(255, 0, 0));
418 TEST(iGc->PenColor() == TRgb(255, 0, 0));
419 iGc->DrawEllipse(TRect(0, 0, 60, 60));
420 TESTNOERROR(iGc->GetError());
421 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameAB),iGdiTarget2));
425 iGc2->SetPenColor(TRgb(255, 0, 0));
426 TEST(iGc->PenColor() == TRgb(255, 0, 0));
427 iGc2->DrawEllipse(TRect(0, 0, 60, 60));
428 TESTNOERROR(iGc2->GetError());
429 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameBA)));
434 GRAPHICS-DIRECTGDI-CONTEXT-0006
452 Use case - Single context and single target, but calling activate twice.
455 Single context is created and activated twice on the same target, just to prove that there is no affect of calling
456 Activate() twice on the same target by the same context, in succession.
458 @SYMTestExpectedResults
459 It should be able to draw using the correct context and target.
464 void CTDirectGdiContext::OneContextOneTarget_TwiceActivateL()
466 _LIT(KTestName, "Context-OneContextOneTargetTwiceActivate");
467 if(!iRunningOomTests)
469 INFO_PRINTF1(KTestName);
471 _LIT(KTestNameA, "Context-OneContextOneTarget_TwiceActivateA");
472 _LIT(KTestNameB, "Context-OneContextOneTarget_TwiceActivateB");
474 iGc->SetPenColor(TRgb(255, 0, 0));
475 TEST(iGc->PenColor() == TRgb(255, 0, 0));
476 iGc->DrawEllipse(TRect(0, 0, 60, 60));
477 TESTNOERROR(iGc->GetError());
478 TEST(KErrNone == WriteTargetOutput(iTestParams, TPtrC(KTestNameA)));
480 iGdiTarget->Activate(iGc);
483 iGc->SetPenColor(TRgb(0, 0, 255));
484 TEST(iGc->PenColor() == TRgb(0, 0, 255));
485 iGc->DrawEllipse(TRect(0, 0, 60, 60));
486 TESTNOERROR(iGc->GetError());
487 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(KTestNameB)));
490 LOCAL_C void ContextReset(TAny* aPtr)
492 CTContextBase* gc = reinterpret_cast <CTContextBase*> (aPtr);
498 GRAPHICS-DIRECTGDI-CONTEXT-0007
519 Externalize and internalize a context.
522 Test the use case where we:
523 Create a new GC for the purpose of the test.
524 Set Pen and Brush colour non-default colours.
525 Set the Pen and Brush styles to non-default styles.
526 Set the clipping regions.
527 Set a font (DirectGdi only, BitGdi causes the font to be cached and UHEAP failures occur).
528 Set the origin and the internal drawing position to non-defaults.
530 Reset the context, and set the state to other values.
532 Draw a line from the current internal drawing position.
533 Draw a rectangle using current pen and brush styles/colours/size.
534 Destroy the temporary GC and reinstate the original.
539 void CTDirectGdiContext::ExternalizeInternalizeTestL()
542 _LIT(KTestName, "Context-ExternalizeInternalize");
543 if(!iRunningOomTests)
545 INFO_PRINTF1(KTestName);
547 const TInt width = iGdiTarget->SizeInPixels().iWidth;
548 const TInt height = iGdiTarget->SizeInPixels().iHeight;
550 // For this test, create a temporary GC which we can delete later.
551 // This is to avoid UHEAP mismatches if we used the original iGc.
552 // Set this to be iGc for this test.
553 CTContextBase *oldGc = iGc;
555 CleanupStack::PushL(oldGc);
556 TESTNOERRORL(iGdiTarget->CreateContext(iGc));
559 // Create some clipping regions. These should not be externalised/internalised.
560 RRegion clippingRegion(2);
561 clippingRegion.AddRect(TRect(width*3/10,0,width*7/10,height));
562 clippingRegion.AddRect(TRect(0,height*3/10,width,height*7/10));
563 CleanupClosePushL(clippingRegion);
564 iGc->SetClippingRegion(clippingRegion);
565 CleanupStack::PushL(TCleanupItem(ContextReset, iGc));
567 // Create a bitmap to use as a brush pattern
568 CFbsBitmap* pattern = CreateCheckedBoardBitmapL(iTestParams.iTargetPixelFormat, TSize(100,100));
569 CleanupStack::PushL(pattern);
571 // Set non-default state.
572 iGc->SetOrigin(TPoint(10,10));
573 iGc->SetPenSize(TSize(3,3));
574 iGc->SetPenColor(TRgb(255,0,255));
575 iGc->SetPenStyle(DirectGdi::EDashedPen);
576 iGc->SetBrushColor(TRgb(0,255,0));
577 iGc->SetBrushPattern(*pattern);
578 iGc->SetBrushStyle(DirectGdi::EPatternedBrush);
579 iGc->SetBrushOrigin(TPoint(3, 3));
580 iGc->MoveTo(TPoint(10, height/2));
581 iGc->SetDrawMode(DirectGdi::EDrawModePEN);
585 // Internalizing/externalizing a font in BitGdi will cause the font to be cached and
586 // memory UHEAP mismatch occurs, so only do it for DirectGdi. We wont draw any text in the image.
587 TESTL(iFont != NULL);
591 // create buffer for save/restore
592 CBufFlat* buf = NULL;
593 TRAPD(err, buf=CBufFlat::NewL(512));
596 iGc->ResetClippingRegion();
597 User::LeaveIfError(err);
599 CleanupStack::PushL(buf);
601 // save and then restore
602 RBufWriteStream ws(*buf,0);
603 iGc->ExternalizeL(ws);
606 // Make some modifications to iGc.
607 // The clipping regions should be persistant even after the Internalize().
609 iGc->ResetClippingRegion();
611 iGc->SetPenColor(TRgb(0,0,0));
612 RRegion tempClippingRegion(1);
613 tempClippingRegion.AddRect(TRect(width/10, height/10, width*9/10, height*9/10));
614 iGc->SetClippingRegion(tempClippingRegion);
615 CleanupClosePushL(tempClippingRegion);
617 // Internalise the state.
618 RBufReadStream rs(*buf,0);
619 iGc->InternalizeL(rs);
622 // Draw using the newly internalised context.
623 // We don't draw any text as we don't internalize/externalize text for BitGdi.
625 iGc->DrawRect(TRect(width/4, height/4, width*3/4, height*3/4));
626 iGc->DrawLineTo(TPoint(width, height/2));
627 TESTNOERROR(iGc->GetError());
628 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(KTestName)));
630 CleanupStack::PopAndDestroy(5);
631 CleanupStack::Pop(1, oldGc);
633 // Destroy the temporary Gc and reinstate the original one.
634 iGdiTarget->Activate(oldGc);
642 GRAPHICS-DIRECTGDI-CONTEXT-0008
660 Use case - two contexts and one target.
663 Two contexts are created and activated on the same target.
664 Then some draw operations are done.
665 CopySettings() is called to copy settings from first context to the second one.
666 Then again some draw operations are done to verify that settings have been copied properly.
668 @SYMTestExpectedResults
669 It should be able to draw using the correct settings of context and target.
674 void CTDirectGdiContext::TestCopySettings()
676 TBuf<KTestCaseLength> testCaseNameA;
677 TBuf<KTestCaseLength> testCaseNameB;
678 _LIT(KTestCase, "Context-CopySettings");
679 if(!iRunningOomTests)
681 INFO_PRINTF1(KTestCase);
683 testCaseNameA.Append(KTestCase);
684 testCaseNameB.Append(KTestCase);
685 testCaseNameA.Append(KContext1);
686 testCaseNameB.Append(KContext2);
688 // Draw to the first graphics context
689 iGdiTarget->Activate(iGc);
691 iGc->SetPenColor(KRgbRed);
692 iGc->SetPenSize(TSize(3,3));
693 iGc->SetBrushColor(KRgbYellow);
694 iGc->SetBrushStyle(DirectGdi::ESolidBrush);
695 iGc->SetTextShadowColor(KRgbGreen);
696 TEST(iGc->PenColor() == KRgbRed);
699 iGc->DrawEllipse(TRect(5, 5, 50, 50));
701 iGc->SetStrikethroughStyle(DirectGdi::EStrikethroughOn);
702 iGc->SetCharJustification(10, 10);
703 iGc->SetWordJustification(20, 20);
704 iGc->DrawText(KAbcd, NULL, TPoint(10, 100));
705 TESTNOERROR(iGc->GetError());
706 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameA)));
708 // Activate the second context and reset the context settings
709 iGdiTarget->Activate(iGc2);
712 TEST(iGc2->PenColor() == TRgb(0, 0, 0));
713 // Copy the settings from the first context to the second one
714 iGc2->CopySettings(*iGc);
715 TEST(iGc2->PenColor() == TRgb(255, 0, 0));
717 // Do some drawing, the ellipse is drawn deliberately smaller this time,
718 // the text should look the same as before
719 iGc2->DrawEllipse(TRect(0, 0, 30, 30));
720 iGc->DrawText(KAbcd, NULL, TPoint(10, 100));
721 TESTNOERROR(iGc2->GetError());
722 TESTNOERROR(WriteTargetOutput(iTestParams, TPtrC(testCaseNameB)));
724 // Test that the settings from iGc have been copied to iGc2
725 TEST(iGc->PenColor() == iGc2->PenColor());
726 TEST(iGc->BrushColor() == iGc2->BrushColor());
727 TEST(iGc->TextShadowColor() == iGc2->TextShadowColor());
732 // Force a cleanup of the pen array when testing the SW version of DirectGdi,
733 // if this is not done the OOM tests fail when running this test.
734 iGc->SetPenSize(TSize(1,1));
735 iGc2->SetPenSize(TSize(1,1));
739 Override of base class pure virtual
740 Our implementation only gets called if the base class doTestStepPreambleL() did
741 not leave. That being the case, the current test result value will be EPass.
742 @leave Gets system wide error code
743 @return TVerdict code
745 TVerdict CTDirectGdiContext::doTestStepL()
747 // Test for each pixel format
748 for(TInt targetPixelFormatIndex = iTargetPixelFormatArray.Count() - 1; targetPixelFormatIndex >= 0 ; targetPixelFormatIndex--)
750 iTestParams.iTargetPixelFormat = iTargetPixelFormatArray[targetPixelFormatIndex];
751 for(iCaseNum = EOneContextOneTarget; iCaseNum < ELast; ++iCaseNum)
753 SetTargetL(iTestParams.iTargetPixelFormat, static_cast<TContextTestCase>(iCaseNum));
755 // Create fonts outside of the OOM tests to avoid cached fonts being included
757 User::LeaveIfNull(iFont);
760 // only run OOM tests for one target pixel format to prevent duplication of tests
761 if (targetPixelFormatIndex == 0)
763 RunOomTestsL(); //from base class
772 CloseTMSGraphicsStep();
773 return TestStepResult();
777 Override of base class virtual
778 @leave Gets system wide error code
779 @return - TVerdict code
781 TVerdict CTDirectGdiContext::doTestStepPreambleL()
783 CTDirectGdiStepBase::doTestStepPreambleL();
784 return TestStepResult();
788 Override of base class pure virtual
789 Lists the tests to be run
791 void CTDirectGdiContext::RunTestsL()
793 SetTestStepID(KUnknownSYMTestCaseIDName);
796 case EOneContextOneTarget:
797 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0001"));
798 OneContextOneTarget();
799 if (!iRunningOomTests)
802 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0007"));
803 ExternalizeInternalizeTestL();
806 case EOneContextTwoTargets_SamePixelType:
807 case EOneContextTwoTargets_DifferentPixelType:
808 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0002"));
809 OneContextTwoTargets();
811 case ETwoContextsOneTarget:
812 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0003"));
813 TwoContextsOneTarget();
815 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0008"));
818 case ETwoContextsTwoTargets_WithoutSharing_SamePixelType:
819 case ETwoContextsTwoTargets_WithoutSharing_DifferentPixelType:
820 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0004"));
821 TwoContextsTwoTargets_WithoutSharingL();
823 case ETwoContextsTwoTargets_WithSharing_SamePixelType:
824 case ETwoContextsTwoTargets_WithSharing_DifferentPixelType:
825 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0005"));
826 TwoContextsTwoTargets_WithSharingL();
828 case EOneContextOneTarget_TwiceActivate:
829 SetTestStepID(_L("GRAPHICS-DIRECTGDI-CONTEXT-0006"));
830 OneContextOneTarget_TwiceActivateL();