graphicsapitest/graphicssvs/wserv/scripts/GRAPHICS-WSERV-BackedUpWindow-PublicApi.script
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 //
       
     2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 //! @file
       
    17 //! @SYMTestSuiteName		GRAPHICS-WSERV-BackedUpWindow-PublicApi
       
    18 //! @SYMScriptTestEnvironment	This test script requires a basic ROM.
       
    19 
       
    20 ///////////////////////////////////////////////////////////////////////////////
       
    21 // GRAPHICS-WSERV-BackedUpWindow-PublicApi.script
       
    22 //
       
    23 // Tests all public elements of the RBackedUpWindow class
       
    24 // as a means of confidence that the API works as expected.
       
    25 //
       
    26 // The purpose is to provide a regression test suite of PublishedAll APIs for
       
    27 // RBackedUpWindow related classes.
       
    28 // Negative testing is performed to confirm that correct errors are returned
       
    29 // when incorrect parameters are given.
       
    30 //
       
    31 // The tests are fully automated.
       
    32 ///////////////////////////////////////////////////////////////////////////////
       
    33 
       
    34 
       
    35 LOAD_SUITE	T_GraphicsWservAPI
       
    36 
       
    37 
       
    38 // ****************************************************************************
       
    39 // RBackedUpWindow
       
    40 // ****************************************************************************
       
    41 
       
    42 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0001
       
    43 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0001
       
    44 //! @SYMAPI			RBackedUpWindow
       
    45 //! @SYMAuthor			Victor Liu
       
    46 //! @SYMCreationDate		01/03/2007
       
    47 //! @SYMTestCaseDesc		RBackedUpWindow(): create a RBackedUpWindow object by C++ defaut constructor
       
    48 //!				Uses API elements: RBackedUpWindow()
       
    49 //! @SYMTestActions		simply execute new() a RBackedUpWindow to create the object
       
    50 //! @SYMTestStatus		Implemented
       
    51 //! @SYMTestPriority		Low
       
    52 //! @SYMTestExpectedResults	RBackedUpWindow object was created without causing panic
       
    53 //! @SYMTestType		CIT
       
    54 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
    55 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
    56 		COMMAND		backupwin	new
       
    57 	END_TEST_BLOCK
       
    58 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0001
       
    59 
       
    60 
       
    61 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0002
       
    62 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0002
       
    63 //! @SYMAPI			RBackedUpWindow
       
    64 //! @SYMAuthor			Victor Liu
       
    65 //! @SYMCreationDate		01/03/2007
       
    66 //! @SYMTestCaseDesc		RBackedUpWindow(RWsSession &aWs): create a RBackedUpWindow object within the specified RWsSession
       
    67 //!				Uses API elements: RWsSession::Connect, RBackedUpWindow()
       
    68 //! @SYMTestActions		1.	Create and connect a RWsSession
       
    69 //!				2.	Create a RBackedUpWindow within the RWsSession
       
    70 //! @SYMTestStatus		Implemented
       
    71 //! @SYMTestPriority		Critical
       
    72 //! @SYMTestExpectedResults	RBackedUpWindow object was created without causing panic
       
    73 //! @SYMTestType		CIT
       
    74 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
    75 		CREATE_OBJECT	RWsSession	ws
       
    76 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
    77 		COMMAND		ws		new
       
    78 		COMMAND		ws		Connect
       
    79 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0002-0001-new_command04
       
    80 		COMMAND		ws		Close
       
    81 	END_TEST_BLOCK
       
    82 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0002
       
    83 
       
    84 
       
    85 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003
       
    86 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003
       
    87 //! @SYMAPI			RBackedUpWindow
       
    88 //! @SYMAuthor			Victor Liu
       
    89 //! @SYMCreationDate		01/03/2007
       
    90 //! @SYMTestCaseDesc		Construct(const RWindowTreeNode &parent, TDisplayMode aDisplayMode, TUint32 aHandle): complete construction of a valid RBackedUpWindow handle
       
    91 //!				Uses API elements: RWsSession::Connect, RWindowGroup::Construct, RBackedUpWindow::Construct, MWsClientClass::WsHandle, RWindowBase::AbsPosition & DisplayMode & Size
       
    92 //! @SYMTestActions		1.	Create and connect a RWsSession, and within the RWsSession
       
    93 //!				2.	Create and construct a RWindowGroup (as the parent of RBackedUpWindow to be constructed)
       
    94 //!				3.	Create and construct() the RBackedUpWindow as the child of the RWindowGroup
       
    95 //!				4.	Check if the initial position and size of the RBackedUpWindow as expected
       
    96 //! @SYMTestStatus		Implemented
       
    97 //! @SYMTestPriority		Critical
       
    98 //! @SYMTestExpectedResults	1.	Construct() method returns KErrNone without causing panic
       
    99 //!				2.	Check the WsHandle of RBackedUpWindow: equal to 0 before constructed, non-zero value after constructed
       
   100 //!				3.	Check the initial value of RBackedUpWindow: position (0,0) and size (width=0 and height=0), and default display mode
       
   101 //! @SYMTestType		CIT
       
   102 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   103 		CREATE_OBJECT	RWsSession	ws
       
   104 		CREATE_OBJECT	RWindowGroup	wingrp
       
   105 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   106 		COMMAND		ws		new
       
   107 		COMMAND		ws		Connect
       
   108 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-new_command04
       
   109 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-Construct_command05
       
   110 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-new_command07
       
   111 		COMMAND		backupwin	WsHandle		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-WsHandle_command08
       
   112 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-Construct_command09
       
   113 		COMMAND		backupwin	WsHandle		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-WsHandle_command10
       
   114 		COMMAND		backupwin	DisplayMode		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-DisplayMode_command11
       
   115 		COMMAND		backupwin	AbsPosition		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-AbsPosition_command12
       
   116 		COMMAND		backupwin	Size			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003-0001-Size_command13
       
   117 		COMMAND		backupwin	Close
       
   118 		COMMAND		wingrp		Close
       
   119 		COMMAND		ws		Close
       
   120 	END_TEST_BLOCK
       
   121 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0003
       
   122 
       
   123 
       
   124 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004
       
   125 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004
       
   126 //! @SYMAPI			RBackedUpWindow
       
   127 //! @SYMAuthor			Victor Liu
       
   128 //! @SYMCreationDate		05/03/2007
       
   129 //! @SYMTestCaseDesc		BitmapHandle():
       
   130 //!				Uses API elements: RWsSession::Connect, RWindowGroup::Construct, RBackedUpWindow::Construct, RWindowBase::SetSizeErr, CFbsBitmap::Duplicate & SizeInPixels & GetPixel
       
   131 //! @SYMTestActions		1.	Create and connect a RWsSession, and within the RWsSession
       
   132 //!				2.	Create and construct a RWindowGroup (as the parent of RBackedUpWindow to be constructed)
       
   133 //!				3.	Create and construct() the RBackedUpWindow as the child of the RWindowGroup
       
   134 //!				4.	Execute BitmapHandle, check and duplicate the returned bitmap handle
       
   135 //!				5.	Check the bitmap size and display mode: should be the same as the initial of RBackedUpWindow
       
   136 //!				6.	Use RWindowBase::SetSizeErr to change the size of the RBackedUpWindow
       
   137 //!				7.	Check the duplicated bitmap size and the color of pixels inside
       
   138 //!				8.	Destruct and close all objects used
       
   139 //! @SYMTestStatus		Implemented
       
   140 //! @SYMTestPriority		Critical
       
   141 //! @SYMTestExpectedResults	1.	BitmapHandle() method calls without causing panic, and returns non-zero handle id
       
   142 //!				2.	Check the duplicate bitmap of the returned handle
       
   143 //!					2.1	the bitmap size should be the same as the RBackedUpWindow size: size (width=0 and height=0), display mode as specified (EColor4K)
       
   144 //!					2.2	if change the initial size of RBackedUpWindow, the bitmap size reflects the changed window size
       
   145 //!					2.3	inside the bitmap, all pixels are the initial color: TRgb(255,255,255)
       
   146 //!						only check samples pixels: (10,10), (50,50), (60,60), (70,70)
       
   147 //! @SYMTestType		CIT
       
   148 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   149 		CREATE_OBJECT	RWsSession	ws
       
   150 		CREATE_OBJECT	RWindowGroup	wingrp
       
   151 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   152 		CREATE_OBJECT	CFbsBitmap	fbsbmp
       
   153 		COMMAND		ws		new
       
   154 		COMMAND		ws		Connect
       
   155 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-new_command04
       
   156 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-Construct_command05
       
   157 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-new_command07
       
   158 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-Construct_command08
       
   159 		COMMAND		backupwin	MaintainBackup
       
   160 		COMMAND		backupwin	BitmapHandle
       
   161 		COMMAND		fbsbmp		new
       
   162 		COMMAND		fbsbmp		Duplicate		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-Duplicate_command11
       
   163 		COMMAND		fbsbmp		SizeInPixels		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-SizeInPixels_command12
       
   164 		COMMAND		fbsbmp		DisplayMode		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-DisplayMode_command13
       
   165 		COMMAND		backupwin	SetSizeErr		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-SetSizeErr_command15
       
   166 		COMMAND		fbsbmp		SizeInPixels		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-SizeInPixels_command17
       
   167 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-GetPixel_command18
       
   168 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-GetPixel_command19
       
   169 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-GetPixel_command20
       
   170 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004-0001-GetPixel_command21
       
   171 		COMMAND		fbsbmp		~
       
   172 		COMMAND		backupwin	Close
       
   173 		COMMAND		wingrp		Close
       
   174 		COMMAND		ws		Close
       
   175 	END_TEST_BLOCK
       
   176 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0004
       
   177 
       
   178 
       
   179 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005
       
   180 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005
       
   181 //! @SYMAPI			RBackedUpWindow
       
   182 //! @SYMAuthor			Victor Liu
       
   183 //! @SYMCreationDate		07/03/2007
       
   184 //! @SYMTestCaseDesc		UpdateScreen(): copy the backup bitmap's image to the on-screen bitmap
       
   185 //!				Uses API elements: RWsSession::Connect & SetAutoFlush, RWindowGroup::Construct, CWsScreenDevice::Construct & CreateContext, CWindowGc::Activate & SetBrushColor & ESolidBrush
       
   186 //!				RBackedUpWindow::Construct & BitmapHandle, RWindowBase::SetSizeErr & Activte, TBitmapUtil::Begin & End & SetPixel & SetPos
       
   187 //! @SYMTestActions		1.	Create and initiate an active RBackedUpWindow
       
   188 //!					1.1	Create a RWsSession, RWindowGroup, CWsScreenDevice and CWindowGc
       
   189 //!					1.2	Create and construct a RBackedUpWindow, with size width 80 and height 80, and activated
       
   190 //!					1.3	SetAutoFlush=TRUE for the RWsSession, and Activate the CWindowGc for the RBackedUpWindow
       
   191 //!						SetBrushColor to TRgb(255,0,0), SetBrushStyle=ESolidBrush
       
   192 //!				2.	Execute MaintainBackup to tell WSERV to maintain the backup bitmap
       
   193 //!				3.	Call BitmapHandle to get the backup bitmap handle, then duplicate the bitmap
       
   194 //!				4.	New a TBitmapUtil to work on the duplicate backup bitmap
       
   195 //!				5.	Use TBitmapUtil fuctions to change the color of pixels on the backup bitmap
       
   196 //!				6.	Check the drawing of the RBackedUpWindow: should be the initial color
       
   197 //!				7.	Execute UpdateScreen to copy backup bitmap to the screen
       
   198 //!				8.	Check the drawing of the RBackedUpWindow: should reflect the change of backup bitmap
       
   199 //!				9.	Destruct and close all objects used
       
   200 //! @SYMTestStatus		Implemented
       
   201 //! @SYMTestPriority		Critical
       
   202 //! @SYMTestExpectedResults	1.	UpdateScreen() method calls without causing panic
       
   203 //!				2.	Check the drawing of the RBackedUpWindow
       
   204 //!					2.1	before UpdateScreen executed, RBackedUpWindow keeps initial color TRgb(255,255,255)
       
   205 //!					2.2	after UpdateScreen executed, RBackedUpWindow reflect the change of backup bitmap
       
   206 //!						(10,10) is TRgb(0,0,255), (10,12) is TRgb(0,255,0), (12,10) is TRgb(255,0,0), (12,12) is TRgb(0,255,255)
       
   207 //! @SYMTestType		CIT
       
   208 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   209 		CREATE_OBJECT	RWsSession	ws
       
   210 		CREATE_OBJECT	CWsScreenDevice	scrdev
       
   211 		CREATE_OBJECT	CWindowGc	wingc
       
   212 		CREATE_OBJECT	RWindowGroup	wingrp
       
   213 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   214 		COMMAND		ws		new
       
   215 		COMMAND		ws		Connect
       
   216 		COMMAND		scrdev		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command04
       
   217 		COMMAND		scrdev		Construct
       
   218 		COMMAND		scrdev		CreateContext		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-CreateContext_command06
       
   219 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   220 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   221 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   222 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   223 		COMMAND		backupwin	SetExtentErr		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetExtentErr_command13
       
   224 		COMMAND		backupwin	Activate
       
   225 		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetAutoFlush_command16
       
   226 		COMMAND		wingc		Activate		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Activate_command18
       
   227 		COMMAND		wingc		SetBrushColor		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushColor_command19
       
   228 		COMMAND		wingc		SetBrushStyle		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushStyle_command20
       
   229 
       
   230 		CREATE_OBJECT	CFbsBitmap	fbsbmp
       
   231 		CREATE_OBJECT	TBitmapUtil	bmputil
       
   232 		COMMAND		backupwin	MaintainBackup
       
   233 		COMMAND		backupwin	BitmapHandle
       
   234 		COMMAND		fbsbmp		new
       
   235 		COMMAND		fbsbmp		Duplicate		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-Duplicate_command03
       
   236 		COMMAND		bmputil		new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-New_command04
       
   237 		COMMAND		bmputil		Begin			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-Begin_command05
       
   238 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPixel_command06
       
   239 		COMMAND		bmputil		SetPos			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPos_command07
       
   240 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPixel_command08
       
   241 		COMMAND		bmputil		SetPos			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPos_command09
       
   242 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPixel_command10
       
   243 		COMMAND		bmputil		SetPos			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPos_command11
       
   244 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-SetPixel_command12
       
   245 		COMMAND		bmputil		End
       
   246 		COMMAND		scrdev		checkPixels		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005-0001-checkPixels_command15
       
   247 		COMMAND		backupwin	UpdateScreen
       
   248 
       
   249 		COMMAND		fbsbmp		~
       
   250 		COMMAND		wingc		Deactivate
       
   251 		COMMAND		backupwin	Close
       
   252 		COMMAND		wingrp		Close
       
   253 		COMMAND		wingc		~
       
   254 		COMMAND		scrdev		~
       
   255 		COMMAND		ws		Close
       
   256 	END_TEST_BLOCK
       
   257 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0005
       
   258 
       
   259 
       
   260 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006
       
   261 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006
       
   262 //! @SYMAPI			RBackedUpWindow
       
   263 //! @SYMAuthor			Victor Liu
       
   264 //! @SYMCreationDate		07/03/2007
       
   265 //! @SYMTestCaseDesc		UpdateScreen(const TRegion &aRegion): copy a part of the backup bitmap to the on-screen bitmap
       
   266 //!				Uses API elements: RWsSession::Connect & SetAutoFlush, RWindowGroup::Construct, CWsScreenDevice::Construct & CreateContext, CWindowGc::Activate & SetBrushColor & ESolidBrush
       
   267 //!				RBackedUpWindow::Construct & BitmapHandle, RWindowBase::SetSizeErr & Activte, TBitmapUtil::Begin & End & SetPixel & SetPos
       
   268 //! @SYMTestActions		1.	Create and initiate an active RBackedUpWindow
       
   269 //!					1.1     Create a RWsSession, RWindowGroup, CWsScreenDevice and CWindowGc
       
   270 //!					1.2     Create and construct a RBackedUpWindow, with size width 80 and height 80, and activated
       
   271 //!					1.3     SetAutoFlush=TRUE for the RWsSession, and Activate the CWindowGc for the RBackedUpWindow
       
   272 //!					        SetBrushColor to TRgb(255,0,0), SetBrushStyle=ESolidBrush
       
   273 //!				2.	Execute MaintainBackup to tell WSERV to maintain the backup bitmap
       
   274 //!				3.	Call BitmapHandle to get the backup bitmap handle, then duplicate the bitmap
       
   275 //!				4.	New a TBitmapUtil to work on the duplicate backup bitmap
       
   276 //!				5.	Use TBitmapUtil fuctions to change the color of pixels on the backup bitmap
       
   277 //!				6.	Check the drawing of the RBackedUpWindow: should be the initial color
       
   278 //!				7.	Execute UpdateScreen with region specified
       
   279 //!				8.	Check the drawing of the RBackedUpWindow: only the specified region reflect the change of backup bitmap
       
   280 //!				9.	Destruct and close all objects used
       
   281 //! @SYMTestStatus		Implemented
       
   282 //! @SYMTestPriority		Critical
       
   283 //! @SYMTestExpectedResults	1.	UpdateScreen() method calls without causing panic
       
   284 //!				2.	Check the drawing of the RBackedUpWindow, with specified region ((0,0),(11,11)), ((11,11),(20,20))
       
   285 //!					2.1	before UpdateScreen executed, RBackedUpWindow keeps initial color TRgb(255,255,255)
       
   286 //!					2.2	after UpdateScreen executed, only the specified region of RBackedUpWindow reflect the change of backup bitmap
       
   287 //!						inside the region: (10,10) is TRgb(0,0,255), (12,12) is TRgb(0,255,255)
       
   288 //!						outside the region: (10,12) is TRgb(255,255,255), (12,10) is TRgb(255,255,255)
       
   289 //! @SYMTestType		CIT
       
   290 	START_TEST_BLOCK	10	T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   291 		CREATE_OBJECT	RWsSession	ws
       
   292 		CREATE_OBJECT	CWsScreenDevice	scrdev
       
   293 		CREATE_OBJECT	CWindowGc	wingc
       
   294 		CREATE_OBJECT	RWindowGroup	wingrp
       
   295 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   296 		COMMAND		ws		new
       
   297 		COMMAND		ws		Connect
       
   298 		COMMAND		scrdev		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command04
       
   299 		COMMAND		scrdev		Construct
       
   300 		COMMAND		scrdev		CreateContext		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-CreateContext_command06
       
   301 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   302 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   303 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   304 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   305 		COMMAND		backupwin	SetExtentErr		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetExtentErr_command13
       
   306 		COMMAND		backupwin	Activate
       
   307 		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetAutoFlush_command16
       
   308 		COMMAND		wingc		Activate		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Activate_command18
       
   309 		COMMAND		wingc		SetBrushColor		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushColor_command19
       
   310 		COMMAND		wingc		SetBrushStyle		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushStyle_command20
       
   311 
       
   312 		CREATE_OBJECT	CFbsBitmap	fbsbmp
       
   313 		CREATE_OBJECT	TBitmapUtil	bmputil
       
   314 		COMMAND		backupwin	MaintainBackup
       
   315 		COMMAND		backupwin	BitmapHandle
       
   316 		COMMAND		fbsbmp		new
       
   317 		COMMAND		fbsbmp		Duplicate		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-Duplicate_command03
       
   318 		COMMAND		bmputil		new			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-New_command04
       
   319 		COMMAND		bmputil		Begin			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-Begin_command05
       
   320 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPixel_command06
       
   321 		COMMAND		bmputil		SetPos			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPos_command07
       
   322 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPixel_command08
       
   323 		COMMAND		bmputil		SetPos			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPos_command09
       
   324 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPixel_command10
       
   325 		COMMAND		bmputil		SetPos			GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPos_command11
       
   326 		COMMAND		bmputil		SetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-SetPixel_command12
       
   327 		COMMAND		bmputil		End
       
   328 		COMMAND		scrdev		checkPixels		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-checkPixels_command15
       
   329 		COMMAND		backupwin	UpdateScreen		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006-0001-UpdateScreen_command17
       
   330 
       
   331 		COMMAND		fbsbmp		~
       
   332 		COMMAND		wingc		Deactivate
       
   333 		COMMAND		backupwin	Close
       
   334 		COMMAND		wingrp		Close
       
   335 		COMMAND		wingc		~
       
   336 		COMMAND		scrdev		~
       
   337 		COMMAND		ws		Close
       
   338 	END_TEST_BLOCK
       
   339 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0006
       
   340 
       
   341 
       
   342 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007
       
   343 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007
       
   344 //! @SYMAPI			RBackedUpWindow
       
   345 //! @SYMAuthor			Victor Liu
       
   346 //! @SYMCreationDate		08/03/2007
       
   347 //! @SYMTestCaseDesc		UpdateBackupBitmap(): copy to the backup bitmap any areas of the window which are not currently stored in the bitmap
       
   348 //!				Uses API elements: RWsSession::Connect & SetAutoFlush, RWindowGroup::Construct, CWsScreenDevice::Construct & CreateContext, CWindowGc::Activate & SetBrushColor & ESolidBrush & DrawRect
       
   349 //!				RBackedUpWindow::Construct & BitmapHandle, RWindowBase::SetSizeErr & Activte
       
   350 //! @SYMTestActions		1.	Create and initiate an active RBackedUpWindow
       
   351 //!					1.1	Create a RWsSession, RWindowGroup, CWsScreenDevice and CWindowGc
       
   352 //!					1.2	Create and construct a RBackedUpWindow, with size width 80 and height 80, and activated
       
   353 //!					1.3	SetAutoFlush=TRUE for the RWsSession, and Activate the CWindowGc for the RBackedUpWindow
       
   354 //!						SetBrushColor to TRgb(255,0,0), SetBrushStyle=ESolidBrush
       
   355 //!				2.	Call BitmapHandle to get the backup bitmap handle, then duplicate the bitmap
       
   356 //!				3.	Call CWindowGc::DrawRect ((0,0),(55,55)) to draw on the RBackedUpWindow
       
   357 //!				4.	Check the inital color of the bitmap: all pixels are initial TRgb(255,255,255)
       
   358 //!				5.	Execute UpdateBackupBitmap, the backup bitmap should reflect the drawing of test action 3
       
   359 //!				6.	Call CWindowGc::DrawRect ((50,50),(65,65)) to draw on the RBackedUpWindow
       
   360 //!				7.	Check the backup bitmap: the drawing of test action 6 is not reflected
       
   361 //!				8.	Execute UpdateBackupBitmap, the backup bitmap should reflect the drawing of test action 6
       
   362 //!				9.	Destruct and close all objects used
       
   363 //! @SYMTestStatus		Implemented
       
   364 //! @SYMTestPriority		Critical
       
   365 //! @SYMTestExpectedResults	1.	UpdateBackupBitmap() method calls without causing panic
       
   366 //!				2.	The backup bitmap should reflect the content of the RBackedUpWindow after calling UpdateBackupBitmap
       
   367 //!					only check sample pixels of (0,0), (50,50), (60,60), (70,70)
       
   368 //!					2.1	before test action 5, all pixels keep initially TRgb(255,255,255)
       
   369 //!					2.2	before test action 8, the backup bitmap reflects the drawing of test action 3
       
   370 //!						2.2.1	on the rectangle border is drawn with pen color TRgb(0,0,0): (0,0)
       
   371 //!						2.2.2	inside the rectangle is drawn with brush color TRgb(255,0,0): (50,50)
       
   372 //!						2.2.3	outside the rectangle border keeps the default TRgb(255,255,255): (60,60), (70,70)
       
   373 //!					2.3	after test action 8, the backup bitmap reflects the drawing of test action 3 + 6 (2nd drawing overwrites the 1st one)
       
   374 //!						2.3.1	on the rectangle border is drawn with pen color TRgb(0,0,0): (0,0), (50,50)
       
   375 //!						2.3.2	inside the rectangle is drawn with brush color TRgb(255,0,0): (60,60)
       
   376 //!						2.3.3	outside the rectangle border keeps the default TRgb(255,255,255): (70,70)
       
   377 //! @SYMTestType		CIT
       
   378 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   379 		CREATE_OBJECT	RWsSession	ws
       
   380 		CREATE_OBJECT	CWsScreenDevice	scrdev
       
   381 		CREATE_OBJECT	CWindowGc	wingc
       
   382 		CREATE_OBJECT	RWindowGroup	wingrp
       
   383 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   384 		COMMAND		ws		new
       
   385 		COMMAND		ws		Connect
       
   386 		COMMAND		scrdev		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command04
       
   387 		COMMAND		scrdev		Construct
       
   388 		COMMAND		scrdev		CreateContext		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-CreateContext_command06
       
   389 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   390 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   391 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   392 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   393 		COMMAND		backupwin	SetExtentErr		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetExtentErr_command13
       
   394 		COMMAND		backupwin	Activate
       
   395 		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetAutoFlush_command16
       
   396 		COMMAND		wingc		Activate		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Activate_command18
       
   397 		COMMAND		wingc		SetBrushColor		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushColor_command19
       
   398 		COMMAND		wingc		SetBrushStyle		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushStyle_command20
       
   399 
       
   400 		CREATE_OBJECT	CFbsBitmap	fbsbmp
       
   401 		COMMAND		backupwin	BitmapHandle
       
   402 		COMMAND		fbsbmp		new
       
   403 		COMMAND		fbsbmp		Duplicate		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-Duplicate_command03
       
   404 		COMMAND		wingc		DrawRect		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-DrawRect_command04
       
   405 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command06
       
   406 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command07
       
   407 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command08
       
   408 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command09
       
   409 		COMMAND		backupwin	UpdateBackupBitmap
       
   410 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command13
       
   411 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command14
       
   412 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command15
       
   413 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command16
       
   414 		COMMAND		wingc		DrawRect		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-DrawRect_command18
       
   415 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command20
       
   416 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command21
       
   417 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command22
       
   418 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command23
       
   419 		COMMAND		backupwin	UpdateBackupBitmap
       
   420 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command27
       
   421 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command28
       
   422 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command29
       
   423 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007-0001-GetPixel_command30
       
   424 
       
   425 		COMMAND		fbsbmp		~
       
   426 		COMMAND		wingc		Deactivate
       
   427 		COMMAND		backupwin	Close
       
   428 		COMMAND		wingrp		Close
       
   429 		COMMAND		wingc		~
       
   430 		COMMAND		scrdev		~
       
   431 		COMMAND		ws		Close
       
   432 	END_TEST_BLOCK
       
   433 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0007
       
   434 
       
   435 
       
   436 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008
       
   437 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008
       
   438 //! @SYMAPI			RBackedUpWindow
       
   439 //! @SYMAuthor			Victor Liu
       
   440 //! @SYMCreationDate		06/03/2007
       
   441 //! @SYMTestCaseDesc		MaintainBackup(): tell the window server to start maintaining a backup bitmap with the entire window contents
       
   442 //!				Uses API elements: RWsSession::Connect & SetAutoFlush, RWindowGroup::Construct, CWsScreenDevice::Construct & CreateContext, CWindowGc::Activate & SetBrushColor & ESolidBrush & DrawRect
       
   443 //!				RBackedUpWindow::Construct & BitmapHandle, RWindowBase::SetSizeErr & Activte
       
   444 //! @SYMTestActions		1.	Create and initiate an active RBackedUpWindow
       
   445 //!					1.1     Create a RWsSession, RWindowGroup, CWsScreenDevice and CWindowGc
       
   446 //!					1.2     Create and construct a RBackedUpWindow, with size width 80 and height 80, and activated
       
   447 //!					1.3     SetAutoFlush=TRUE for the RWsSession, and Activate the CWindowGc for the RBackedUpWindow
       
   448 //!					        SetBrushColor to TRgb(255,0,0), SetBrushStyle=ESolidBrush
       
   449 //!				2.	Execute MaintainBackup to tell WSERV to maintain the backup bitmap
       
   450 //!				3.	Call BitmapHandle to get the backup bitmap handle, then duplicate the bitmap
       
   451 //!				4.	Check the inital color of the bitmap: all pixels are initial TRgb(255,255,255)
       
   452 //!				5.	Call CWindowGc::DrawRect ((0,0),(55,55)) to draw on the RBackedUpWindow
       
   453 //!				6.	Check if the backup bitmap reflect the drawing
       
   454 //!				7.	Call CWindowGc::DrawRect ((50,50),(65,65)) to draw on the RBackedUpWindow
       
   455 //!				8.	Check if the backup bitmap reflect the drawing
       
   456 //!				9.	Destruct and close all objects used
       
   457 //! @SYMTestStatus		Implemented
       
   458 //! @SYMTestPriority		Critical
       
   459 //! @SYMTestExpectedResults	1.	MaintainBackup() method calls without causing panic
       
   460 //!				2.	The backup bitmap should reflect the content of the RBackedUpWindow
       
   461 //!					only check sample pixels of (0,0), (50,50), (60,60), (70,70)
       
   462 //!					2.1	all pixels are initial TRgb(255,255,255)
       
   463 //!					2.2	after drawing of test action 5
       
   464 //!						2.2.1	on the rectangle border is drawn with pen color TRgb(0,0,0): (0,0)
       
   465 //!						2.2.2	inside the rectangle is drawn with brush color TRgb(255,0,0): (50,50)
       
   466 //!						2.2.3	outside the rectangle border keeps the default TRgb(255,255,255): (60,60), (70,70)
       
   467 //!					2.3	after drawing of test action 7 (2nd drawing overwrites the 1st one)
       
   468 //!						2.3.1	on the rectangle border is drawn with pen color TRgb(0,0,0): (0,0), (50,50)
       
   469 //!						2.3.2	inside the rectangle is drawn with brush color TRgb(255,0,0): (60,60)
       
   470 //!						2.3.3	outside the rectangle border keeps the default TRgb(255,255,255): (70,70)
       
   471 //! @SYMTestType		CIT
       
   472 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   473 		CREATE_OBJECT	RWsSession	ws
       
   474 		CREATE_OBJECT	CWsScreenDevice	scrdev
       
   475 		CREATE_OBJECT	CWindowGc	wingc
       
   476 		CREATE_OBJECT	RWindowGroup	wingrp
       
   477 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   478 		COMMAND		ws		new
       
   479 		COMMAND		ws		Connect
       
   480 		COMMAND		scrdev		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command04
       
   481 		COMMAND		scrdev		Construct
       
   482 		COMMAND		scrdev		CreateContext		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-CreateContext_command06
       
   483 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   484 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   485 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   486 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   487 		COMMAND		backupwin	SetExtentErr		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetExtentErr_command13
       
   488 		COMMAND		backupwin	Activate
       
   489 		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetAutoFlush_command16
       
   490 		COMMAND		wingc		Activate		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Activate_command18
       
   491 		COMMAND		wingc		SetBrushColor		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushColor_command19
       
   492 		COMMAND		wingc		SetBrushStyle		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetBrushStyle_command20
       
   493 
       
   494 		CREATE_OBJECT	CFbsBitmap	fbsbmp
       
   495 		COMMAND		backupwin	MaintainBackup
       
   496 		COMMAND		backupwin	BitmapHandle
       
   497 		COMMAND		fbsbmp		new
       
   498 		COMMAND		fbsbmp		Duplicate		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-Duplicate_command03
       
   499 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command04
       
   500 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command05
       
   501 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command06
       
   502 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command07
       
   503 		COMMAND		wingc		DrawRect		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-DrawRect_command09
       
   504 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command11
       
   505 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command12
       
   506 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command13
       
   507 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command14
       
   508 		COMMAND		wingc		DrawRect		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-DrawRect_command16
       
   509 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command18
       
   510 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command19
       
   511 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command20
       
   512 		COMMAND		fbsbmp		GetPixel		GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008-0001-GetPixel_command21
       
   513 
       
   514 		COMMAND		fbsbmp		~
       
   515 		COMMAND		wingc		Deactivate
       
   516 		COMMAND		backupwin	Close
       
   517 		COMMAND		wingrp		Close
       
   518 		COMMAND		wingc		~
       
   519 		COMMAND		scrdev		~
       
   520 		COMMAND		ws		Close
       
   521 	END_TEST_BLOCK
       
   522 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-0008
       
   523 
       
   524 // ****************************************************************************
       
   525 // Negative testcases of RBackedUpWindow
       
   526 // ****************************************************************************
       
   527 
       
   528 
       
   529 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1004
       
   530 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1004
       
   531 //! @SYMAPI			RBackedUpWindow
       
   532 //! @SYMAuthor			Victor Liu
       
   533 //! @SYMCreationDate		02/10/2007
       
   534 //! @SYMTestCaseDesc		Construct(const RWindowTreeNode &parent, TDisplayMode aDisplayMode, TUint32 aHandle): construct the RBackedUpWindow within invalid TDisplayMode (negative value)
       
   535 //!				Uses API elements: RWsSession::Connect, RWindowGroup::Construct, RBackedUpWindow::Construct & BitmapHandle, CFbsBitmap::Duplicate & DisplayMode
       
   536 //! @SYMTestActions		1.	Create and connect a RWsSession
       
   537 //!				2.	Create and Construct RWindowGroup within the RWsSession
       
   538 //!				3.	Create RBackedUpWindow within the RWsSession
       
   539 //!				4.	Execute Construct() the RBackedUpWindow as the child of RWindowGroup and with negative TDisplayMode value
       
   540 //!				5.	Destruct and close all objects used
       
   541 //! @SYMTestStatus		Implemented
       
   542 //! @SYMTestPriority		Low
       
   543 //! @SYMTestExpectedResults	1.	RBackedUpWindow::Construct should fail with error KErrArgument (-6)
       
   544 //! @SYMTestType		CIT
       
   545 	START_TEST_BLOCK		10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   546 		CREATE_OBJECT		RWsSession	ws
       
   547 		CREATE_OBJECT		RWindowGroup	wingrp
       
   548 		CREATE_OBJECT		RBackedUpWindow	backupwin
       
   549 		COMMAND			ws		new
       
   550 		COMMAND			ws		Connect
       
   551 		COMMAND			wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   552 		COMMAND			wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   553 		COMMAND			backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   554 		COMMAND !Error=-6	backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1004-0001-Construct_command01
       
   555 		COMMAND			backupwin	Close
       
   556 		COMMAND			wingrp		Close
       
   557 		COMMAND			ws		Close
       
   558 	END_TEST_BLOCK
       
   559 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1004
       
   560 
       
   561 
       
   562 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1005
       
   563 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1005
       
   564 //! @SYMAPI			RBackedUpWindow
       
   565 //! @SYMAuthor			Victor Liu
       
   566 //! @SYMCreationDate		02/10/2007
       
   567 //! @SYMTestCaseDesc		Construct(const RWindowTreeNode &parent, TDisplayMode aDisplayMode, TUint32 aHandle): construct the RBackedUpWindow within invalid TDisplayMode (large value exceeds max of TDisplayMode)
       
   568 //!				Uses API elements: RWsSession::Connect, RWindowGroup::Construct, RBackedUpWindow::Construct & BitmapHandle, CFbsBitmap::Duplicate & DisplayMode
       
   569 //! @SYMTestActions		1.	Create and connect a RWsSession
       
   570 //!				2.	Create and Construct RWindowGroup within the RWsSession
       
   571 //!				3.	Create RBackedUpWindow within the RWsSession
       
   572 //!				4.	Execute Construct() the RBackedUpWindow as the child of RWindowGroup and with large TDisplayMode value (10000)
       
   573 //!				5.	Destruct and close all objects used
       
   574 //! @SYMTestStatus		Implemented
       
   575 //! @SYMTestPriority		Low
       
   576 //! @SYMTestExpectedResults	1.	RBackedUpWindow::Construct should fail with error KErrArgument (-6)
       
   577 //! @SYMTestType		CIT
       
   578 	START_TEST_BLOCK		10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   579 		CREATE_OBJECT		RWsSession	ws
       
   580 		CREATE_OBJECT		RWindowGroup	wingrp
       
   581 		CREATE_OBJECT		RBackedUpWindow	backupwin
       
   582 		COMMAND			ws		new
       
   583 		COMMAND			ws		Connect
       
   584 		COMMAND			wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   585 		COMMAND			wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   586 		COMMAND			backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   587 		COMMAND !Error=-6	backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1005-0001-Construct_command01
       
   588 		COMMAND			backupwin	Close
       
   589 		COMMAND			wingrp		Close
       
   590 		COMMAND			ws		Close
       
   591 	END_TEST_BLOCK
       
   592 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1005
       
   593 
       
   594 
       
   595 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1006
       
   596 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1006
       
   597 //! @SYMAPI			RBackedUpWindow
       
   598 //! @SYMAuthor			Victor Liu
       
   599 //! @SYMCreationDate		01/10/2007
       
   600 //! @SYMTestCaseDesc		Construct(const RWindowTreeNode &parent, TDisplayMode aDisplayMode, TUint32 aHandle): construct the RBackedUpWindow within invalid invalid parent node
       
   601 //!				Uses API elements: RWsSession::Connect, RWindowGroup::Construct, RBackedUpWindow::Construct
       
   602 //! @SYMTestActions		1.	Create and connect a RWsSession
       
   603 //!				2.	Create RWindowGroup within the RWsSession but not Construct() it
       
   604 //!				3.	Create RBackedUpWindow within the RWsSession
       
   605 //!				4.	Execute Construct() the RBackedUpWindow as the child of RWindowGroup and see if it meets expected panic code
       
   606 //! @SYMTestStatus		Implemented
       
   607 //! @SYMTestPriority		Medium
       
   608 //! @SYMTestExpectedResults	get panic WSERV code=6 (Invalid window handle)
       
   609 //! @SYMTestType		CIT
       
   610 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   611 		CREATE_OBJECT	RWsSession	ws
       
   612 		CREATE_OBJECT	RWindowGroup	wingrp
       
   613 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   614 		COMMAND		ws		new
       
   615 		COMMAND		ws		Connect
       
   616 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   617 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   618 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   619 	END_TEST_BLOCK	!PanicString=WSERV	!PanicCode=6
       
   620 	RUN_TEST_STEP	100	T_GraphicsWservAPI	utilityClearPanicDlg
       
   621 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1006
       
   622 
       
   623 
       
   624 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1007
       
   625 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1007
       
   626 //! @SYMAPI			RBackedUpWindow
       
   627 //! @SYMAuthor			Victor Liu
       
   628 //! @SYMCreationDate		03/10/2007
       
   629 //! @SYMTestCaseDesc		UpdateScreen(): execute UpdateScreen() before calling MaintainBackup()
       
   630 //!				Uses API elements: RWsSession::Connect & SetAutoFlush, RWindowGroup::Construct, RBackedUpWindow::Construct
       
   631 //! @SYMTestActions		1.	Create and connect a RWsSession
       
   632 //!				2.	Create and Construct RWindowGroup within the RWsSession
       
   633 //!				3.	Create and Construct RBackedUpWindow as the child of RWindowGroup and within the RWsSession
       
   634 //!				4.	SetAutoFlush=TRUE for the RWsSession
       
   635 //!				5.	Execute UpdateScreen() before calling MaintainBackup()
       
   636 //! @SYMTestStatus		Implemented
       
   637 //! @SYMTestPriority		Medium
       
   638 //! @SYMTestExpectedResults	Succesfully without causing any panic
       
   639 //! @SYMTestType		CIT
       
   640 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   641 		CREATE_OBJECT	RWsSession	ws
       
   642 		CREATE_OBJECT	RWindowGroup	wingrp
       
   643 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   644 		COMMAND		ws		new
       
   645 		COMMAND		ws		Connect
       
   646 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   647 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   648 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   649 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   650 		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetAutoFlush_command16
       
   651 		COMMAND		backupwin	UpdateScreen
       
   652 		COMMAND		backupwin	Close
       
   653 		COMMAND		wingrp		Close
       
   654 		COMMAND		ws		Close
       
   655 	END_TEST_BLOCK	
       
   656 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1007
       
   657 
       
   658 
       
   659 START_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1008
       
   660 //! @SYMTestCaseID		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1008
       
   661 //! @SYMAPI			RBackedUpWindow
       
   662 //! @SYMAuthor			Victor Liu
       
   663 //! @SYMCreationDate		03/10/2007
       
   664 //! @SYMTestCaseDesc		UpdateScreen(const TRegion &aRegion): execute UpdateScreen() for the specified region before calling MaintainBackup()
       
   665 //!				Uses API elements: RWsSession::Connect & SetAutoFlush, RWindowGroup::Construct, RBackedUpWindow::Construct
       
   666 //! @SYMTestActions		1.	Create and connect a RWsSession
       
   667 //!				2.	Create and Construct RWindowGroup within the RWsSession
       
   668 //!				3.	Create and Construct RBackedUpWindow as the child of RWindowGroup and within the RWsSession
       
   669 //!				4.	SetAutoFlush=TRUE for the RWsSession
       
   670 //!				5.	Execute UpdateScreen() before calling MaintainBackup()
       
   671 //! @SYMTestStatus		Implemented
       
   672 //! @SYMTestPriority		Medium
       
   673 //! @SYMTestExpectedResults	Succesfully without causing any panic
       
   674 //! @SYMTestType		CIT
       
   675 	START_TEST_BLOCK	10		T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-BackedUpWindow-PublicApi.ini
       
   676 		CREATE_OBJECT	RWsSession	ws
       
   677 		CREATE_OBJECT	RWindowGroup	wingrp
       
   678 		CREATE_OBJECT	RBackedUpWindow	backupwin
       
   679 		COMMAND		ws		new
       
   680 		COMMAND		ws		Connect
       
   681 		COMMAND		wingrp		new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command08
       
   682 		COMMAND		wingrp		Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command09
       
   683 		COMMAND		backupwin	new			GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-new_command11
       
   684 		COMMAND		backupwin	Construct		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-Construct_command12
       
   685 		COMMAND		ws		SetAutoFlush		GRAPHICS-WSERV-BackedUpWindow-Setup-0002-0001-SetAutoFlush_command16
       
   686 		COMMAND		backupwin	UpdateScreen		GRAPHICS-WSERV-BackedUpWindow-PublicApi-1008-0001-UpdateScreen_command01
       
   687 		COMMAND		backupwin	Close
       
   688 		COMMAND		wingrp		Close
       
   689 		COMMAND		ws		Close
       
   690         END_TEST_BLOCK	
       
   691 END_TESTCASE	GRAPHICS-WSERV-BackedUpWindow-PublicApi-1008
       
   692