graphicsapitest/graphicssvs/wserv/scripts/GRAPHICS-WSERV-Events-PublicApi.script
changeset 103 2717213c588a
parent 98 bf7481649c98
child 116 171fae344dd4
child 121 d72fc2aace31
child 187 9f66f99ee56f
equal deleted inserted replaced
98:bf7481649c98 103:2717213c588a
     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-Events-PublicApi
       
    18 //! @SYMScriptTestEnvironment	This test script requires a basic ROM.
       
    19 
       
    20 ///////////////////////////////////////////////////////////////////////////////
       
    21 // GRAPHICS-WSERV-Events-PublicApi.script
       
    22 //
       
    23 // Tests all public elements of the RWsSession 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 // RWsSession 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 // RWsEvent
       
    40 // ****************************************************************************
       
    41 
       
    42 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0001
       
    43 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0001
       
    44 //! @SYMAPI			TWsEvent
       
    45 //! @SYMAuthor			Sunny Yeh
       
    46 //! @SYMCreationDate		18/12/2007
       
    47 //! @SYMTestCaseDesc		TWsEvent(): create a TWsEvent object by C++ defaut constructor
       
    48 //!				Uses API elements: TWsEvent(),Type()
       
    49 //! @SYMTestActions		1. use new() to create a RWsSession and TWsEvent object
       
    50 //!				2. use Connect() to make a connection with window server
       
    51 //!				3. use new() and Construct() to create a RWindowGroup
       
    52 //!				4. use EventReady() to request standard events from the window server
       
    53 //!				5. Wait for an event, A EEventFocusGained event should be triggered from the RWindowGroup::Construct
       
    54 //!				6. Get the event
       
    55 //!				7. use Type() to get the type of event that occurred
       
    56 //!				8. Close the session
       
    57 //! @SYMTestStatus		Implemented
       
    58 //! @SYMTestPriority		Low
       
    59 //! @SYMTestExpectedResults	TWsEvent Type should be EEventFocusGained
       
    60 //! @SYMTestType		CIT
       
    61 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
    62 		CREATE_OBJECT	RWsSession	ws
       
    63 		CREATE_OBJECT	TWsEvent	we
       
    64 		CREATE_OBJECT	RWindowGroup	wingrp
       
    65 		COMMAND		ws		new
       
    66 		COMMAND		we		new
       
    67 		COMMAND		ws		Connect
       
    68 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
    69 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-PublicApi-0001-0001-Construct_command05
       
    70 		COMMAND		ws		EventReady
       
    71 		OUTSTANDING
       
    72 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0001-0001-GetEvent_command07
       
    73 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0001-0001-Type_command08
       
    74 		COMMAND		wingrp		Close
       
    75 		COMMAND		ws		Close
       
    76 	END_TEST_BLOCK
       
    77 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0001
       
    78 
       
    79 
       
    80 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0002
       
    81 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0002
       
    82 //! @SYMAPI			TWsEvent
       
    83 //! @SYMAuthor			Sunny Yeh
       
    84 //! @SYMCreationDate		17/09/2007
       
    85 //! @SYMTestCaseDesc		Int(): get the event data as a TInt
       
    86 //!				Uses API elements: TWsEvent::Type & SetType, Int
       
    87 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
    88 //!				2. use SetType() to set event type to EEventUser
       
    89 //!				3. use Type() to get and check the event type = EEventUser
       
    90 //!				4. execute Int() and set the event data as TInt=100
       
    91 //!				5. execute Int() to get and check if the event data is TInt=100
       
    92 //!				6. Destruct the TWsEvent object
       
    93 //! @SYMTestStatus		Implemented
       
    94 //! @SYMTestPriority		Low
       
    95 //! @SYMTestExpectedResults	No errors
       
    96 //! @SYMTestType		CIT
       
    97 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
    98 		CREATE_OBJECT	TWsEvent	we
       
    99 		COMMAND		we		new
       
   100 		COMMAND		we		SetType				GRAPHICS-WSERV-Events-PublicApi-0002-0001-SetType_command01
       
   101 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0002-0001-Type_command02
       
   102 		COMMAND		we		Int				GRAPHICS-WSERV-Events-PublicApi-0002-0001-Int_command03
       
   103 		COMMAND		we		Int				GRAPHICS-WSERV-Events-PublicApi-0002-0001-Int_command04
       
   104 		COMMAND		we		~
       
   105 	END_TEST_BLOCK
       
   106 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0002
       
   107 
       
   108 
       
   109 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0003
       
   110 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0003
       
   111 //! @SYMAPI			TWsEvent
       
   112 //! @SYMAuthor			Sunny Yeh
       
   113 //! @SYMCreationDate		17/09/2007
       
   114 //! @SYMTestCaseDesc		ErrorMessage(): Gets an error event
       
   115 //!				Uses API elements: TWsEvent::Type & SetType, ErrorMessage
       
   116 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   117 //!				2. use SetType() to set event type to EEventUser
       
   118 //!				3. use Type() to get and check the event type = EEventUser
       
   119 //!				4. execute ErrorMessage() and set the error category to 100 and error to 200
       
   120 //!				5. execute ErrorMessage() to get and check if the error category and error as expected
       
   121 //!				6. Destruct the TWsEvent object
       
   122 //! @SYMTestStatus		Implemented
       
   123 //! @SYMTestPriority		Low
       
   124 //! @SYMTestExpectedResults	No errors
       
   125 //! @SYMTestType		CIT
       
   126 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   127 		CREATE_OBJECT	TWsEvent	we
       
   128 		COMMAND		we		new
       
   129 		COMMAND		we		SetType				GRAPHICS-WSERV-Events-PublicApi-0003-0001-SetType_command01
       
   130 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0003-0001-Type_command02
       
   131 		COMMAND		we		ErrorMessage			GRAPHICS-WSERV-Events-PublicApi-0003-0001-ErrorMessage_command03
       
   132 		COMMAND		we		ErrorMessage			GRAPHICS-WSERV-Events-PublicApi-0003-0001-ErrorMessage_command04
       
   133 		COMMAND		we		~
       
   134 	END_TEST_BLOCK
       
   135 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0003
       
   136 
       
   137 
       
   138 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0004
       
   139 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0004
       
   140 //! @SYMAPI			TWsEvent
       
   141 //! @SYMAuthor			Sunny Yeh
       
   142 //! @SYMCreationDate		17/09/2007
       
   143 //! @SYMTestCaseDesc		EventData(): Gets information about the event
       
   144 //!				Uses API elements: TWsEvent::Type & SetType, EventData
       
   145 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   146 //!				2. use SetType() to set event type to EEventUser
       
   147 //!				3. use Type() to get and check the event type = EEventUser
       
   148 //!				4. execute EventData() and set the event data of first 3 bytes to 10, 20, 30
       
   149 //!				5. execute EventData() to get and check if the event data of the first 3 bytes as expected
       
   150 //!				6. Destruct the TWsEvent object
       
   151 //! @SYMTestStatus		Implemented
       
   152 //! @SYMTestPriority		Low
       
   153 //! @SYMTestExpectedResults	No errors
       
   154 //! @SYMTestType		CIT
       
   155 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   156 		CREATE_OBJECT	TWsEvent	we
       
   157 		COMMAND		we		new
       
   158 		COMMAND		we		SetType				GRAPHICS-WSERV-Events-PublicApi-0004-0001-SetType_command01
       
   159 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0004-0001-Type_command02
       
   160 		COMMAND		we		EventData			GRAPHICS-WSERV-Events-PublicApi-0004-0001-EventData_command03
       
   161 		COMMAND		we		EventData			GRAPHICS-WSERV-Events-PublicApi-0004-0001-EventData_command04
       
   162 		COMMAND		we		~
       
   163 	END_TEST_BLOCK
       
   164 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0004
       
   165 
       
   166 
       
   167 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0005
       
   168 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0005
       
   169 //! @SYMAPI			TWsEvent
       
   170 //! @SYMAuthor			Sunny Yeh
       
   171 //! @SYMCreationDate		18/12/2007
       
   172 //! @SYMTestCaseDesc		SetHandle(), Handle(): Set and Get the window handle
       
   173 //!				Uses API elements: TWsEvent(),SetHandle(),Handle()
       
   174 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   175 //!				2. use SetHandle() to set the handle
       
   176 //!				3. use Handle() to get the handle
       
   177 //!				4. Close the session
       
   178 //! @SYMTestStatus		Implemented
       
   179 //! @SYMTestPriority		Low
       
   180 //! @SYMTestExpectedResults	Handle returned is that set with SetHandle
       
   181 //! @SYMTestType		CIT
       
   182 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   183 		CREATE_OBJECT	TWsEvent	we
       
   184 		COMMAND		we		new
       
   185 		COMMAND		we		SetHandle 			GRAPHICS-WSERV-Events-PublicApi-0005-0001-SetHandle_command02
       
   186 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0005-0001-Handle_command03
       
   187 	END_TEST_BLOCK
       
   188 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0005
       
   189 
       
   190 
       
   191 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0006
       
   192 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0006
       
   193 //! @SYMAPI			TWsEvent
       
   194 //! @SYMAuthor			Sunny Yeh
       
   195 //! @SYMCreationDate		18/12/2007
       
   196 //! @SYMTestCaseDesc		SetType(), Type(): Set and Get the event type
       
   197 //!				Uses API elements: TWsEvent(),SetType(),Type()
       
   198 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   199 //!				2. use SetType() to set Type
       
   200 //!				3. use Type() to get the Type
       
   201 //!				4. Close the session
       
   202 //! @SYMTestStatus		Implemented
       
   203 //! @SYMTestPriority		Low
       
   204 //! @SYMTestExpectedResults	Type returned is that set with SetType
       
   205 //! @SYMTestType		CIT
       
   206 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   207 		CREATE_OBJECT	TWsEvent	we
       
   208 		COMMAND		we		new
       
   209 		COMMAND		we		SetType 			GRAPHICS-WSERV-Events-PublicApi-0006-0001-SetType_command02
       
   210 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0006-0001-Type_command03
       
   211 	END_TEST_BLOCK
       
   212 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0006
       
   213 
       
   214 
       
   215 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0007
       
   216 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0007
       
   217 //! @SYMAPI			TWsEvent
       
   218 //! @SYMAuthor			Sunny Yeh
       
   219 //! @SYMCreationDate		13/09/2007
       
   220 //! @SYMTestCaseDesc		Pointer(): Gets the pointer event
       
   221 //!				Uses API elements: RWsSession::Connect & EventReady & GetEvent & SimulateRawEvent, RWindowGroup::Construct, RWindow::Construct & Activate, TWsEvent::Type & Handle
       
   222 //! @SYMTestActions		1. use new() to create a RWsSession and TWsEvent object
       
   223 //!				2. use Connect() to make a connection with window server
       
   224 //!				3. use new() and Construct() to create a RWindowGroup
       
   225 //!				4. use EventReady() to request standard events from the window server
       
   226 //!				5. Wait for an event, A EEventFocusGained event should be triggered from the RWindowGroup::Construct
       
   227 //!				6. Get the event
       
   228 //!				7. use Type() to get the type of event that occurred
       
   229 //!				8. use new() and Construct() to create a RWindow as the child of the RWindowGroup within the RWsSession
       
   230 //!				9. Activate() the RWindow to make it to receive events
       
   231 //!				10. use SimulateRawEvent() to trigger a EButton1Down event at (10,15) on default device number 0
       
   232 //!				11. use Flush() to send all pending commands to WSERV
       
   233 //!				12. use EventReady() to request standard events from the window server
       
   234 //!				13. Wait for an event, the raw event should be wrapped into a EEventPointer event and triggered
       
   235 //!				14. use Type() to check the received event type should be EEventPointer
       
   236 //!				15. use Handle() to check the received event handle should be the client handle of RWindow, i.e. 2
       
   237 //!				16. execute Pointer() to check the received pointer event with type=EButton1Down and position (10,15)
       
   238 //!				17. Destruct and close all objects used
       
   239 //! @SYMTestStatus		Implemented
       
   240 //! @SYMTestPriority		Low
       
   241 //! @SYMTestExpectedResults	Pointer() call without causing panic, and returned TPointerEvent is the same as expected
       
   242 //! @SYMTestType		CIT
       
   243 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   244 		CREATE_OBJECT	RWsSession	ws
       
   245 		CREATE_OBJECT	TWsEvent	we
       
   246 		CREATE_OBJECT	RWindowGroup	wingrp
       
   247 		CREATE_OBJECT	RWindow		win
       
   248 		COMMAND		ws		new
       
   249 		COMMAND		we		new
       
   250 		COMMAND		ws		Connect
       
   251 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   252 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-PublicApi-0001-0001-Construct_command05
       
   253 		COMMAND		ws		EventReady
       
   254 		OUTSTANDING
       
   255 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0001-0001-GetEvent_command07
       
   256 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0001-0001-Type_command08
       
   257 
       
   258 		COMMAND		win		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   259 		COMMAND		win		Construct			GRAPHICS-WSERV-Events-PublicApi-0007-0001-Construct_command01
       
   260 		COMMAND		win		Activate
       
   261 
       
   262 		COMMAND		ws		SimulateRawEvent		GRAPHICS-WSERV-Events-PublicApi-0007-0001-SimulateRawEvent_command02
       
   263 		COMMAND		ws		Flush
       
   264 		COMMAND		ws		EventReady
       
   265 		OUTSTANDING
       
   266 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0007-0001-GetEvent_command03
       
   267 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0007-0001-Type_command04
       
   268 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0007-0001-Handle_command05
       
   269 		COMMAND		we		Pointer				GRAPHICS-WSERV-Events-PublicApi-0007-0001-Pointer_command06
       
   270 
       
   271 		COMMAND		win		Close
       
   272 		COMMAND		wingrp		Close
       
   273 		COMMAND		ws		Close
       
   274 	END_TEST_BLOCK
       
   275 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0007
       
   276 
       
   277 
       
   278 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0008
       
   279 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0008
       
   280 //! @SYMAPI			TWsEvent
       
   281 //! @SYMAuthor			Sunny Yeh
       
   282 //! @SYMCreationDate		13/09/2007
       
   283 //! @SYMTestCaseDesc		Key(): get the key event
       
   284 //!				Uses API elements: RWsSession::Connect & EventReady & GetEvent & SimulateKeyEvent, RWindowGroup::Construct, TWsEvent::Type & Handle
       
   285 //! @SYMTestActions		1. use new() to create a RWsSession and TWsEvent object
       
   286 //!				2. use Connect() to make a connection with window server
       
   287 //!				3. use new() and Construct() to create a RWindowGroup
       
   288 //!				4. use EventReady() to request standard events from the window server
       
   289 //!				5. Wait for an event, A EEventFocusGained event should be triggered from the RWindowGroup::Construct
       
   290 //!				6. Get the event
       
   291 //!				7. use Type() to get the type of event that occurred
       
   292 //!				8. use SimulateKeyEvent() to trigger a key event of keycode=EKeyF1 and modifiers=EModifierCtrl
       
   293 //!				9. use Flush() to send all pending commands to WSERV
       
   294 //!				10. use EventReady() to request standard events from the window server
       
   295 //!				11. Wait for an event, the raw event should be wrapped into a EEventKey event and triggered
       
   296 //!				12. use Type() to check the received event type should be EEventKey
       
   297 //!				13. use Handle() to check the received event handle should be the client handle of RWindowGroup, i.e. 1
       
   298 //!				14. execute Key() to check the received key event with code=EKeyF1 and modifiers=EModifierCtrl and repeats=0
       
   299 //!				15. Destruct and close all objects used
       
   300 //! @SYMTestStatus		Implemented
       
   301 //! @SYMTestPriority		Low
       
   302 //! @SYMTestExpectedResults	No errors
       
   303 //! @SYMTestType		CIT
       
   304 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   305 		CREATE_OBJECT	RWsSession	ws
       
   306 		CREATE_OBJECT	TWsEvent	we
       
   307 		CREATE_OBJECT	RWindowGroup	wingrp
       
   308 		COMMAND		ws		new
       
   309 		COMMAND		we		new
       
   310 		COMMAND		ws		Connect
       
   311 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   312 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-PublicApi-0001-0001-Construct_command05
       
   313 		COMMAND		ws		EventReady
       
   314 		OUTSTANDING
       
   315 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0001-0001-GetEvent_command07
       
   316 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0001-0001-Type_command08
       
   317 
       
   318 		COMMAND		ws		SimulateKeyEvent		GRAPHICS-WSERV-Events-PublicApi-0008-0001-SimulateKeyEvent_command01
       
   319 		COMMAND		ws		Flush
       
   320 		COMMAND		ws		EventReady
       
   321 		OUTSTANDING
       
   322 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0008-0001-GetEvent_command02
       
   323 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0008-0001-Type_command03
       
   324 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0008-0001-Handle_command04
       
   325 		COMMAND		we		Key				GRAPHICS-WSERV-Events-PublicApi-0008-0001-Key_command05
       
   326 
       
   327 		COMMAND		wingrp		Close
       
   328 		COMMAND		ws		Close
       
   329 	END_TEST_BLOCK
       
   330 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0008
       
   331 
       
   332 
       
   333 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0009
       
   334 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0009
       
   335 //! @SYMAPI			TWsEvent
       
   336 //! @SYMAuthor			Sunny Yeh
       
   337 //! @SYMCreationDate		18/12/2007
       
   338 //! @SYMTestCaseDesc		SetTimeNow(): Sets the event time to the current time
       
   339 //!				Uses API elements: TWsEvent(),SetTimeNow()
       
   340 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   341 //!				2. use SetTimeNow() to set the event time to the current time
       
   342 //! @SYMTestStatus		Implemented
       
   343 //! @SYMTestPriority		Low
       
   344 //! @SYMTestExpectedResults	Event time set
       
   345 //! @SYMTestType		CIT
       
   346 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   347 		CREATE_OBJECT	TWsEvent	we
       
   348 		COMMAND		we		new
       
   349 		COMMAND		we		SetTimeNow		
       
   350 	END_TEST_BLOCK
       
   351 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0009
       
   352 
       
   353 
       
   354 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0010
       
   355 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0010
       
   356 //! @SYMAPI			TWsEvent
       
   357 //! @SYMAuthor			Sunny Yeh
       
   358 //! @SYMCreationDate		18/12/2007
       
   359 //! @SYMTestCaseDesc		Time(): Gets the time when the event occurred
       
   360 //!				Uses API elements: TWsEvent(),SetTimeNow(),Time()
       
   361 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   362 //!				2. use SetTimeNow() to set the event time to the current time
       
   363 //!				3. use Time() to get  the time when the event occurred
       
   364 //! @SYMTestStatus		Implemented
       
   365 //! @SYMTestPriority		Low
       
   366 //! @SYMTestExpectedResults	No errors
       
   367 //! @SYMTestType		CIT
       
   368 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   369 		CREATE_OBJECT	TWsEvent	we
       
   370 		COMMAND		we		new
       
   371 		COMMAND		we		SetTimeNow		
       
   372 		COMMAND		we		Time			
       
   373 	END_TEST_BLOCK
       
   374 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0010
       
   375 
       
   376 
       
   377 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0011
       
   378 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0011
       
   379 //! @SYMAPI			TWsEvent
       
   380 //! @SYMAuthor			Sunny Yeh
       
   381 //! @SYMCreationDate		14/09/2007
       
   382 //! @SYMTestCaseDesc		ModifiersChanged(): Gets information about the modifier changed event.
       
   383 //!				Uses API elements: RWsSession::Connect & EventReady & GetEvent & SimulateRawEvent, RWindowGroup::Construct & EnableModifierChangedEvents, TWsEvent::Type & Handle
       
   384 //! @SYMTestActions		1. use new() to create a RWsSession and TWsEvent object
       
   385 //!				2. use Connect() to make a connection with window server
       
   386 //!				3. use new() and Construct() to create a RWindowGroup
       
   387 //!				4. use EventReady() to request standard events from the window server
       
   388 //!				5. Wait for an event, A EEventFocusGained event should be triggered from the RWindowGroup::Construct
       
   389 //!				6. Get the event
       
   390 //!				7. use Type() to get the type of event that occurred
       
   391 //!				8. use EnableModifierChangedEvents() to request modifier changed event for modifier EModifierCapsLock and to send when EEventControlAlways
       
   392 //!				9. use SimulateRawEvent() to trigger a raw event of type=EKeyDown and stdscancode=EStdKeyCapsLock
       
   393 //!				10. use Flush() to send all pending commands to WSERV
       
   394 //!				10. use EventReady() to request standard events from the window server
       
   395 //!				11. Wait for an event, the raw event should be wrapped into a EEventModifiersChanged event and triggered
       
   396 //!				12. use Type() to check the received event type should be EEventModifiersChanged
       
   397 //!				13. use Handle() to check the received event handle should be the client handle of RWindowGroup, i.e. 1
       
   398 //!				14. execute ModifiersChanged() to check the received modifier changed event with changedmodifier=EModifierCapsLock & modifier=EModifierCapsLock
       
   399 //!				15. Destruct and close all objects used
       
   400 //! @SYMTestStatus		Implemented
       
   401 //! @SYMTestPriority		Low
       
   402 //! @SYMTestExpectedResults	information about the visibility changed event returned
       
   403 //! @SYMTestType		CIT
       
   404 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   405 		CREATE_OBJECT	RWsSession	ws
       
   406 		CREATE_OBJECT	TWsEvent	we
       
   407 		CREATE_OBJECT	RWindowGroup	wingrp
       
   408 		COMMAND		ws		new
       
   409 		COMMAND		we		new
       
   410 		COMMAND		ws		Connect
       
   411 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   412 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-PublicApi-0001-0001-Construct_command05
       
   413 		COMMAND		ws		EventReady
       
   414 		OUTSTANDING
       
   415 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0001-0001-GetEvent_command07
       
   416 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0001-0001-Type_command08
       
   417 
       
   418 		COMMAND		wingrp		EnableModifierChangedEvents	GRAPHICS-WSERV-Events-PublicApi-0011-0001-EnableModifierChangedEvents_command01
       
   419 		COMMAND		ws		SimulateRawEvent		GRAPHICS-WSERV-Events-PublicApi-0011-0001-SimulateRawEvent_command02
       
   420 		COMMAND		ws		SimulateRawEvent		GRAPHICS-WSERV-Events-PublicApi-0011-0001-SimulateRawEvent_command03
       
   421 		COMMAND		ws		Flush
       
   422 		COMMAND		ws		EventReady
       
   423 		OUTSTANDING
       
   424 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0011-0001-GetEvent_command04
       
   425 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0011-0001-Type_command05
       
   426 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0011-0001-Handle_command06
       
   427 		COMMAND		we		ModifiersChanged		GRAPHICS-WSERV-Events-PublicApi-0011-0001-ModifiersChanged_command07
       
   428 
       
   429 		COMMAND		ws		SimulateRawEvent		GRAPHICS-WSERV-Events-PublicApi-0011-0001-SimulateRawEvent_command08
       
   430 		COMMAND		ws		SimulateRawEvent		GRAPHICS-WSERV-Events-PublicApi-0011-0001-SimulateRawEvent_command09
       
   431 		COMMAND		ws		Flush
       
   432 		COMMAND		ws		EventReady
       
   433 		OUTSTANDING
       
   434 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0011-0001-GetEvent_command10
       
   435 
       
   436 		COMMAND		wingrp		Close
       
   437 		COMMAND		ws		Close
       
   438 	END_TEST_BLOCK
       
   439 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0011
       
   440 
       
   441 
       
   442 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0012
       
   443 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0012
       
   444 //! @SYMAPI			TWsEvent
       
   445 //! @SYMAuthor			Sunny Yeh
       
   446 //! @SYMCreationDate		14/09/2007
       
   447 //! @SYMTestCaseDesc		VisibilityChanged(): Gets information about the visibility changed event.
       
   448 //!				Uses API elements: RWsSession::Connect & EventReady & GetEvent & SimulateRawEvent, RWindowGroup::Construct, RWindow::Construct & EnableVisibilityChangeEvents, TWsEvent::Type & Handle
       
   449 //! @SYMTestActions		1. use new() to create a RWsSession and TWsEvent object
       
   450 //!				2. use Connect() to make a connection with window server
       
   451 //!				3. use new() and Construct() to create a RWindowGroup
       
   452 //!				4. use EventReady() to request standard events from the window server
       
   453 //!				5. Wait for an event, A EEventFocusGained event should be triggered from the RWindowGroup::Construct
       
   454 //!				6. Get the event
       
   455 //!				7. use Type() to get the type of event that occurred
       
   456 //!				8. use new() and Construct() to create a RWindow as the child of the RWindowGroup within the RWsSession
       
   457 //!				9. Activate() the RWindow to display and make it to receive events
       
   458 //!				10. use EnableVisibilityChangeEvents() to request visibility changed events of RWindow
       
   459 //!				11. use EventReady() to request standard events from the window server
       
   460 //!				12. Wait for an event, the raw event should be wrapped into a EEventWindowVisibilityChanged event and triggered
       
   461 //!				13. use Type() to check the received event type should be EEventModifiersChanged
       
   462 //!				14. use Handle() to check the received event handle should be the client handle of RWindow, i.e. 2
       
   463 //!				15. execute VisibilityChanged() to check the received visibility changed event of ECanBeSeen|EFullyVisible
       
   464 //!				16. Destruct and close all objects used
       
   465 //! @SYMTestStatus		Implemented
       
   466 //! @SYMTestPriority		Low
       
   467 //! @SYMTestExpectedResults	information about the visibility changed event returned
       
   468 //! @SYMTestType		CIT
       
   469 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   470 		CREATE_OBJECT	RWsSession	ws
       
   471 		CREATE_OBJECT	TWsEvent	we
       
   472 		CREATE_OBJECT	RWindowGroup	wingrp
       
   473 		CREATE_OBJECT	RWindow		win
       
   474 		COMMAND		ws		new
       
   475 		COMMAND		we		new
       
   476 		COMMAND		ws		Connect
       
   477 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   478 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-PublicApi-0001-0001-Construct_command05
       
   479 		COMMAND		ws		EventReady
       
   480 		OUTSTANDING
       
   481 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0001-0001-GetEvent_command07
       
   482 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0001-0001-Type_command08
       
   483 
       
   484 		COMMAND		win		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   485 		COMMAND		win		Construct			GRAPHICS-WSERV-Events-PublicApi-0012-0001-Construct_command01
       
   486 		COMMAND		win		Activate
       
   487 		COMMAND		win		EnableVisibilityChangeEvents
       
   488 
       
   489 		COMMAND		ws		EventReady
       
   490 		OUTSTANDING
       
   491 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0012-0001-GetEvent_command02
       
   492 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0012-0001-Type_command03
       
   493 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0012-0001-Handle_command04
       
   494 		COMMAND		we		VisibilityChanged		GRAPHICS-WSERV-Events-PublicApi-0012-0001-VisibilityChanged_command05
       
   495 
       
   496 		COMMAND		win		Close
       
   497 		COMMAND		wingrp		Close
       
   498 		COMMAND		ws		Close
       
   499 	END_TEST_BLOCK
       
   500 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0012
       
   501 
       
   502 
       
   503 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0013
       
   504 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0013
       
   505 //! @SYMAPI			TWsEvent
       
   506 //! @SYMAuthor			Sunny Yeh
       
   507 //! @SYMCreationDate		14/09/2007
       
   508 //! @SYMTestCaseDesc		const VisibilityChanged(): Gets information about the visibility changed event.
       
   509 //!				Uses API elements: TWsEvent(),Type(),VisibilityChanged()
       
   510 //! @SYMTestActions		1. use new() to create a RWsSession and TWsEvent object
       
   511 //!				2. use Connect() to make a connection with window server
       
   512 //!				3. use new() and Construct() to create a RWindowGroup
       
   513 //!				4. use EventReady() to request standard events from the window server
       
   514 //!				5. Wait for an event, A EEventFocusGained event should be triggered from the RWindowGroup::Construct
       
   515 //!				6. Get the event
       
   516 //!				7. use Type() to get the type of event that occurred
       
   517 //!				8. use new() and Construct() to create a RWindow as the child of the RWindowGroup within the RWsSession
       
   518 //!				9. Activate() the RWindow to display and make it to receive events
       
   519 //!				10. use EnableVisibilityChangeEvents() to request visibility changed events of RWindow
       
   520 //!				11. use EventReady() to request standard events from the window server
       
   521 //!				12. Wait for an event, the raw event should be wrapped into a EEventWindowVisibilityChanged event and triggered
       
   522 //!				13. use Type() to check the received event type should be EEventModifiersChanged
       
   523 //!				14. use Handle() to check the received event handle should be the client handle of RWindow, i.e. 2
       
   524 //!				15. execute VisibilityChanged() to get constant and check the received visibility changed event of ECanBeSeen|EFullyVisible
       
   525 //!				16. Destruct and close all objects used
       
   526 //! @SYMTestStatus		Implemented
       
   527 //! @SYMTestPriority		Low
       
   528 //! @SYMTestExpectedResults	information about the visibility changed event returned
       
   529 //! @SYMTestType		CIT
       
   530 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   531 		CREATE_OBJECT	RWsSession	ws
       
   532 		CREATE_OBJECT	TWsEvent	we
       
   533 		CREATE_OBJECT	RWindowGroup	wingrp
       
   534 		CREATE_OBJECT	RWindow		win
       
   535 		COMMAND		ws		new
       
   536 		COMMAND		we		new
       
   537 		COMMAND		ws		Connect
       
   538 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   539 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-PublicApi-0001-0001-Construct_command05
       
   540 		COMMAND		ws		EventReady
       
   541 		OUTSTANDING
       
   542 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0001-0001-GetEvent_command07
       
   543 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0001-0001-Type_command08
       
   544 
       
   545 		COMMAND		win		new				GRAPHICS-WSERV-Events-PublicApi-0001-0001-new_command04
       
   546 		COMMAND		win		Construct			GRAPHICS-WSERV-Events-PublicApi-0013-0001-Construct_command01
       
   547 		COMMAND		win		Activate
       
   548 		COMMAND		win		EnableVisibilityChangeEvents
       
   549 
       
   550 		COMMAND		ws		EventReady
       
   551 		OUTSTANDING
       
   552 		COMMAND		ws		GetEvent			GRAPHICS-WSERV-Events-PublicApi-0013-0001-GetEvent_command02
       
   553 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0013-0001-Type_command03
       
   554 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0013-0001-Handle_command04
       
   555 		COMMAND		we		VisibilityChanged		GRAPHICS-WSERV-Events-PublicApi-0013-0001-VisibilityChanged_command05
       
   556 
       
   557 		COMMAND		win		Close
       
   558 		COMMAND		wingrp		Close
       
   559 		COMMAND		ws		Close
       
   560 	END_TEST_BLOCK
       
   561 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0013
       
   562 
       
   563 
       
   564 // ****************************************************************************
       
   565 // TWsPriorityKeyEvent
       
   566 // ****************************************************************************
       
   567 
       
   568 
       
   569 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0014
       
   570 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0014
       
   571 //! @SYMAPI			TWsPriorityKeyEvent
       
   572 //! @SYMAuthor			Sunny Yeh
       
   573 //! @SYMCreationDate		16/08/2007
       
   574 //! @SYMTestCaseDesc 		Key(): get the priority key event.
       
   575 //!				Uses API elements: RWsSession::Connect & PriorityKeyReady & SimulateKeyEvent & GetPriorityKey & Flush, RWindowGroup::Construct & AddPriorityKey
       
   576 //! @SYMTestActions		1.	Create and construct a RWindowGroup to receive the priority key event
       
   577 //!				1.1	New and connect a RWsSession
       
   578 //!				1.2	New and construct a RWindowGroup within the RWsSession
       
   579 //!				2.	Use AddPriorityKey() to add a priority key of the RWindowGroup, e.g. keycode=EKeyF1 & modifier=EModifierCtrl
       
   580 //!				3.	Use PriorityKeyReady() to request priority key events from WSERV
       
   581 //!				4.	Use SimulateKeyEvent() to simulate a key event (with the same keycode and modifier of the specified priority key)
       
   582 //!				5.	Use Flush() to send all pending commands in the buffer to WSERV
       
   583 //!				6.	Use OUTSTANDING to wait for a priority key event
       
   584 //!				7.	when event obtained or timeouted, use GetPriorityKey to retrieve the priority key event
       
   585 //!				8.	Execute Key() to get and check if the returned key event is the same as expected
       
   586 //!				9.	Close and destruct all objects used
       
   587 //! @SYMTestStatus		Implemented
       
   588 //! @SYMTestPriority		High
       
   589 //! @SYMTestExpectedResults	Key() called without causing panic, and the returned key event is the same as the specified priority key, i.e. keycode=EKeyF1 & modifier=EModifierCtrl
       
   590 //! @SYMTestType		CIT
       
   591 	START_TEST_BLOCK	10			T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   592 		CREATE_OBJECT	RWsSession		ws
       
   593 		CREATE_OBJECT	RWindowGroup		wingrp
       
   594 		CREATE_OBJECT	TWsPriorityKeyEvent	we
       
   595 
       
   596 		COMMAND		ws			new
       
   597 		COMMAND		ws			Connect
       
   598 		COMMAND		wingrp			new			GRAPHICS-WSERV-Events-Setup-0014-0001-new_command001
       
   599 		COMMAND		wingrp			Construct		GRAPHICS-WSERV-Events-Setup-0014-0001-Construct_command002
       
   600 		COMMAND		we			new
       
   601 
       
   602 		COMMAND		wingrp			AddPriorityKey		GRAPHICS-WSERV-Events-PublicApi-0014-0001-AddPriorityKey_command001
       
   603 		COMMAND		ws			PriorityKeyReady
       
   604 		COMMAND		ws			SimulateKeyEvent	GRAPHICS-WSERV-Events-PublicApi-0014-0001-SimulateKeyEvent_command002
       
   605 		COMMAND		ws			Flush
       
   606 		OUTSTANDING
       
   607 		COMMAND		ws			GetPriorityKey		GRAPHICS-WSERV-Events-PublicApi-0014-0001-GetPriorityKey_command003
       
   608 		COMMAND		we			Key			GRAPHICS-WSERV-Events-PublicApi-0014-0001-Key_command004
       
   609 
       
   610 		COMMAND		we			~
       
   611 		COMMAND		wingrp			Close
       
   612 		COMMAND		ws			Close
       
   613 	END_TEST_BLOCK
       
   614 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0014
       
   615 
       
   616 
       
   617 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0015
       
   618 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0015
       
   619 //! @SYMAPI			TWsPriorityKeyEvent
       
   620 //! @SYMAuthor			Sunny Yeh
       
   621 //! @SYMCreationDate		16/08/2007
       
   622 //! @SYMTestCaseDesc 		Handle(): get the handle for the window group which added the priority key. 
       
   623 //!				Uses API elements: RWsSession::Connect & PriorityKeyReady & SimulateKeyEvent & GetPriorityKey & Flush, RWindowGroup::Construct & AddPriorityKey
       
   624 //! @SYMTestActions		1.	Create and construct a RWindowGroup to receive the priority key event
       
   625 //!				1.1	New and connect a RWsSession
       
   626 //!				1.2	New and construct a RWindowGroup within the RWsSession
       
   627 //!				2.	Use AddPriorityKey() to add a priority key of the RWindowGroup, e.g. keycode=EKeyF1 & modifier=EModifierCtrl
       
   628 //!				3.	Use PriorityKeyReady() to request priority key events from WSERV
       
   629 //!				4.	Use SimulateKeyEvent() to simulate a key event (with the same keycode and modifier of the specified priority key)
       
   630 //!				5.	Use Flush() to send all pending commands in the buffer to WSERV
       
   631 //!				6.	Use OUTSTANDING to wait for a priority key event
       
   632 //!				7.	when event obtained or timeouted, use GetPriorityKey to retrieve the priority key event
       
   633 //!				8.	Execute Handle() to get and check if the returned handle is the same as expected
       
   634 //!				9.	Close and destruct all objects used
       
   635 //! @SYMTestStatus		Implemented
       
   636 //! @SYMTestPriority		Medium
       
   637 //! @SYMTestExpectedResults	Handle() called without causing panic, and the returned handle is the client handle of the RWindowGroup, i.e. 1 (assigned when it constucted)
       
   638 //! @SYMTestType		CIT
       
   639 	START_TEST_BLOCK	10			T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   640 		CREATE_OBJECT	RWsSession		ws
       
   641 		CREATE_OBJECT	RWindowGroup		wingrp
       
   642 		CREATE_OBJECT	TWsPriorityKeyEvent	we
       
   643 
       
   644 		COMMAND		ws			new
       
   645 		COMMAND		ws			Connect
       
   646 		COMMAND		wingrp			new			GRAPHICS-WSERV-Events-Setup-0014-0001-new_command001
       
   647 		COMMAND		wingrp			Construct		GRAPHICS-WSERV-Events-Setup-0014-0001-Construct_command002
       
   648 		COMMAND		we			new
       
   649 
       
   650 		COMMAND		wingrp			AddPriorityKey		GRAPHICS-WSERV-Events-PublicApi-0015-0001-AddPriorityKey_command001
       
   651 		COMMAND		ws			PriorityKeyReady
       
   652 		COMMAND		ws			SimulateKeyEvent	GRAPHICS-WSERV-Events-PublicApi-0015-0001-SimulateKeyEvent_command002
       
   653 		COMMAND		ws			Flush
       
   654 		OUTSTANDING
       
   655 		COMMAND		ws			GetPriorityKey		GRAPHICS-WSERV-Events-PublicApi-0015-0001-GetPriorityKey_command003
       
   656 		COMMAND		we			Handle			GRAPHICS-WSERV-Events-PublicApi-0015-0001-Handle_command004
       
   657 
       
   658 		COMMAND		we			~
       
   659 		COMMAND		wingrp			Close
       
   660 		COMMAND		ws			Close
       
   661 	END_TEST_BLOCK
       
   662 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0015
       
   663 
       
   664 
       
   665 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0016
       
   666 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0016
       
   667 //! @SYMAPI			TWsPriorityKeyEvent
       
   668 //! @SYMAuthor			Sunny Yeh
       
   669 //! @SYMCreationDate		16/08/2007
       
   670 //! @SYMTestCaseDesc 		SetHandle(TUint aHandle): set the window group event handle 
       
   671 //!				Uses API elements: TWsPriorityKeyEvent::Handle
       
   672 //! @SYMTestActions		1.	new a TWsPriorityKeyEvent
       
   673 //!				2.	Execute SetHandle() to set the event handle, e.g. 2
       
   674 //!				3.	Use Handle() to check the event handle is the same as specified
       
   675 //! @SYMTestStatus		Implemented
       
   676 //! @SYMTestPriority		Low
       
   677 //! @SYMTestExpectedResults	1.	SetHandle() called without causing panic
       
   678 //!				2.	After SetHandle() executed, use Handle to check the event handle is the same as specified
       
   679 //! @SYMTestType		CIT
       
   680 	START_TEST_BLOCK	10			T_GraphicsWservAPI	\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   681 		CREATE_OBJECT	TWsPriorityKeyEvent	we
       
   682 		COMMAND		we			new
       
   683 		COMMAND		we			SetHandle		GRAPHICS-WSERV-Events-PublicApi-0016-0001-SetHandle_command001
       
   684 		COMMAND		we			Handle			GRAPHICS-WSERV-Events-PublicApi-0016-0001-Handle_command002
       
   685 		COMMAND		we			~
       
   686 	END_TEST_BLOCK
       
   687 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0016
       
   688 
       
   689 
       
   690 // ****************************************************************************
       
   691 // TWsRedrawEvent
       
   692 // ****************************************************************************
       
   693 
       
   694 
       
   695 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0017
       
   696 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0017
       
   697 //! @SYMAPI			TWsRedrawEvent
       
   698 //! @SYMAuthor			Sunny Yeh
       
   699 //! @SYMCreationDate		16/08/2007
       
   700 //! @SYMTestCaseDesc 		Handle(): Gets the handle of the window which is the target of the redraw event. 
       
   701 //!				Uses API elements: RWsSession::Connect & RedrawReady & GetRedraw, RWindowGroup::Construct, RWindowBase::Activate, RWindow::Construct & SetExtent
       
   702 //! @SYMTestActions		1.	Create and construct a RWindow to receive the redraw event
       
   703 //!				1.1	New and connect a RWsSession
       
   704 //!				1.2	New and construct a RWindowGroup within the RWsSession
       
   705 //!				1.3	New and construct a RWindow as the child of the RWindowGroup
       
   706 //!				1.4	Set the extent of RWindow to (5,6) and height=15, width=10
       
   707 //!				1.5	Activate RWindow to display and enable it to receive event
       
   708 //!				2.	Use RedrawReady to request redraw events from WSERV
       
   709 //!				3.	Use OUTSTANDING to wait for a redraw event
       
   710 //!				4.	when event obtained or timeouted, use GetRedraw to retrieve the redraw event
       
   711 //!				5.	Execute Handle() to get and check if the returned handle is the same as expected
       
   712 //!				6.	Close and destruct all objects used
       
   713 //! @SYMTestStatus		Implemented
       
   714 //! @SYMTestPriority		Medium
       
   715 //! @SYMTestExpectedResults	Handle() called without causing panic, and the returned handle is the client handle of the RWindow, i.e. 2 (assigned when it constucted)
       
   716 //! @SYMTestType		CIT
       
   717 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   718 		CREATE_OBJECT	RWsSession	ws
       
   719 		CREATE_OBJECT	RWindowGroup	wingrp
       
   720 		CREATE_OBJECT	RWindow		win
       
   721 		CREATE_OBJECT	TWsRedrawEvent	we
       
   722 
       
   723 		COMMAND		ws		new
       
   724 		COMMAND		ws		Connect
       
   725 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-Setup-0017-0001-new_command001
       
   726 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-Setup-0017-0001-Construct_command002
       
   727 		COMMAND		win		new				GRAPHICS-WSERV-Events-Setup-0017-0001-new_command001
       
   728 		COMMAND		win		Construct			GRAPHICS-WSERV-Events-Setup-0017-0001-Construct_command003
       
   729 		COMMAND		win		SetExtent			GRAPHICS-WSERV-Events-Setup-0017-0001-SetExtent_command004
       
   730 		COMMAND		win		Activate
       
   731 		COMMAND		we		new
       
   732 
       
   733 		COMMAND		ws		RedrawReady
       
   734 		OUTSTANDING
       
   735 		COMMAND		ws		GetRedraw			GRAPHICS-WSERV-Events-PublicApi-0017-0001-GetRedraw_command001
       
   736 		COMMAND		we		Handle				GRAPHICS-WSERV-Events-PublicApi-0017-0001-Handle_command002
       
   737 
       
   738 		COMMAND		we		~
       
   739 		COMMAND		win		Close
       
   740 		COMMAND		wingrp		Close
       
   741 		COMMAND		ws		Close
       
   742 	END_TEST_BLOCK
       
   743 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0017
       
   744 
       
   745 
       
   746 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0018
       
   747 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0018
       
   748 //! @SYMAPI			TWsRedrawEvent
       
   749 //! @SYMAuthor			Sunny Yeh
       
   750 //! @SYMCreationDate		16/08/2007
       
   751 //! @SYMTestCaseDesc 		Rect(): Gets the rectangle to redraw.
       
   752 //!				Uses API elements: RWsSession::Connect & RedrawReady & GetRedraw, RWindowGroup::Construct, RWindowBase::Activate, RWindow::Construct & SetExtent
       
   753 //! @SYMTestActions		1.	Create and construct a RWindow to receive the redraw event
       
   754 //!				1.1	New and connect a RWsSession
       
   755 //!				1.2	New and construct a RWindowGroup within the RWsSession
       
   756 //!				1.3	New and construct a RWindow as the child of the RWindowGroup
       
   757 //!				1.4	Set the extent of RWindow to (5,6) and height=15, width=10
       
   758 //!				1.5	Activate RWindow to display and enable it to receive event
       
   759 //!				2.	Use RedrawReady to request redraw events from WSERV
       
   760 //!				3.	Use OUTSTANDING to wait for a redraw event
       
   761 //!				4.	when event obtained or timeouted, use GetRedraw to retrieve the redraw event
       
   762 //!				5.	Execute Rect() to get and check if the returned rectangle is the same as expected
       
   763 //!				6.	Close and destruct all objects used
       
   764 //! @SYMTestStatus		Implemented
       
   765 //! @SYMTestPriority		High
       
   766 //! @SYMTestExpectedResults	Rect() called without causing panic, and the returned rectangle is the size of the RWindow ((0,0),(10,15))
       
   767 //! @SYMTestType		CIT
       
   768 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   769 		CREATE_OBJECT	RWsSession	ws
       
   770 		CREATE_OBJECT	RWindowGroup	wingrp
       
   771 		CREATE_OBJECT	RWindow		win
       
   772 		CREATE_OBJECT	TWsRedrawEvent	we
       
   773 
       
   774 		COMMAND		ws		new
       
   775 		COMMAND		ws		Connect
       
   776 		COMMAND		wingrp		new				GRAPHICS-WSERV-Events-Setup-0017-0001-new_command001
       
   777 		COMMAND		wingrp		Construct			GRAPHICS-WSERV-Events-Setup-0017-0001-Construct_command002
       
   778 		COMMAND		win		new				GRAPHICS-WSERV-Events-Setup-0017-0001-new_command001
       
   779 		COMMAND		win		Construct			GRAPHICS-WSERV-Events-Setup-0017-0001-Construct_command003
       
   780 		COMMAND		win		SetExtent			GRAPHICS-WSERV-Events-Setup-0017-0001-SetExtent_command004
       
   781 		COMMAND		win		Activate
       
   782 		COMMAND		we		new
       
   783 
       
   784 		COMMAND		ws		RedrawReady
       
   785 		OUTSTANDING
       
   786 		COMMAND		ws		GetRedraw			GRAPHICS-WSERV-Events-PublicApi-0018-0001-GetRedraw_command001
       
   787 		COMMAND		we		Rect				GRAPHICS-WSERV-Events-PublicApi-0018-0001-Rect_command002
       
   788 
       
   789 		COMMAND		we		~
       
   790 		COMMAND		win		Close
       
   791 		COMMAND		wingrp		Close
       
   792 		COMMAND		ws		Close
       
   793 	END_TEST_BLOCK
       
   794 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0018
       
   795 
       
   796 
       
   797 START_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0020
       
   798 //! @SYMTestCaseID		GRAPHICS-WSERV-Events-PublicApi-0020
       
   799 //! @SYMAPI			TWsEvent
       
   800 //! @SYMAuthor			Sunny Yeh
       
   801 //! @SYMCreationDate		18/12/2007
       
   802 //! @SYMTestCaseDesc		SetType(), Type(): Set and Get the event type usign a TInt
       
   803 //!				Uses API elements: TWsEvent(),SetType(),Type()
       
   804 //! @SYMTestActions		1. use new() to create a TWsEvent object
       
   805 //!				2. use SetType() to set Type
       
   806 //!				3. use Type() to get the Type
       
   807 //!				4. Close the session
       
   808 //! @SYMTestStatus		Implemented
       
   809 //! @SYMTestPriority		Low
       
   810 //! @SYMTestExpectedResults	Type returned is that set with SetType
       
   811 //! @SYMTestType		CIT
       
   812 	START_TEST_BLOCK	10		T_GraphicsWservAPI		\graphics\GRAPHICS-WSERV-Events-PublicApi.ini
       
   813 		CREATE_OBJECT	TWsEvent	we
       
   814 		COMMAND		we		new
       
   815 		COMMAND		we		SetType 			GRAPHICS-WSERV-Events-PublicApi-0020-0001-SetType_command02
       
   816 		COMMAND		we		Type				GRAPHICS-WSERV-Events-PublicApi-0020-0001-Type_command03
       
   817 	END_TEST_BLOCK
       
   818 END_TESTCASE GRAPHICS-WSERV-Events-PublicApi-0020