lafagnosticuifoundation/cone/tef/tconemultiptrcompoundstep.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "tconemultiptrcompoundstep.h"
       
    17 #include "tmultiptrtestcompoundcontrolcontainer.h"
       
    18 #include "tconemultiptrconst.h"
       
    19 #include <hal.h>
       
    20 
       
    21 /*
       
    22  Layout of the compound control/s. 
       
    23  The window-owning container control has two overlapping child controls.
       
    24  Co-ordinates are wrt the screen origin. Parenthesised co-ordinates are wrt the container.
       
    25 -------------------------------------------------------------------------------------------
       
    26 |          Small simple-control 280,0|     |                                              |
       
    27 |    40,40                           |     |320,40 360,40                                 |
       
    28 |    ----------------------------------- ---       -----------------------------------    |
       
    29 |    |    (20,20) 60,60                 |          |    (20,20) 380,60                |   |
       
    30 |    |    -----------------             |          |    -----------------             |   |
       
    31 |    |    |                |            |          |    |                |            |   |
       
    32 |    |    |                             |          |    |                             |   |
       
    33 |    |    |         (80,60) 120,100     |          |    |    (80,60) 420,100          |   |
       
    34 |    |    |         ----------------    |          |    |         ----------------    |   |
       
    35 |    |    |         |              |    |          |    |         |              |    |   |
       
    36 |    |    |         | Child 2      |    |          |    |         | Child 2      |    |   |
       
    37 |    |    |         ----------------    |          |    |         ----------------    |   |
       
    38 |    |    | Child 1        |  200,120   |          |    | Child 1        |  540,120   |   |
       
    39 |    |    |----------------             |          |    |----------------             |   |
       
    40 |    | Container        (120,120)       |          | Container        (120,120)       |   |
       
    41 |    |----------------------------------           |----------------------------------    |
       
    42 |                                  300,200                                                |
       
    43 |                                                                                         |
       
    44 |                                                                                         |
       
    45 |                                                                                         |
       
    46 -------------------------------------------------------------------------------------------
       
    47 */
       
    48 
       
    49 
       
    50 
       
    51 
       
    52 
       
    53 // Global function for panic
       
    54 void ConeTestCompoundPanic(TConeTestPanic aPanic)
       
    55 	{
       
    56 	User::Panic(_L("MultiPtrCmpnd"),aPanic);
       
    57 	}
       
    58 
       
    59 
       
    60 /**
       
    61  CTestStep derived class which implements RunTestStepL. It creates CoeEnv & AppUi objects.
       
    62  Logic involved, RunTestStepL will call RunTestsL() which will create new control/s for each
       
    63  test case and calls NextSetOfEventsL() which does testing of all different use cases 
       
    64  i,e by simulating the events and adding the events to a buffer. 
       
    65  Then RunTestStepL() starts the active scheduler, which will result in a call to
       
    66  control's HandlePointerEventL, which will test expected event in buffer with actual event.
       
    67 */
       
    68 CConeMultiPtrCompoundTestAppUi::CConeMultiPtrCompoundTestAppUi(CTmsTestStep* aStep) : 
       
    69 	CTestCoeAppUi(aStep)
       
    70 	{
       
    71 	}
       
    72 
       
    73 
       
    74 void CConeMultiPtrCompoundTestAppUi::ConstructL()
       
    75 	{
       
    76 	iNormalPointerCursorArea = iCoeEnv->WsSession().PointerCursorArea();
       
    77 	RDebug::Print( _L(">CConeMultiPtrComppoundTestAppUi::ConstructL") );
       
    78 	CTestCoeAppUi::ConstructL();
       
    79 
       
    80 	User::LeaveIfError( HAL::Get(HALData::EPointerNumberOfPointers, iNumberOfPointers) );
       
    81 	if( KErrNone != iCoeEnv->WsSession().SetCloseProximityThresholds(KControlTestEnterCloseProximityThreshold, KControlTestExitCloseProximityThreshold) ||
       
    82 	    KErrNone != iCoeEnv->WsSession().SetHighPressureThresholds(KControlTestEnterHighPressureThreshold, KControlTestExitHighPressureThreshold) )
       
    83 		{
       
    84 		User::Leave( KErrCorrupt );
       
    85 		}
       
    86 	if( KControlTestEnterCloseProximityThreshold != iCoeEnv->WsSession().GetEnterCloseProximityThreshold() ||
       
    87 	    KControlTestExitCloseProximityThreshold != iCoeEnv->WsSession().GetExitCloseProximityThreshold() ||
       
    88 	    KControlTestEnterHighPressureThreshold != iCoeEnv->WsSession().GetEnterHighPressureThreshold() ||
       
    89 	    KControlTestExitHighPressureThreshold != iCoeEnv->WsSession().GetExitHighPressureThreshold() )
       
    90 		{
       
    91 		User::Leave( KErrCorrupt );
       
    92 		}
       
    93 
       
    94 	AutoTestManager().StartAutoTest();
       
    95 	
       
    96 	RDebug::Print( _L("CConeMultiPtrComppoundTestAppUi::ConstructL>") );
       
    97 	}
       
    98 
       
    99 
       
   100 CConeMultiPtrCompoundTestAppUi::~CConeMultiPtrCompoundTestAppUi()
       
   101 	{
       
   102 	DeleteControlClusterOne();
       
   103 	DeleteControlClusterTwo();
       
   104 	}
       
   105 
       
   106 
       
   107 // Function called for each new test case from CTestManager active object.
       
   108 void CConeMultiPtrCompoundTestAppUi::RunTestStepL( TInt )
       
   109 	{
       
   110     if (!ConfigurationSupportsPointerEventTesting())
       
   111         {
       
   112         INFO_PRINTF1(_L("Test skipped because config does not support pointer event testing"));
       
   113         AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass);
       
   114         return;
       
   115         }
       
   116 
       
   117 	switch(iTestCase)
       
   118 		{
       
   119 		case 0:
       
   120 		case 1:
       
   121 		case 2:
       
   122 		case 3:
       
   123 		case 4:
       
   124 		case 6:
       
   125 		case 8:
       
   126 			RunTestsSingleClusterL();
       
   127 			break;
       
   128 			
       
   129 		case 5:
       
   130 		case 7:
       
   131 			RunTestsClusterPlusSimpleL();
       
   132 			break;
       
   133 			
       
   134 		default:
       
   135 			RDebug::Print( _L("End of test cases") );
       
   136 			AutoTestManager().FinishAllTestCases(CAutoTestManager::EPass);
       
   137 			break;
       
   138 		}
       
   139 	
       
   140 	if (iFailed)
       
   141 		{
       
   142 		TEST(EFalse);
       
   143 		iFailed=EFalse;
       
   144 		}
       
   145 
       
   146 	++iTestCase;
       
   147 	}
       
   148 
       
   149 TBool CConeMultiPtrCompoundTestAppUi::ConfigurationSupportsPointerEventTesting() const
       
   150     {
       
   151     if (iNormalPointerCursorArea.IsEmpty())
       
   152         {
       
   153         return EFalse;
       
   154         }
       
   155     return ETrue;
       
   156     }
       
   157 
       
   158 /**
       
   159  Function called for each new test case from RunTestStepL.
       
   160  This creates control/s calls NextSetOfEventsL and starts activescheduler.
       
   161  */
       
   162 void CConeMultiPtrCompoundTestAppUi::RunTestsSingleClusterL()
       
   163 	{
       
   164 	iEventSet = 0;
       
   165 
       
   166 	// Instantiate afresh for each test-case.
       
   167 	InstantiateControlClusterOneL();
       
   168 	
       
   169     iEventCount = 0;
       
   170 	TRAPD(err, NextSetOfEventsL());
       
   171 	if (err != KErrNone)
       
   172 		{
       
   173 		INFO_PRINTF1( _L("ERROR INFO LOGGED IN epocwind.out") );
       
   174 		
       
   175 		iFailed = ETrue;
       
   176 		return;
       
   177 		}
       
   178 	// Start nested active scheduler
       
   179 	CActiveScheduler::Start();
       
   180 
       
   181 	
       
   182 	if ( (iControlCluster_1->iChildTwo->EventsLeft() > 0) || (iControlCluster_1->iChildOne->EventsLeft() > 0) )
       
   183 		{
       
   184 		INFO_PRINTF1( _L("ERROR INFO LOGGED IN epocwind.out") );
       
   185 		
       
   186 		iFailed=ETrue;
       
   187 		}
       
   188 
       
   189 	DeleteControlClusterOne();
       
   190 	}
       
   191 
       
   192 
       
   193 void CConeMultiPtrCompoundTestAppUi::RunTestsDualClusterL()
       
   194 	{
       
   195 	iEventSet = 0;
       
   196 
       
   197 	// Instantiate afresh for each test-case.
       
   198 	InstantiateControlClusterOneL();
       
   199 	InstantiateControlClusterTwoL();
       
   200 	
       
   201     iEventCount = 0;
       
   202 	TRAPD(err, NextSetOfEventsL());
       
   203 	if (err != KErrNone)
       
   204 		{
       
   205 		INFO_PRINTF1( _L("ERROR INFO LOGGED IN epocwind.out") );
       
   206 		
       
   207 		iFailed = ETrue;
       
   208 		return;
       
   209 		}
       
   210 	// Start nested active scheduler
       
   211 	CActiveScheduler::Start();
       
   212 
       
   213 	
       
   214 	if ( (iControlCluster_1->iChildTwo->EventsLeft() > 0) || (iControlCluster_1->iChildOne->EventsLeft() > 0) )
       
   215 		{
       
   216 		INFO_PRINTF1( _L("ERROR INFO LOGGED IN epocwind.out") );
       
   217 		
       
   218 		iFailed=ETrue;
       
   219 		}
       
   220 	
       
   221 	DeleteControlClusterTwo();
       
   222 	DeleteControlClusterOne();	
       
   223 	}
       
   224 
       
   225 
       
   226 void CConeMultiPtrCompoundTestAppUi::RunTestsClusterPlusSimpleL()
       
   227 	{
       
   228 	iEventSet = 0;
       
   229 
       
   230 	// Instantiate afresh for each test-case.
       
   231 	InstantiateControlClusterOneL();
       
   232 	iControlSimple = CMultiPtrTestCompoundAppUiControl::NewL( KMultPtrSmallSimplePosition, KMultPtrSmallSimpleSize );
       
   233 	
       
   234     iEventCount = 0;
       
   235 	TRAPD(err, NextSetOfEventsL());
       
   236 	if (err != KErrNone)
       
   237 		{
       
   238 		INFO_PRINTF1( _L("ERRORS LOGGED IN epocwind.out") );
       
   239 		
       
   240 		iFailed = ETrue;
       
   241 		return;
       
   242 		}
       
   243 	// Start nested active scheduler
       
   244 	CActiveScheduler::Start();
       
   245 
       
   246 	
       
   247 	if ( (iControlCluster_1->iChildTwo->EventsLeft() > 0) || (iControlCluster_1->iChildOne->EventsLeft() > 0) )
       
   248 		{
       
   249 		INFO_PRINTF1( _L("ERROR INFO LOGGED IN epocwind.out") );
       
   250 		
       
   251 		iFailed=ETrue;
       
   252 		}
       
   253 	
       
   254 	delete iControlSimple;
       
   255 	iControlSimple = NULL;
       
   256 	DeleteControlClusterOne();	
       
   257 	}
       
   258 
       
   259 
       
   260 void CConeMultiPtrCompoundTestAppUi::RunTestsSimpleL()
       
   261 	{
       
   262 	iEventSet = 0;
       
   263 
       
   264 	// Instantiate afresh for each test-case.
       
   265 	iControlSimple = CMultiPtrTestCompoundAppUiControl::NewL( KMultPtrSmallSimplePosition, KMultPtrSmallSimpleSize );
       
   266 	
       
   267     iEventCount = 0;
       
   268 	TRAPD(err, NextSetOfEventsL());
       
   269 	if (err != KErrNone)
       
   270 		{
       
   271 		INFO_PRINTF1( _L("ERRORS LOGGED IN epocwind.out") );
       
   272 		
       
   273 		iFailed = ETrue;
       
   274 		return;
       
   275 		}
       
   276 	// Start nested active scheduler
       
   277 	CActiveScheduler::Start();
       
   278 
       
   279 	
       
   280 	if ( iControlSimple->EventsLeft() > 0 )
       
   281 		{
       
   282 		INFO_PRINTF1( _L("ERROR INFO LOGGED IN epocwind.out") );
       
   283 		
       
   284 		iFailed=ETrue;
       
   285 		}
       
   286 	
       
   287 	delete iControlSimple;
       
   288 	iControlSimple = NULL;
       
   289 	}
       
   290 
       
   291 
       
   292 void CConeMultiPtrCompoundTestAppUi::InstantiateControlClusterOneL()
       
   293 	{
       
   294 	iCoeEnv->WsSession().SetAutoFlush(ETrue);
       
   295 	iControlCluster_1 = new(ELeave) CMultPtrTestCompoundControlContainer();
       
   296 	CleanupStack::PushL( iControlCluster_1 );
       
   297 	iControlCluster_1->ConstructL( KMultPtrTestContainerRect );
       
   298     AddToStackL( iControlCluster_1 );
       
   299     CleanupStack::Pop();
       
   300 	}
       
   301 
       
   302 
       
   303 void CConeMultiPtrCompoundTestAppUi::DeleteControlClusterOne()
       
   304 	{
       
   305 	if( iControlCluster_1 )
       
   306 		{
       
   307 		RemoveFromStack( iControlCluster_1 );
       
   308 		delete iControlCluster_1;
       
   309 		iControlCluster_1 = NULL;	
       
   310 		}
       
   311 	
       
   312 	}
       
   313 
       
   314 
       
   315 void CConeMultiPtrCompoundTestAppUi::InstantiateControlClusterTwoL()
       
   316 	{
       
   317 	iControlCluster_2 = new(ELeave) CMultPtrTestCompoundControlContainer();
       
   318 	CleanupStack::PushL( iControlCluster_2 );
       
   319 	iControlCluster_2->ConstructL( KMultPtrTestContainerRectTwo );
       
   320     AddToStackL( iControlCluster_2 );
       
   321     CleanupStack::Pop();
       
   322     
       
   323     iControlCluster_2->iChildOne->SetAppUiCallback( EFalse );
       
   324     iControlCluster_2->iChildTwo->SetAppUiCallback( EFalse );
       
   325 	}
       
   326 
       
   327 
       
   328 void CConeMultiPtrCompoundTestAppUi::DeleteControlClusterTwo()
       
   329 	{
       
   330 	if( iControlCluster_2 )
       
   331 		{
       
   332 		RemoveFromStack( iControlCluster_2 );
       
   333 		delete iControlCluster_2;
       
   334 		iControlCluster_2 = NULL;	
       
   335 		}
       
   336 	
       
   337 	}
       
   338 
       
   339 
       
   340 /**
       
   341  Simulates pointer event, by making use of UserSvr::AddEvent. Also takes a Z parameter.
       
   342 */
       
   343 void CConeMultiPtrCompoundTestAppUi::SimulatePointer(TRawEvent::TType aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber)
       
   344 	{
       
   345 	__ASSERT_DEBUG(ConfigurationSupportsPointerEventTesting(), ConeTestCompoundPanic(EConePanicNoDigitiser));
       
   346 	TRawEvent rawEvent;
       
   347 
       
   348 	rawEvent.Set(aType, aX, aY, aZ, aPointerNumber);
       
   349 	UserSvr::AddEvent(rawEvent);
       
   350 	}
       
   351 
       
   352 void CConeMultiPtrCompoundTestAppUi::SimulatePointerDownUp(TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber)
       
   353 	{
       
   354 	SimulatePointer(TRawEvent::EButton1Down, aX, aY, aZ, aPointerNumber);
       
   355 	SimulatePointer(TRawEvent::EButton1Up, aX, aY, aZ, aPointerNumber);
       
   356 	}
       
   357 
       
   358 
       
   359 void CConeMultiPtrCompoundTestAppUi::AddExpectedPointer( TAdvancedPointerEvent::TType aType, TPoint aPos, TInt aZ, TUint8 aPointerNumber, CMultiPtrTestControlBase* aControl )
       
   360 	{
       
   361 	TWsEvent event;
       
   362 	TPoint3D point3D;
       
   363 	
       
   364 	point3D.iX = aPos.iX;
       
   365 	point3D.iY = aPos.iY;
       
   366 	point3D.iZ = aZ;
       
   367 	
       
   368 	// Note: this setter does not initialise the parent-position parameter.
       
   369 	// Note: The modifier value is or'd in, as it is a bit-field. The TAdvancedPointerEvent Init()function 
       
   370 	// should initialise it to EModifierAdvancedPointerEvent.
       
   371     event.InitAdvancedPointerEvent( aType, 0, point3D, aPointerNumber ); 
       
   372     event.Pointer()->iParentPosition.SetXY( aControl->Position().iX, aControl->Position().iY );
       
   373     
       
   374 	aControl->AddExpectedEvent( *event.Pointer() );
       
   375 	}
       
   376 
       
   377 
       
   378 void CConeMultiPtrCompoundTestAppUi::AddExpectedPointerDownUp( TPoint aPos, TInt aZ, TUint8 aPointerNumber, CMultiPtrTestControlBase* aControl )
       
   379 	{
       
   380 	// Pointer position is with respect to the window's Top Left position
       
   381 	// Here we may want to write a function which will set sent position with respect to control/window 
       
   382 	// on which we are simulating the events. 
       
   383 	//aPos -= iControl->Position();
       
   384 	AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, aPos, aZ, aPointerNumber, aControl );
       
   385 	AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, aPos, aZ, aPointerNumber, aControl );
       
   386 	}
       
   387 
       
   388 
       
   389 /**
       
   390  once all the events for a given sub test are tested. So that next subtest case can proceed with it.
       
   391  */
       
   392 void CConeMultiPtrCompoundTestAppUi::NextSetOfEventsL()
       
   393 	{
       
   394 	
       
   395 	switch( iTestCase )
       
   396 		{
       
   397 	case 0:
       
   398 		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0043"));
       
   399 		PreliminaryStimuliL();
       
   400 		RecordTestResultL();
       
   401 		break;
       
   402 
       
   403  	case 1:
       
   404  		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0036"));
       
   405 		SinglePtrProximityAndPressureL();
       
   406 		RecordTestResultL();
       
   407 		break;	
       
   408 	
       
   409  	case 2:
       
   410  		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0037"));
       
   411  		MultiplePtrProximityAndPressureL();
       
   412 		RecordTestResultL();
       
   413  		break;
       
   414  		
       
   415  	case 3:
       
   416  		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0043"));
       
   417  		PointerGrabbingL();
       
   418 		RecordTestResultL();
       
   419  		break;
       
   420 
       
   421 	case 4:
       
   422 		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0038"));
       
   423 		ClaimPointerGrabbingL();
       
   424 		RecordTestResultL();
       
   425 		break;
       
   426 	
       
   427 	case 5:
       
   428 		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0039"));
       
   429 		ClaimPointerGrabbingTwoWindowsL();
       
   430 		RecordTestResultL();
       
   431 		break;
       
   432 
       
   433 	case 6:
       
   434 		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0040"));
       
   435 		CapturePointerNotDeliveredToChildL();
       
   436 		RecordTestResultL();
       
   437 		break;
       
   438 	
       
   439 	case 7:
       
   440 		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0044"));
       
   441 		CapturePointerCycleL();
       
   442 		RecordTestResultL();
       
   443 		break;
       
   444 
       
   445 	case 8:
       
   446 		SetTestStepID(_L("UIF-WSERV-ADVANCEDPOINTER-0042"));
       
   447 		CycleToOutOfRangeL();
       
   448 		RecordTestResultL();
       
   449 		CloseTMSGraphicsStep();
       
   450 		break;
       
   451 
       
   452 	default:
       
   453 		{
       
   454 		ConeTestCompoundPanic( EConeTestPanicWrongTest );
       
   455 		}
       
   456 		break;
       
   457 		
       
   458 		}
       
   459 	
       
   460 	}
       
   461 
       
   462 
       
   463 /**
       
   464 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0043
       
   465 @SYMPREQ 				PREQ1226
       
   466 @SYMTestType			UT
       
   467 @SYMTestPriority		Critical
       
   468 @SYMTestStatus 			Implemented
       
   469 @SYMTestCaseDesc		Compound control, preliminary stimuli.
       
   470 @SYMTestActions			Instantiate the compound test-control. Perform pointer-down, pointer-up, pointer-exit-close-proximity events for each pointer in turn on one of the control’s children.
       
   471 						cf GRAPHICS-WSERV-ADVANCEDPOINTER-0002
       
   472 
       
   473 @SYMTestExpectedResults  The received events should match the simulated raw events.
       
   474 */
       
   475 void CConeMultiPtrCompoundTestAppUi::PreliminaryStimuliL()
       
   476 	{
       
   477 	INFO_PRINTF1( _L(">PreliminaryStimuli") );
       
   478 	RDebug::Print( _L(">PreliminaryStimuli") );
       
   479 	
       
   480 	if( iNumberOfPointers <= 1 )
       
   481 		{
       
   482 		User::Leave( KErrNotSupported );
       
   483 		}
       
   484 	
       
   485 	switch( iEventSet++ )
       
   486 		{
       
   487 		case 0:
       
   488 			{
       
   489 			INFO_PRINTF1( _L("PreliminaryStimuli case 0") );
       
   490 	
       
   491 			TPoint ptrPos( 140, 120 );
       
   492 			TInt z = KControlTestLessThanHighPressure;
       
   493 			TInt pointerNumber = 0;
       
   494 			
       
   495 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   496 				{
       
   497 				SimulatePointerDownUp( ptrPos.iX, ptrPos.iY, z, pointerNumber );
       
   498 				AddExpectedPointerDownUp( (ptrPos - iControlCluster_1->PositionRelativeToScreen()), z, pointerNumber, iControlCluster_1->iChildTwo );
       
   499 				
       
   500 				// Do this in order that the pointer states are neutral for the test/s that follow.
       
   501 				SimulatePointer( TRawEvent::EPointerMove, ptrPos.iX, ptrPos.iY, KControlTestExitCloseProximity, pointerNumber );
       
   502 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, (ptrPos - iControlCluster_1->PositionRelativeToScreen()), KControlTestExitCloseProximity, pointerNumber, iControlCluster_1->iChildTwo );
       
   503 
       
   504 				ptrPos.iX += KMultiPtrTestCoOrdinateIncrementSmall;
       
   505 				ptrPos.iY += KMultiPtrTestCoOrdinateIncrementSmall;
       
   506 				}
       
   507 
       
   508 			}
       
   509 			break;
       
   510 			
       
   511 		default:
       
   512 			{
       
   513 			CActiveScheduler::Stop();
       
   514 			iEventSet = 0;
       
   515 			INFO_PRINTF1( _L("PreliminaryStimuli STOP\n") );
       
   516 			RDebug::Print( _L("PreliminaryStimuli STOP") );
       
   517 			RDebug::Print( _L("") );
       
   518 			}
       
   519 			break;
       
   520 		}
       
   521 	
       
   522 	}
       
   523 
       
   524 
       
   525 /**
       
   526 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0036
       
   527 @SYMPREQ 				PREQ1226
       
   528 @SYMTestType			UT
       
   529 @SYMTestPriority		Critical
       
   530 @SYMTestStatus 			Implemented
       
   531 @SYMTestCaseDesc		Single pointer proximity and pressure events in Cone.
       
   532 @SYMTestActions			
       
   533 @SYMTestExpectedResults  The received events should match the simulated raw events.
       
   534 
       
   535 Note: The events generated by this test are quite numerous and so they are partitioned in order 
       
   536 	  to avoid exceeding the capacity of the window-server-side buffers. 
       
   537 */
       
   538 void CConeMultiPtrCompoundTestAppUi::SinglePtrProximityAndPressureL()
       
   539 	{
       
   540 	INFO_PRINTF1( _L(">SinglePtrProximityAndPressureL") );
       
   541 	RDebug::Print( _L(">SinglePtrProximityAndPressureL") );
       
   542 	
       
   543 	if( iNumberOfPointers <= 1 )
       
   544 		{
       
   545 		User::Leave( KErrNotSupported );
       
   546 		}
       
   547 	
       
   548 	TInt pointerNumber = 0;
       
   549 	const TInt KIntermediatePointerNumber = iNumberOfPointers / 2; 
       
   550 	const TInt KContainer_1_Child_2_X = 140;
       
   551 	const TInt KContainer_1_Child_2_Y = 120;
       
   552 	TPoint point( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
   553 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
   554 	TPoint parentPosition( iControlCluster_1->Position() );
       
   555 	TPoint expectedPoint( point - parentPosition );
       
   556 	CMultiPtrTestControlBase* expectedControl = iControlCluster_1->iChildTwo;
       
   557 	iControlCluster_1->iChildTwo->SetDrags();
       
   558 
       
   559 	
       
   560 	switch( iEventSet++ )
       
   561 		{
       
   562 		case 0:
       
   563 			{	
       
   564 			INFO_PRINTF1( _L("SinglePtrProximityAndPressureL case 0") );
       
   565 			RDebug::Print( _L("SinglePtrProximityAndPressureL case 0") );
       
   566 
       
   567 			for(; pointerNumber < KIntermediatePointerNumber; pointerNumber++ )
       
   568 				{
       
   569 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
   570 				AddExpectedPointer( TAdvancedPointerEvent::EMove, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );	
       
   571 				// Should be reported as EEnterCloseProximity
       
   572 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
   573 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
   574 				// EButton1Down (Not High pressure)
       
   575 				SimulatePointer( TRawEvent::EButton1Down, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   576 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   577 				// EEnterHighPressure
       
   578 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterHighPressure, pointerNumber );
       
   579 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedPoint, KControlTestEnterHighPressure, pointerNumber, expectedControl );
       
   580 				// EExitHighPressure
       
   581 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   582 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   583 				// EButton1up
       
   584 				SimulatePointer( TRawEvent::EButton1Up, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
   585 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
   586 				// EExitCloseProximity
       
   587 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
   588 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
   589 				
       
   590 				// Discriminate each pointer's event-sequence by position.
       
   591 				point += incPoint;
       
   592 				expectedPoint += incPoint;
       
   593 				}
       
   594 			
       
   595 			}
       
   596 			break;
       
   597 
       
   598 		case 1:
       
   599 			{	
       
   600 			INFO_PRINTF1( _L("SinglePtrProximityAndPressureL case 1") );
       
   601 			RDebug::Print( _L("SinglePtrProximityAndPressureL case 1") );
       
   602 			
       
   603 			pointerNumber = KIntermediatePointerNumber;
       
   604 			
       
   605 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   606 				{
       
   607 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
   608 				AddExpectedPointer( TAdvancedPointerEvent::EMove, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );	
       
   609 				// Should be reported as EEnterCloseProximity
       
   610 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
   611 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
   612 				// EButton1Down (Not High pressure)
       
   613 				SimulatePointer( TRawEvent::EButton1Down, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   614 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   615 				// EEnterHighPressure
       
   616 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterHighPressure, pointerNumber );
       
   617 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedPoint, KControlTestEnterHighPressure, pointerNumber, expectedControl );
       
   618 				// EExitHighPressure
       
   619 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   620 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   621 				// EButton1up
       
   622 				SimulatePointer( TRawEvent::EButton1Up, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
   623 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
   624 				// EExitCloseProximity
       
   625 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
   626 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
   627 				
       
   628 				// Discriminate each pointer's event-sequence by position.
       
   629 				point += incPoint;
       
   630 				expectedPoint += incPoint;
       
   631 				}
       
   632 			
       
   633 			}
       
   634 			break;
       
   635 
       
   636 		default:
       
   637 			{
       
   638 			CActiveScheduler::Stop();
       
   639 			iEventSet = 0;
       
   640 			
       
   641 			INFO_PRINTF1( _L("SinglePtrProximityAndPressureL STOP\n") );
       
   642 			INFO_PRINTF1( _L("") );
       
   643 			RDebug::Print( _L("SinglePtrProximityAndPressureL STOP") );
       
   644 			RDebug::Print( _L("") );
       
   645 			}
       
   646 			break;
       
   647 			
       
   648 		}	
       
   649 	
       
   650 	}
       
   651 
       
   652 
       
   653 
       
   654 /**
       
   655 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0037
       
   656 @SYMPREQ 				PREQ1226
       
   657 @SYMTestType			UT
       
   658 @SYMTestPriority		Critical
       
   659 @SYMTestStatus 			Implemented
       
   660 @SYMTestCaseDesc		Multiple (interdigitated) pointer proximity and pressure events in cone.
       
   661 @SYMTestActions			
       
   662 @SYMTestExpectedResults  The received events should match the simulated raw events.
       
   663 */
       
   664 void CConeMultiPtrCompoundTestAppUi::MultiplePtrProximityAndPressureL()
       
   665 	{
       
   666 	INFO_PRINTF1( _L(">MultiplePtrProximityAndPressureL") );
       
   667 	RDebug::Print( _L(">MultiplePtrProximityAndPressureL") );
       
   668 
       
   669 	if( iNumberOfPointers <= 1 )
       
   670 		{
       
   671 		User::Leave( KErrNotSupported );
       
   672 		}
       
   673 	
       
   674 	TInt pointerNumber = 0;
       
   675 	const TInt KContainer_1_Child_2_X = 140;
       
   676 	const TInt KContainer_1_Child_2_Y = 120;
       
   677 	TPoint point( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
   678 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
   679 	TPoint parentPosition( iControlCluster_1->Position() );
       
   680 	TPoint expectedPoint( point - parentPosition );
       
   681 	CMultiPtrTestControlBase* expectedControl = iControlCluster_1->iChildTwo;
       
   682 	iControlCluster_1->iChildTwo->SetDrags();
       
   683 
       
   684 
       
   685 	switch( iEventSet++ )
       
   686 		{	
       
   687 		case 0:
       
   688 			{
       
   689 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 0") );
       
   690 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 0") );
       
   691 			
       
   692 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   693 				{
       
   694 				// Should be reported as EMove
       
   695 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
   696 				AddExpectedPointer( TAdvancedPointerEvent::EMove, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
   697 			
       
   698 				// Discriminate each pointer's event-sequence by position.
       
   699 				point += incPoint;
       
   700 				expectedPoint += incPoint;
       
   701 				}
       
   702 			
       
   703 			}
       
   704 			break;
       
   705 		
       
   706 		case 1:
       
   707 			{
       
   708 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 1") );
       
   709 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 1") );
       
   710 			
       
   711 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   712 				{
       
   713 				// Should be reported as EEnterCloseProximity
       
   714 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
   715 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
   716 				
       
   717 				// Discriminate each pointer's event-sequence by position.
       
   718 				point += incPoint;
       
   719 				expectedPoint += incPoint;
       
   720 				}
       
   721 			
       
   722 			}
       
   723 			break;
       
   724 		
       
   725 		case 2:
       
   726 			{
       
   727 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 2") );
       
   728 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 2") );
       
   729 			
       
   730 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   731 				{
       
   732 				// EButton1Down (Not High pressure)
       
   733 				SimulatePointer( TRawEvent::EButton1Down, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   734 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   735 				
       
   736 				// Discriminate each pointer's event-sequence by position.
       
   737 				point += incPoint;
       
   738 				expectedPoint += incPoint;
       
   739 				}
       
   740 			
       
   741 			}
       
   742 			break;		
       
   743 		
       
   744 		
       
   745 		case 3:
       
   746 			{
       
   747 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 3") );
       
   748 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 3") );
       
   749 			
       
   750 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   751 				{
       
   752 				// EEnterHighPressure
       
   753 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterHighPressure, pointerNumber );
       
   754 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedPoint, KControlTestEnterHighPressure, pointerNumber, expectedControl );
       
   755 				
       
   756 				// Discriminate each pointer's event-sequence by position.
       
   757 				point += incPoint;
       
   758 				expectedPoint += incPoint;
       
   759 				}
       
   760 			
       
   761 			}
       
   762 			break;		
       
   763 
       
   764 		case 4:
       
   765 			{
       
   766 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 4") );
       
   767 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 4") );
       
   768 			
       
   769 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   770 				{
       
   771 				// EExitHighPressure
       
   772 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   773 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   774 				
       
   775 				// Discriminate each pointer's event-sequence by position.
       
   776 				point += incPoint;
       
   777 				expectedPoint += incPoint;
       
   778 				}
       
   779 			
       
   780 			}
       
   781 			break;	
       
   782 
       
   783 		case 5:
       
   784 			{
       
   785 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 5") );
       
   786 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 5") );
       
   787 			
       
   788 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   789 				{
       
   790 				// EButton1up
       
   791 				SimulatePointer( TRawEvent::EButton1Up, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
   792 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
   793 	
       
   794 				// Discriminate each pointer's event-sequence by position.
       
   795 				point += incPoint;
       
   796 				expectedPoint += incPoint;
       
   797 				}
       
   798 			
       
   799 			}
       
   800 			break;	
       
   801 		
       
   802 		case 6:
       
   803 			{
       
   804 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL case 6") );
       
   805 			RDebug::Print( _L("MultiplePtrProximityAndPressureL case 6") );
       
   806 			
       
   807 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   808 				{
       
   809 				// EExitCloseProximity
       
   810 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
   811 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
   812 				
       
   813 				// Discriminate each pointer's event-sequence by position.
       
   814 				point += incPoint;
       
   815 				expectedPoint += incPoint;
       
   816 				}
       
   817 			
       
   818 			}
       
   819 			break;	
       
   820 		
       
   821 		default:
       
   822 			{
       
   823 			CActiveScheduler::Stop();
       
   824 			iEventSet = 0;
       
   825 			
       
   826 			INFO_PRINTF1( _L("MultiplePtrProximityAndPressureL STOP\n") );
       
   827 			INFO_PRINTF1( _L("") );
       
   828 			RDebug::Print( _L("MultiplePtrProximityAndPressureL STOP") );
       
   829 			RDebug::Print( _L("") );
       
   830 			}
       
   831 			break;
       
   832 		
       
   833 		}	
       
   834 
       
   835 	}
       
   836 
       
   837 
       
   838 
       
   839 /**
       
   840 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0038
       
   841 @SYMPREQ 				PREQ1226
       
   842 @SYMTestType			UT
       
   843 @SYMTestPriority		Critical
       
   844 @SYMTestStatus 			Implemented
       
   845 @SYMTestCaseDesc		Grabbing in cone.
       
   846 @SYMTestActions			Simulate Pointer-down, pointer-move (outside of control), pointer-up events for each individual pointer.
       
   847 						Simulate interdigitated Pointer-down, pointer-move (outside of control), pointer-up events for each individual pointer.
       
   848 						Additionally, in each case discriminate each pointer's events by co-ordinate for clarity.
       
   849 
       
   850 @SYMTestExpectedResults  The grabbing control should receive the anticipated events.
       
   851 */
       
   852 void CConeMultiPtrCompoundTestAppUi::PointerGrabbingL()
       
   853 	{
       
   854 	INFO_PRINTF1( _L(">PointerGrabbingL") );
       
   855 	RDebug::Print( _L(">PointerGrabbingL") );
       
   856 	
       
   857 	if( iNumberOfPointers <= 1 )
       
   858 		{
       
   859 		User::Leave( KErrNotSupported );
       
   860 		}
       
   861 	
       
   862 	TInt pointerNumber = 0;
       
   863 	const TInt KContainer_1_Child_2_X = 140;
       
   864 	const TInt KContainer_1_Child_2_Y = 120;
       
   865 	
       
   866 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
   867 	TPoint downPoint( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
   868 	TPoint upPoint( KMultPtrTestCentreScreen );
       
   869 	upPoint -= incPoint; // Move in from centre screen
       
   870 	
       
   871 	TPoint parentPosition( iControlCluster_1->Position() );
       
   872 	TPoint expectedDownPoint( downPoint - parentPosition );
       
   873 	TPoint expectedUpPoint( upPoint - parentPosition );
       
   874 	
       
   875 	CMultiPtrTestControlBase* expectedControl = iControlCluster_1->iChildTwo;
       
   876 	iControlCluster_1->iChildTwo->SetDrags();
       
   877 	iControlCluster_1->iChildTwo->SetGrabs();
       
   878 
       
   879 
       
   880 	switch( iEventSet++ )
       
   881 		{
       
   882 		case 0:
       
   883 			{	
       
   884 			INFO_PRINTF1( _L("PointerGrabbingL case 0") );
       
   885 			RDebug::Print( _L("PointerGrabbingL case 0") );
       
   886 			// Simulate Pointer-down, pointer-move (outside of control), pointer-up events for each individual pointer in turn.
       
   887 			
       
   888 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   889 				{
       
   890 				SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   891 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedDownPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   892 				
       
   893 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   894 				AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   895 
       
   896 				SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
   897 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
   898 
       
   899 				// Discriminate each pointer's events by co-ordinate for clarity.
       
   900 				downPoint += incPoint;
       
   901 				expectedDownPoint += incPoint;
       
   902 				upPoint -= incPoint; // Move inward from the centre/edge of the screen
       
   903 				expectedUpPoint -= incPoint;
       
   904 				}
       
   905 			
       
   906 			}
       
   907 			break;
       
   908 
       
   909 			// Cases 1,2 and 3 form the interdigitated down-move-up sequence.
       
   910 		case 1:
       
   911 			{	
       
   912 			INFO_PRINTF1( _L("PointerGrabbingL case 1") );
       
   913 			RDebug::Print( _L("PointerGrabbingL case 1") );
       
   914 
       
   915 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   916 				{
       
   917 				SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   918 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedDownPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   919 			
       
   920 				downPoint += incPoint;
       
   921 				expectedDownPoint += incPoint;
       
   922 				}
       
   923 			
       
   924 			}
       
   925 			break;	
       
   926 
       
   927 		case 2:
       
   928 			{	
       
   929 			INFO_PRINTF1( _L("PointerGrabbingL case 2") );
       
   930 			RDebug::Print( _L("PointerGrabbingL case 2") );
       
   931 		
       
   932 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   933 				{
       
   934 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
   935 				AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
   936 
       
   937 				upPoint -= incPoint; // Move inward from the centre/edge of the screen
       
   938 				expectedUpPoint -= incPoint;
       
   939 				}
       
   940 			
       
   941 			}
       
   942 			break;	
       
   943 			
       
   944 		case 3:
       
   945 			{	
       
   946 			INFO_PRINTF1( _L("PointerGrabbingL case 3") );
       
   947 			RDebug::Print( _L("PointerGrabbingL case 3") );
       
   948 		
       
   949 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
   950 				{
       
   951 				SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
   952 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
   953 
       
   954 				upPoint -= incPoint; // Move inward from the centre/edge of the screen
       
   955 				expectedUpPoint -= incPoint;
       
   956 				}
       
   957 			
       
   958 			}
       
   959 			break;
       
   960 
       
   961 		default:
       
   962 			{
       
   963 			CActiveScheduler::Stop();
       
   964 			iEventSet = 0;
       
   965 			
       
   966 			INFO_PRINTF1( _L("PointerGrabbingL STOP\n") );
       
   967 			INFO_PRINTF1( _L("") );
       
   968 			RDebug::Print( _L("PointerGrabbingL STOP") );
       
   969 			RDebug::Print( _L("") );
       
   970 			}
       
   971 			break;
       
   972 			
       
   973 		}	
       
   974 	
       
   975 	}
       
   976 
       
   977 
       
   978 /**
       
   979 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0039
       
   980 @SYMPREQ 				PREQ1226
       
   981 @SYMTestType			UT
       
   982 @SYMTestPriority		Critical
       
   983 @SYMTestStatus 			Implemented
       
   984 @SYMTestCaseDesc		Claim grabbing in cone.
       
   985 @SYMTestActions			
       
   986 
       
   987 Phase 1
       
   988 Set child 2 of the compound test control to be grabbing.
       
   989 Simulate a pointer down event in child 2.
       
   990 Ensure it is delivered to Child2
       
   991 
       
   992 Set child 1 to claim the pointer grab using ClaimPointerGrab(TBool aSendUpEvent, TInt aPointerNumber )
       
   993 Simulate a drag and a pointer-up event.
       
   994 Ensure they are delivered to child 1
       
   995 
       
   996 Repeat for the range of pointer numbers
       
   997 
       
   998 
       
   999 Phase 2
       
  1000 Simulate a pointer down event in child 2.
       
  1001 Ensure it is delivered to Child2.
       
  1002 
       
  1003 Set child 1 to claim the pointer grab using ClaimPointerGrab(TBool aSendUpEvent, TInt aPointerNumber ).
       
  1004 Simulate enter-high-pressure outside of the control.
       
  1005 Simulate a drag outside of the control.
       
  1006 Simulate exit high pressure outside of control.
       
  1007 Simulate pointer-up outside of control (within proximity ).
       
  1008 Ensure these events are delivered to child 1.
       
  1009 
       
  1010 Simulate exit-close-proximity outside of the control 
       
  1011 Ensure it is not delivered.
       
  1012 
       
  1013 Repeat for the range of pointer numbers.
       
  1014 
       
  1015 
       
  1016 @SYMTestExpectedResults  The anticipated events are delivered to the intended child controls.
       
  1017 */
       
  1018 void CConeMultiPtrCompoundTestAppUi::ClaimPointerGrabbingL()
       
  1019 	{
       
  1020 	
       
  1021 	INFO_PRINTF1( _L(">ClaimPointerGrabbingL") );
       
  1022 	RDebug::Print( _L(">ClaimPointerGrabbingL") );
       
  1023 	
       
  1024 	if( iNumberOfPointers <= 1 )
       
  1025 		{
       
  1026 		User::Leave( KErrNotSupported );
       
  1027 		}
       
  1028 	
       
  1029 	TInt pointerNumber = 0;
       
  1030 	const TInt KContainer_1_Child_2_X = 140;
       
  1031 	const TInt KContainer_1_Child_2_Y = 120;
       
  1032 	
       
  1033 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
  1034 	TPoint downPoint( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
  1035 	TPoint upPoint( KMultPtrTestCentreScreen );
       
  1036 	upPoint -= incPoint; // move in from the centre/edge of the screen
       
  1037 	TPoint parentPosition( iControlCluster_1->Position() );
       
  1038 	TPoint expectedDownPoint( downPoint - parentPosition );
       
  1039 	TPoint expectedUpPoint( upPoint - parentPosition );
       
  1040 	
       
  1041 	CMultiPtrTestControlBase* childTwoAsExpectedControl = iControlCluster_1->iChildTwo;
       
  1042 	CMultiPtrTestControlBase* childOneAsExpectedControl = iControlCluster_1->iChildOne;
       
  1043 	iControlCluster_1->iChildTwo->SetDrags();
       
  1044 	iControlCluster_1->iChildTwo->SetGrabs();
       
  1045 
       
  1046 
       
  1047 	switch( iEventSet++ )
       
  1048 		{
       
  1049 		case 0:
       
  1050 			{
       
  1051 			INFO_PRINTF1( _L("ClaimPointerGrabbingL case 0") );
       
  1052 			RDebug::Print( _L("ClaimPointerGrabbingL case 0") );
       
  1053 			
       
  1054 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1055 				{
       
  1056 				// Down in Child2
       
  1057 				SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1058 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedDownPoint, KControlTestLessThanHighPressure, pointerNumber, childTwoAsExpectedControl );	  
       
  1059 				// Grabbed by Child1
       
  1060 				iControlCluster_1->iChildOne->ClaimPointerGrab( pointerNumber, EFalse );
       
  1061 				// Drag-event reported in Child1
       
  1062 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1063 				AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestLessThanHighPressure, pointerNumber, childOneAsExpectedControl );				
       
  1064 				// Up-event reported in Child1
       
  1065 				SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1066 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestExitCloseProximity, pointerNumber, childOneAsExpectedControl );
       
  1067 
       
  1068 				downPoint += incPoint;
       
  1069 				expectedDownPoint += incPoint;
       
  1070 				
       
  1071 				if( (pointerNumber + 1) == iNumberOfPointers )
       
  1072 					{
       
  1073 					// This prevents Chilld2 precipitating the destruction of the control before Child1 has reported the last event/s.
       
  1074 					iControlCluster_1->iChildTwo->SetAppUiCallback( EFalse );
       
  1075 					}
       
  1076 				
       
  1077 				}
       
  1078 
       
  1079 			}
       
  1080 			break;
       
  1081 
       
  1082 		case 1:
       
  1083 			{
       
  1084 			INFO_PRINTF1( _L("ClaimPointerGrabbingL case 1") );
       
  1085 			RDebug::Print( _L("ClaimPointerGrabbingL case 1") );
       
  1086 			
       
  1087 			iControlCluster_1->iChildTwo->SetAppUiCallback( ETrue );
       
  1088 			
       
  1089 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1090 			//for(; pointerNumber < 2; pointerNumber++ )
       
  1091 				{
       
  1092 				// Down in Child2
       
  1093 				SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1094 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedDownPoint, KControlTestLessThanHighPressure, pointerNumber, childTwoAsExpectedControl );	  
       
  1095 				// Grabbed by Child1
       
  1096 				iControlCluster_1->iChildOne->ClaimPointerGrab( pointerNumber, EFalse );
       
  1097 				// Enter high presssure reported in Child1
       
  1098 				SimulatePointer( TRawEvent::EPointerMove, downPoint.iX, downPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1099 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedDownPoint, KControlTestEnterHighPressure, pointerNumber, childOneAsExpectedControl );
       
  1100 				// Drag-event reported in Child1
       
  1101 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1102 				AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestEnterHighPressure, pointerNumber, childOneAsExpectedControl );
       
  1103 				// Exit high pressure reported in Child1
       
  1104 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestExitHighPressure, pointerNumber );
       
  1105 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedUpPoint, KControlTestExitHighPressure, pointerNumber, childOneAsExpectedControl );
       
  1106 				// up,  reported in Child1
       
  1107 				SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1108 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestEnterCloseProximity, pointerNumber, childOneAsExpectedControl );
       
  1109 
       
  1110 				// exit close proximity. Outside both controls so not reported
       
  1111 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1112 		
       
  1113 				downPoint += incPoint;
       
  1114 				expectedDownPoint += incPoint;
       
  1115 				
       
  1116 				if( (pointerNumber + 1) == iNumberOfPointers )
       
  1117 					{
       
  1118 					// This prevents Chilld2 precipitating the destruction of the control before Child1 has reported the last event/s.
       
  1119 					iControlCluster_1->iChildTwo->SetAppUiCallback( EFalse );
       
  1120 					}
       
  1121 				
       
  1122 				}
       
  1123 
       
  1124 			}
       
  1125 			break;
       
  1126 	
       
  1127 		case 2:
       
  1128 			{
       
  1129 			INFO_PRINTF1( _L("ClaimPointerGrabbingL case 2") );
       
  1130 			RDebug::Print( _L("ClaimPointerGrabbingL case 2") );
       
  1131 
       
  1132 			// Down in Child2
       
  1133 			SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, TAdvancedPointerEvent::EDefaultPointerNumber );
       
  1134 			AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedDownPoint, KControlTestLessThanHighPressure, TAdvancedPointerEvent::EDefaultPointerNumber, childTwoAsExpectedControl );	  
       
  1135 			// Grabbed by Child1 (the original method)
       
  1136 			iControlCluster_1->iChildOne->ClaimPointerGrab( EFalse );
       
  1137 			// Drag-event reported in Child1
       
  1138 			SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestLessThanHighPressure, TAdvancedPointerEvent::EDefaultPointerNumber );
       
  1139 			AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestLessThanHighPressure, TAdvancedPointerEvent::EDefaultPointerNumber, childOneAsExpectedControl );
       
  1140 			// Up-event reported in Child1
       
  1141 			SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, TAdvancedPointerEvent::EDefaultPointerNumber );
       
  1142 			AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestExitCloseProximity, TAdvancedPointerEvent::EDefaultPointerNumber, childOneAsExpectedControl );
       
  1143 
       
  1144 			// This prevents Chilld2 precipitating the destruction of the control before Child1 has reported the last event/s.
       
  1145 			iControlCluster_1->iChildTwo->SetAppUiCallback( EFalse );
       
  1146 			}
       
  1147 			break;
       
  1148 			
       
  1149 		default:
       
  1150 			{
       
  1151 			CActiveScheduler::Stop();
       
  1152 			iEventSet = 0;
       
  1153 	
       
  1154 			INFO_PRINTF1( _L("ClaimPointerGrabbingL STOP\n") );
       
  1155 			INFO_PRINTF1( _L("") );
       
  1156 			RDebug::Print( _L("ClaimPointerGrabbingL STOP") );
       
  1157 			RDebug::Print( _L("") );
       
  1158 			}
       
  1159 			break;
       
  1160 		
       
  1161 		}		
       
  1162 	}
       
  1163 
       
  1164 
       
  1165 /**
       
  1166 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0039 Part 2
       
  1167 @SYMPREQ 				PREQ1226
       
  1168 @SYMTestType			UT
       
  1169 @SYMTestPriority		Critical
       
  1170 @SYMTestStatus 			Implemented
       
  1171 @SYMTestCaseDesc		Claim grabbing in cone.
       
  1172 @SYMTestActions			
       
  1173 
       
  1174 Instantiate a compound test-control and a simple window-owning control
       
  1175 
       
  1176 Phase 3
       
  1177 Simulate a pointer-down event on simple window-owning control.
       
  1178 This will not be reported
       
  1179 
       
  1180 Set control 1, child 1 to claim the grab using ClaimPointerGrab(TBool aSendUpEvent, TInt aPointerNumber )
       
  1181 
       
  1182 Simulate a drag outside of both controls.
       
  1183 Simulate a pointer-up event, within close proximity.
       
  1184 Ensure these events are delivered to Control 1, child 1.
       
  1185 
       
  1186 Repeat for the range of supported pointers.
       
  1187 
       
  1188 Phase 4
       
  1189 Set the simple window-owning control to be grabbing.
       
  1190 Simulate a pointer-down event on the simple control.
       
  1191 
       
  1192 Set control 1, child 1 to claim the grab using ClaimPointerGrab(TBool aSendUpEvent, TInt aPointerNumber )
       
  1193 
       
  1194 Simulate a drag outside of both controls.
       
  1195 Simulate an Enter-high-pressure event  outside of both controls.
       
  1196 Simulate an exit-high-pressure event outside of both controls.
       
  1197 Simulate a pointer-up event, within close proximity.
       
  1198 Ensure these are delivered to Control1, child1
       
  1199 
       
  1200 Simulate an exit-close-proximity event outside both controls. This should not be delivered.
       
  1201 
       
  1202 Repeat for the range of pointer numbers.
       
  1203 
       
  1204 
       
  1205 @SYMTestExpectedResults  The anticipated events are delivered to the expected controls.
       
  1206 */
       
  1207 void CConeMultiPtrCompoundTestAppUi::ClaimPointerGrabbingTwoWindowsL()
       
  1208 	{
       
  1209 	
       
  1210 	INFO_PRINTF1( _L(">ClaimPointerGrabbingTwoWindowsL") );
       
  1211 	RDebug::Print( _L(">ClaimPointerGrabbingTwoWindowsL") );
       
  1212 	
       
  1213 	if( iNumberOfPointers <= 1 )
       
  1214 		{
       
  1215 		User::Leave( KErrNotSupported );
       
  1216 		}
       
  1217 	
       
  1218 	TInt pointerNumber = 0;
       
  1219 	
       
  1220 	const TInt KControlSimplePoint_X = KMultPtrSmallSimplePosition.iX + 5;
       
  1221 	const TInt KControlSimplePoint_Y = KMultPtrSmallSimplePosition.iY + 5;
       
  1222 	
       
  1223 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
  1224 	TPoint downPoint( KControlSimplePoint_X, KControlSimplePoint_Y );
       
  1225 	TPoint upPoint( KMultPtrTestCentreScreen );
       
  1226 	upPoint -= incPoint; // Move in from the centre/edge of the screen.
       
  1227 	TPoint parentPosition( iControlCluster_1->Position() );
       
  1228 	TPoint expectedUpPoint( upPoint - parentPosition );
       
  1229 	
       
  1230 	CMultiPtrTestControlBase* childOneAsExpectedControl = iControlCluster_1->iChildOne;
       
  1231 	iControlCluster_1->iChildTwo->SetDrags();
       
  1232 	iControlCluster_1->iChildTwo->SetGrabs();
       
  1233 	
       
  1234 	iControlSimple->SetDrags();
       
  1235 	iControlSimple->SetGrabs();
       
  1236 	iControlSimple->SetPassive();
       
  1237 	
       
  1238 	switch( iEventSet++ )
       
  1239 		{
       
  1240 		case 0:
       
  1241 			{
       
  1242 			INFO_PRINTF1( _L("ClaimPointerGrabbingTwoWindowsL case 0") );
       
  1243 			RDebug::Print( _L("ClaimPointerGrabbingTwoWindowsL case 0") );
       
  1244 			
       
  1245 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1246 				{
       
  1247 				// Down in the Simple control. Not reported.
       
  1248 				SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1249 				// Grabbed by Cluster1, Child1
       
  1250 				iControlCluster_1->iChildOne->ClaimPointerGrab( pointerNumber, EFalse );
       
  1251 				// Drag-event reported in Cluster1, Child1
       
  1252 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1253 				AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestLessThanHighPressure, pointerNumber, childOneAsExpectedControl );
       
  1254 				// Up-event reported in Cluster1, Child1
       
  1255 				SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1256 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestExitCloseProximity, pointerNumber, childOneAsExpectedControl );
       
  1257 				}
       
  1258 
       
  1259 			}
       
  1260 			break;
       
  1261 
       
  1262 		case 1:
       
  1263 			{
       
  1264 			INFO_PRINTF1( _L("ClaimPointerGrabbingTwoWindowsL case 1") );
       
  1265 			RDebug::Print( _L("ClaimPointerGrabbingTwoWindowsL case 1") );
       
  1266 			
       
  1267 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1268 				{
       
  1269 				// Down in the Simple control. Not reported.
       
  1270 				SimulatePointer( TRawEvent::EButton1Down, downPoint.iX, downPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1271 				// Grabbed by Cluster1, Child1
       
  1272 				iControlCluster_1->iChildOne->ClaimPointerGrab( pointerNumber, EFalse );
       
  1273 				// Drag-event reported in Cluster1, Child1
       
  1274 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1275 				AddExpectedPointer( TAdvancedPointerEvent::EDrag, expectedUpPoint, KControlTestLessThanHighPressure, pointerNumber, childOneAsExpectedControl );
       
  1276 				// Enter high pressure
       
  1277 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1278 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedUpPoint, KControlTestEnterHighPressure, pointerNumber, childOneAsExpectedControl );			
       
  1279 				// Exit high pressure
       
  1280 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestExitHighPressure, pointerNumber );
       
  1281 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedUpPoint, KControlTestExitHighPressure, pointerNumber, childOneAsExpectedControl );
       
  1282 				// Up event (in proximity)
       
  1283 				SimulatePointer( TRawEvent::EButton1Up, upPoint.iX, upPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1284 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedUpPoint, KControlTestEnterCloseProximity, pointerNumber, childOneAsExpectedControl );
       
  1285 				
       
  1286 				// Exit close proximity (not reported).
       
  1287 				SimulatePointer( TRawEvent::EPointerMove, upPoint.iX, upPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1288 				}
       
  1289 
       
  1290 			}
       
  1291 			break;
       
  1292 					
       
  1293 		default:
       
  1294 			{
       
  1295 			CActiveScheduler::Stop();
       
  1296 			iEventSet = 0;
       
  1297 			
       
  1298 			INFO_PRINTF1( _L("ClaimPointerGrabbingTwoWindowsL STOP\n") );
       
  1299 			INFO_PRINTF1( _L("") );
       
  1300 			RDebug::Print( _L("ClaimPointerGrabbingTwoWindowsL STOP") );
       
  1301 			RDebug::Print( _L("") );
       
  1302 			}
       
  1303 			break;
       
  1304 		
       
  1305 		}	
       
  1306 
       
  1307 	}
       
  1308 
       
  1309 
       
  1310 /**
       
  1311 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0044
       
  1312 @SYMPREQ 				PREQ1226
       
  1313 @SYMTestType			UT
       
  1314 @SYMTestPriority		Critical
       
  1315 @SYMTestStatus 			Implemented
       
  1316 @SYMTestCaseDesc		Capture the cycle of pointer events.
       
  1317 @SYMTestActions			Instantiate a compound control and a simple control. Set the simple control to 
       
  1318 						capture pointer events. Simulate events on child-2 of the compound control. Ensure they are
       
  1319 						delivered to the capturing simple control.
       
  1320 						
       
  1321 @SYMTestExpectedResults  The capturing simple-control should receive the simulated events
       
  1322 */
       
  1323 void CConeMultiPtrCompoundTestAppUi::CapturePointerCycleL()
       
  1324 	{
       
  1325 	INFO_PRINTF1( _L(">CapturePointerCycleL") );
       
  1326 	RDebug::Print( _L(">CapturePointerCycleL") );	
       
  1327 	
       
  1328 	if( iNumberOfPointers <= 1 )
       
  1329 		{
       
  1330 		User::Leave( KErrNotSupported );
       
  1331 		}	
       
  1332 	
       
  1333 	const TInt KIntermediatePointerNumber = iNumberOfPointers / 2;
       
  1334 	const TInt KContainer_1_Child_2_X = 140;
       
  1335 	const TInt KContainer_1_Child_2_Y = 120;
       
  1336 	
       
  1337 	TInt pointerNumber = 0;
       
  1338 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
  1339 	TPoint actionPoint( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
  1340 	TPoint resultPoint( actionPoint - KMultPtrSmallSimplePosition );
       
  1341 
       
  1342 	
       
  1343 	switch( iEventSet++ )
       
  1344 		{
       
  1345 		case 0:
       
  1346 			{
       
  1347 			INFO_PRINTF1( _L("CapturePointerCycleL case 0") );
       
  1348 			RDebug::Print( _L("CapturePointerCycleL case 0") );
       
  1349 			
       
  1350 			iControlSimple->SetDrags();
       
  1351 			iControlSimple->SetGloballyCapturing( ETrue );
       
  1352 			iControlSimple->SetPointerCapture( ETrue );
       
  1353 
       
  1354 			for(; pointerNumber < KIntermediatePointerNumber; pointerNumber++ )
       
  1355 				{
       
  1356 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1357 				AddExpectedPointer( TAdvancedPointerEvent::EMove, resultPoint, KControlTestExitCloseProximity, pointerNumber, iControlSimple );
       
  1358 				// Should be reported as EEnterCloseProximity
       
  1359 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1360 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, resultPoint, KControlTestEnterCloseProximity, pointerNumber, iControlSimple );
       
  1361 				// EButton1Down (Not High pressure)
       
  1362 				SimulatePointer( TRawEvent::EButton1Down, actionPoint.iX, actionPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1363 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, resultPoint, KControlTestLessThanHighPressure, pointerNumber, iControlSimple );
       
  1364 				// EEnterHighPressure
       
  1365 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1366 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, resultPoint, KControlTestEnterHighPressure, pointerNumber, iControlSimple );
       
  1367 				// EExitHighPressure
       
  1368 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1369 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, resultPoint, KControlTestLessThanHighPressure, pointerNumber, iControlSimple );
       
  1370 				// EButton1up
       
  1371 				SimulatePointer( TRawEvent::EButton1Up, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1372 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, resultPoint, KControlTestEnterCloseProximity, pointerNumber, iControlSimple );
       
  1373 				// EExitCloseProximity
       
  1374 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1375 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, resultPoint, KControlTestExitCloseProximity, pointerNumber, iControlSimple );
       
  1376 
       
  1377 				// EOutOfRange  ** Note: The three co-ordinates received with the EOutOfRange event are the last known co-ordinates of the pointer.
       
  1378 				//						 ie the co-ordinates of the previous event
       
  1379 				TPoint madeUpPoint( 1, 2 );
       
  1380 				SimulatePointer( TRawEvent::EPointer3DOutOfRange, madeUpPoint.iX, madeUpPoint.iY, KControlTestOutOfRange, pointerNumber );
       
  1381 				AddExpectedPointer( TAdvancedPointerEvent::EOutOfRange, resultPoint, KControlTestExitCloseProximity, pointerNumber, iControlSimple );
       
  1382 
       
  1383 				actionPoint += incPoint; // Differentiate each pointer's events by co-ordinate.
       
  1384 				resultPoint += incPoint;
       
  1385 				}
       
  1386 				
       
  1387 			}
       
  1388 			break;
       
  1389 
       
  1390 		case 1:
       
  1391 			{
       
  1392 			INFO_PRINTF1( _L("CapturePointerCycleL case 1") );
       
  1393 			RDebug::Print( _L("CapturePointerCycleL case 1") );
       
  1394 
       
  1395 			for( pointerNumber = KIntermediatePointerNumber; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1396 				{
       
  1397 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1398 				AddExpectedPointer( TAdvancedPointerEvent::EMove, resultPoint, KControlTestExitCloseProximity, pointerNumber, iControlSimple );
       
  1399 				// Should be reported as EEnterCloseProximity
       
  1400 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1401 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, resultPoint, KControlTestEnterCloseProximity, pointerNumber, iControlSimple );
       
  1402 				// EButton1Down (Not High pressure)
       
  1403 				SimulatePointer( TRawEvent::EButton1Down, actionPoint.iX, actionPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1404 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, resultPoint, KControlTestLessThanHighPressure, pointerNumber, iControlSimple );
       
  1405 				// EEnterHighPressure
       
  1406 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1407 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, resultPoint, KControlTestEnterHighPressure, pointerNumber, iControlSimple );
       
  1408 				// EExitHighPressure
       
  1409 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1410 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, resultPoint, KControlTestLessThanHighPressure, pointerNumber, iControlSimple );
       
  1411 				// EButton1up
       
  1412 				SimulatePointer( TRawEvent::EButton1Up, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1413 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, resultPoint, KControlTestEnterCloseProximity, pointerNumber, iControlSimple );
       
  1414 				// EExitCloseProximity
       
  1415 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1416 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, resultPoint, KControlTestExitCloseProximity, pointerNumber, iControlSimple );
       
  1417 
       
  1418 				// EOutOfRange  ** Note: The three co-ordinates received with the EOutOfRange event are the last known co-ordinates of the pointer.
       
  1419 				//						 ie the co-ordinates of the previous event
       
  1420 				TPoint madeUpPoint( 1, 2 );
       
  1421 				SimulatePointer( TRawEvent::EPointer3DOutOfRange, madeUpPoint.iX, madeUpPoint.iY, KControlTestOutOfRange, pointerNumber );
       
  1422 				AddExpectedPointer( TAdvancedPointerEvent::EOutOfRange, resultPoint, KControlTestExitCloseProximity, pointerNumber, iControlSimple );
       
  1423 
       
  1424 				actionPoint += incPoint; // Differentiate each pointer's events by co-ordinate.
       
  1425 				resultPoint += incPoint;
       
  1426 				}
       
  1427 				
       
  1428 			}
       
  1429 			break;
       
  1430 			
       
  1431 		default:
       
  1432 			{
       
  1433 			CActiveScheduler::Stop();
       
  1434 			iEventSet = 0;
       
  1435 			
       
  1436 			INFO_PRINTF1( _L("CapturePointerCycleL STOP\n") );
       
  1437 			INFO_PRINTF1( _L("") );
       
  1438 			RDebug::Print( _L("CapturePointerCycleL STOP") );
       
  1439 			RDebug::Print( _L("") );
       
  1440 			}
       
  1441 			break;
       
  1442 	
       
  1443 		}
       
  1444 			
       
  1445 	}
       
  1446 
       
  1447 
       
  1448 /**
       
  1449 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0040
       
  1450 @SYMPREQ 				PREQ1226
       
  1451 @SYMTestType			UT
       
  1452 @SYMTestPriority		Critical
       
  1453 @SYMTestStatus 			Implemented
       
  1454 @SYMTestCaseDesc		Ensure that captured pointer events are discarded by Cone and not delivered to child controls.
       
  1455 @SYMTestActions			Configure one of the compound control's children to capture. Perform the full sequence of pointer 
       
  1456 						z-events outside the parent. Ensure that Cone does not deliver these events to the 
       
  1457 						child controls. cf GRAPHICS-WSERV-ADVANCEDPOINTER-0020.
       
  1458 
       
  1459 @SYMTestExpectedResults  The nominated child control should _not_ receive the generated events.
       
  1460 */
       
  1461 void CConeMultiPtrCompoundTestAppUi::CapturePointerNotDeliveredToChildL()
       
  1462 	{
       
  1463 	INFO_PRINTF1( _L(">CapturePointerNotDeliveredToChildL") );
       
  1464 	RDebug::Print( _L(">CapturePointerNotDeliveredToChildL") );
       
  1465 	
       
  1466 	if( iNumberOfPointers <= 1 )
       
  1467 		{
       
  1468 		User::Leave( KErrNotSupported );
       
  1469 		}
       
  1470 	
       
  1471 	const TInt KIntermediatePointerNumber = iNumberOfPointers / 2;
       
  1472 	TInt pointerNumber = 0;
       
  1473 	const TInt KContainer_1_Child_2_X = 140;
       
  1474 	const TInt KContainer_1_Child_2_Y = 120;
       
  1475 	
       
  1476 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
  1477 	TPoint actionPoint( KMultPtrTestCentreScreen );
       
  1478 	actionPoint -= incPoint;
       
  1479 	TPoint finishPoint( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
  1480 
       
  1481 	switch( iEventSet++ )
       
  1482 		{
       
  1483 		case 0:
       
  1484 			{
       
  1485 			INFO_PRINTF1( _L("CapturePointerNotDeliveredToChildL case 0") );
       
  1486 			RDebug::Print( _L("CapturePointerNotDeliveredToChildL case 0") );
       
  1487 
       
  1488 			iControlCluster_1->iChildOne->SetGloballyCapturing( ETrue );
       
  1489 			iControlCluster_1->iChildOne->SetPointerCapture( ETrue );
       
  1490 			
       
  1491 			for(; pointerNumber < KIntermediatePointerNumber; pointerNumber++ )
       
  1492 				{
       
  1493 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1494 				SimulatePointer( TRawEvent::EButton1Down, actionPoint.iX, actionPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1495 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1496 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitHighPressure, pointerNumber );
       
  1497 				SimulatePointer( TRawEvent::EButton1Up, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1498 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );	
       
  1499 				SimulatePointer( TRawEvent::EPointer3DOutOfRange, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1500 				
       
  1501 				actionPoint -= incPoint; // Move inward from the centre/edge of the screen
       
  1502 				}
       
  1503 
       
  1504 			// Simulate some events which _will be delivered (in order to finish the test).
       
  1505 			pointerNumber = 0;
       
  1506 
       
  1507 			SimulatePointerDownUp( finishPoint.iX, finishPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1508 			AddExpectedPointerDownUp( (finishPoint - iControlCluster_1->PositionRelativeToScreen()), KControlTestLessThanHighPressure, pointerNumber, iControlCluster_1->iChildTwo );
       
  1509 			// Do this in order that the pointer states are neutral for the test/s that follow.
       
  1510 			SimulatePointer( TRawEvent::EPointerMove, finishPoint.iX, finishPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1511 			AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, (finishPoint - iControlCluster_1->PositionRelativeToScreen()), KControlTestExitCloseProximity, pointerNumber, iControlCluster_1->iChildTwo );
       
  1512 			}
       
  1513 			break;
       
  1514 
       
  1515 		case 1:
       
  1516 			{
       
  1517 			INFO_PRINTF1( _L("CapturePointerNotDeliveredToChildL case 1") );
       
  1518 			RDebug::Print( _L("CapturePointerNotDeliveredToChildL case 1") );
       
  1519 
       
  1520 			iControlCluster_1->iChildOne->SetGloballyCapturing( ETrue );
       
  1521 			iControlCluster_1->iChildOne->SetPointerCapture( ETrue );
       
  1522 			pointerNumber = KIntermediatePointerNumber;
       
  1523 			
       
  1524 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1525 				{
       
  1526 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1527 				SimulatePointer( TRawEvent::EButton1Down, actionPoint.iX, actionPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1528 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1529 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitHighPressure, pointerNumber );
       
  1530 				SimulatePointer( TRawEvent::EButton1Up, actionPoint.iX, actionPoint.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1531 				SimulatePointer( TRawEvent::EPointerMove, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );	
       
  1532 				SimulatePointer( TRawEvent::EPointer3DOutOfRange, actionPoint.iX, actionPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1533 				
       
  1534 				actionPoint -= incPoint; // Move inward from the centre/edge of the screen
       
  1535 				}
       
  1536 			
       
  1537 			// Simulate some events which _will be delivered  (in order to finish the test).
       
  1538 			pointerNumber = 0;
       
  1539 
       
  1540 			SimulatePointerDownUp( finishPoint.iX, finishPoint.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1541 			AddExpectedPointerDownUp( (finishPoint - iControlCluster_1->PositionRelativeToScreen()), KControlTestLessThanHighPressure, pointerNumber, iControlCluster_1->iChildTwo );	
       
  1542 			// Do this in order that the pointer states are neutral for the test/s that follow.
       
  1543 			SimulatePointer( TRawEvent::EPointerMove, finishPoint.iX, finishPoint.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1544 			AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, (finishPoint - iControlCluster_1->PositionRelativeToScreen()), KControlTestExitCloseProximity, pointerNumber, iControlCluster_1->iChildTwo );
       
  1545 			}
       
  1546 			break;
       
  1547 			
       
  1548 		default:
       
  1549 			{
       
  1550 			CActiveScheduler::Stop();
       
  1551 			iEventSet = 0;
       
  1552 			
       
  1553 			INFO_PRINTF1( _L("CapturePointerNotDeliveredToChildL STOP\n") );
       
  1554 			INFO_PRINTF1( _L("") );
       
  1555 			RDebug::Print( _L("CapturePointerNotDeliveredToChildL STOP") );
       
  1556 			RDebug::Print( _L("") );
       
  1557 			}
       
  1558 			break;
       
  1559 		}
       
  1560 	
       
  1561 	}
       
  1562 
       
  1563 
       
  1564 /**
       
  1565 @SYMTestCaseID 			UIF-WSERV-ADVANCEDPOINTER-0042
       
  1566 @SYMPREQ 				PREQ1226
       
  1567 @SYMTestType			UT
       
  1568 @SYMTestPriority		Critical
       
  1569 @SYMTestStatus 			Implemented
       
  1570 @SYMTestCaseDesc		Pointers cycle to out of range.
       
  1571 @SYMTestActions			Simulate the full cycle of each pointer's z-events
       
  1572 						cf GRAPHICS-WSERV-ADVANCEDPOINTER-0016
       
  1573 
       
  1574 @SYMTestExpectedResults  The designated child control should receive the anticipated events,
       
  1575 						 culminating in the EOutOfRange event, which should bear the last known co-ordinates, ie
       
  1576 						 the previous event's co-ordinates.
       
  1577 */
       
  1578 void CConeMultiPtrCompoundTestAppUi::CycleToOutOfRangeL()
       
  1579 	{
       
  1580 	INFO_PRINTF1( _L(">MoveAndOutOfRangeL") );
       
  1581 	RDebug::Print( _L(">MoveAndOutOfRangeL") );
       
  1582 	
       
  1583 	if( iNumberOfPointers <= 1 )
       
  1584 		{
       
  1585 		User::Leave( KErrNotSupported );
       
  1586 		}
       
  1587 	
       
  1588 	TInt pointerNumber = 0;
       
  1589 	const TInt KIntermediatePointerNumber = iNumberOfPointers / 2;
       
  1590 	const TInt KContainer_1_Child_2_X = 140;
       
  1591 	const TInt KContainer_1_Child_2_Y = 120;
       
  1592 	TPoint point( KContainer_1_Child_2_X, KContainer_1_Child_2_Y );
       
  1593 	TPoint incPoint( KMultiPtrTestCoOrdinateIncrementSmall, KMultiPtrTestCoOrdinateIncrementSmall );
       
  1594 	TPoint parentPosition( iControlCluster_1->Position() );
       
  1595 	TPoint expectedPoint( point - parentPosition );
       
  1596 	TPoint madeUpPoint( 1234, 2345 );
       
  1597 	CMultiPtrTestControlBase* expectedControl = iControlCluster_1->iChildTwo;
       
  1598 	iControlCluster_1->iChildTwo->SetDrags();
       
  1599 	
       
  1600 	switch( iEventSet++ )
       
  1601 		{
       
  1602 		case 0:
       
  1603 			{	
       
  1604 			INFO_PRINTF1( _L("MoveAndOutOfRangeL case 0") );
       
  1605 			RDebug::Print( _L("MoveAndOutOfRangeL case 0") );
       
  1606 
       
  1607 			for(; pointerNumber < KIntermediatePointerNumber; pointerNumber++ )
       
  1608 				{
       
  1609 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1610 				AddExpectedPointer( TAdvancedPointerEvent::EMove, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
  1611 			
       
  1612 				// Should be reported as EEnterCloseProximity
       
  1613 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1614 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
  1615 				// EButton1Down (Not High pressure)
       
  1616 				SimulatePointer( TRawEvent::EButton1Down, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1617 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
  1618 				// EEnterHighPressure
       
  1619 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1620 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedPoint, KControlTestEnterHighPressure, pointerNumber, expectedControl );
       
  1621 				// EExitHighPressure
       
  1622 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1623 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
  1624 				// EButton1up
       
  1625 				SimulatePointer( TRawEvent::EButton1Up, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1626 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
  1627 				// EExitCloseProximity
       
  1628 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1629 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
  1630 				// EOutOfRange  ** Note: The three co-ordinates received with the EOutOfRange event are the last known co-ordinates of the pointer.
       
  1631 				//						 ie the co-ordinates of the previous event
       
  1632 				SimulatePointer( TRawEvent::EPointer3DOutOfRange, madeUpPoint.iX, madeUpPoint.iY, KControlTestOutOfRange, pointerNumber );
       
  1633 				AddExpectedPointer( TAdvancedPointerEvent::EOutOfRange, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
  1634 				
       
  1635 				// Discriminate each pointer's event-sequence by position.
       
  1636 				point += incPoint;
       
  1637 				expectedPoint += incPoint;
       
  1638 				}
       
  1639 			
       
  1640 			}
       
  1641 			break;
       
  1642 
       
  1643 		case 1:
       
  1644 			{	
       
  1645 			INFO_PRINTF1( _L("MoveAndOutOfRangeL case 1") );
       
  1646 			RDebug::Print( _L("MoveAndOutOfRangeL case 1") );
       
  1647 
       
  1648 			pointerNumber = KIntermediatePointerNumber;
       
  1649 			
       
  1650 			for(; pointerNumber < iNumberOfPointers; pointerNumber++ )
       
  1651 				{
       
  1652 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1653 				AddExpectedPointer( TAdvancedPointerEvent::EMove, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
  1654 			
       
  1655 				// Should be reported as EEnterCloseProximity
       
  1656 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1657 				AddExpectedPointer( TAdvancedPointerEvent::EEnterCloseProximity, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
  1658 				// EButton1Down (Not High pressure)
       
  1659 				SimulatePointer( TRawEvent::EButton1Down, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1660 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Down, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
  1661 				// EEnterHighPressure
       
  1662 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestEnterHighPressure, pointerNumber );
       
  1663 				AddExpectedPointer( TAdvancedPointerEvent::EEnterHighPressure, expectedPoint, KControlTestEnterHighPressure, pointerNumber, expectedControl );
       
  1664 				// EExitHighPressure
       
  1665 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestLessThanHighPressure, pointerNumber );
       
  1666 				AddExpectedPointer( TAdvancedPointerEvent::EExitHighPressure, expectedPoint, KControlTestLessThanHighPressure, pointerNumber, expectedControl );
       
  1667 				// EButton1up
       
  1668 				SimulatePointer( TRawEvent::EButton1Up, point.iX, point.iY, KControlTestEnterCloseProximity, pointerNumber );
       
  1669 				AddExpectedPointer( TAdvancedPointerEvent::EButton1Up, expectedPoint, KControlTestEnterCloseProximity, pointerNumber, expectedControl );
       
  1670 				// EExitCloseProximity
       
  1671 				SimulatePointer( TRawEvent::EPointerMove, point.iX, point.iY, KControlTestExitCloseProximity, pointerNumber );
       
  1672 				AddExpectedPointer( TAdvancedPointerEvent::EExitCloseProximity, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
  1673 				// EOutOfRange  ** Note: The three co-ordinates received with the EOutOfRange event are the last known co-ordinates of the pointer.
       
  1674 				//						 ie the co-ordinates of the previous event
       
  1675 				SimulatePointer( TRawEvent::EPointer3DOutOfRange, madeUpPoint.iX, madeUpPoint.iY, KControlTestOutOfRange, pointerNumber );
       
  1676 				AddExpectedPointer( TAdvancedPointerEvent::EOutOfRange, expectedPoint, KControlTestExitCloseProximity, pointerNumber, expectedControl );
       
  1677 				
       
  1678 				// Discriminate each pointer's event-sequence by position.
       
  1679 				point += incPoint;
       
  1680 				expectedPoint += incPoint;
       
  1681 				}
       
  1682 			
       
  1683 			}
       
  1684 			break;
       
  1685 			
       
  1686 		default:
       
  1687 			{
       
  1688 			CActiveScheduler::Stop();
       
  1689 			iEventSet = 0;
       
  1690 			
       
  1691 			INFO_PRINTF1( _L("MoveAndOutOfRangeL STOP\n") );
       
  1692 			INFO_PRINTF1( _L("") );
       
  1693 			RDebug::Print( _L("MoveAndOutOfRangeL STOP") );
       
  1694 			RDebug::Print( _L("") );
       
  1695 			}
       
  1696 			break;
       
  1697 			
       
  1698 		}	
       
  1699 	
       
  1700 	}
       
  1701 
       
  1702 
       
  1703 
       
  1704 // Stops the active scheduler and sets the flag to ETrue
       
  1705 void CConeMultiPtrCompoundTestAppUi::Failed()
       
  1706 	{
       
  1707 	CActiveScheduler::Stop();
       
  1708 	iFailed = ETrue;
       
  1709 	}
       
  1710 
       
  1711 
       
  1712 /**
       
  1713  CTestStep derived class. It creates the control environment and App Ui class objects
       
  1714 */
       
  1715  void CTConeMultiPtrCompoundStep::ConstructConeMultiPtrAppL(CCoeEnv* aCoe)
       
  1716  	{ // runs inside a TRAP harness
       
  1717  	aCoe->ConstructL();
       
  1718  	CConeMultiPtrCompoundTestAppUi* appUi=new(ELeave) CConeMultiPtrCompoundTestAppUi(this);
       
  1719  	aCoe->SetAppUi(appUi);
       
  1720  	aCoe->WsSession().SetDoubleClick(1000000,4);
       
  1721  	appUi->ConstructL();
       
  1722  	}
       
  1723  
       
  1724  
       
  1725  CTConeMultiPtrCompoundStep::CTConeMultiPtrCompoundStep()
       
  1726 	 {
       
  1727 	 SetTestStepName(KTConeMultiPtrCompoundStep);
       
  1728 	 }
       
  1729  
       
  1730  
       
  1731  CTConeMultiPtrCompoundStep::~CTConeMultiPtrCompoundStep()
       
  1732 	 {
       
  1733 	 
       
  1734 	 }
       
  1735 
       
  1736 
       
  1737 /**
       
  1738 Testexecute loads testserver and creates CTConeMultiPtrCompoundStep object and calls 
       
  1739 this function for each step in script file.
       
  1740 */
       
  1741 TVerdict CTConeMultiPtrCompoundStep::doTestStepL()
       
  1742 	{
       
  1743 	INFO_PRINTF1(_L("Test Started"));
       
  1744 
       
  1745 	// Need to check if wserv is NGA or Non-NGA
       
  1746 	// If NGA continue or else just return
       
  1747 	RWsSession wsSession;
       
  1748 	User::LeaveIfError(wsSession.Connect());
       
  1749 	if (wsSession.PreferredSurfaceConfigurationSize() == KErrNotSupported)
       
  1750 		{
       
  1751 		wsSession.Close();
       
  1752 		INFO_PRINTF1(_L("Tests should run only on NGA configuration. \n"));
       
  1753 		SetTestStepResult(EPass);
       
  1754 		return TestStepResult();
       
  1755 		}
       
  1756 	wsSession.Close();
       
  1757 
       
  1758 	// Here check if the HAL configuration are correct if not then finish the test case
       
  1759 	TInt maxPtr=-1;
       
  1760 	TInt ret = HAL::Get(HALData::EPointerMaxPointers, maxPtr);
       
  1761 	if (ret != KErrNone || maxPtr < 2 || maxPtr > 8)
       
  1762 		{
       
  1763 		INFO_PRINTF2(_L("Incorrect HAL configuration (MaxPointers=%d). \n"),maxPtr);
       
  1764 		SetTestStepResult(EFail);
       
  1765 		return TestStepResult();
       
  1766 		}
       
  1767 
       
  1768 	PreallocateHALBuffer();
       
  1769 
       
  1770 	__UHEAP_MARK;
       
  1771 
       
  1772 	CCoeEnv* coe = new(ELeave) CCoeEnv;
       
  1773 	TRAPD(err, ConstructConeMultiPtrAppL(coe));
       
  1774 	
       
  1775 	if (!err)
       
  1776 		{
       
  1777 		coe->ExecuteD();
       
  1778 		}
       
  1779 	else
       
  1780 		{
       
  1781 		INFO_PRINTF1(_L("Failed to contruct ControlEnvironment"));
       
  1782 		SetTestStepResult(EFail);
       
  1783 		if (coe)
       
  1784 			coe->DestroyEnvironment();
       
  1785 		}
       
  1786 	REComSession::FinalClose();
       
  1787 
       
  1788 	__UHEAP_MARKEND;
       
  1789 
       
  1790 	INFO_PRINTF1(_L("Test Finished"));
       
  1791 	return TestStepResult();
       
  1792 	}
       
  1793 
       
  1794 
       
  1795 TVerdict CTConeMultiPtrCompoundStep::doTestStepPreambleL()
       
  1796 	{
       
  1797 	// Remember the double-click settings.
       
  1798 	// Tests (may) adjust these values.
       
  1799 	RWsSession wsSession;
       
  1800 	User::LeaveIfError( wsSession.Connect() );
       
  1801 
       
  1802 	wsSession.GetDoubleClickSettings( iDoubleClickMaxInterval, iDoubleClickMaxDistance );
       
  1803 	wsSession.Close();	
       
  1804 
       
  1805 	return CTestStep::doTestStepPreambleL();
       
  1806 	}
       
  1807 	
       
  1808 	
       
  1809 TVerdict CTConeMultiPtrCompoundStep::doTestStepPostambleL()
       
  1810 	{
       
  1811 	// Restore the original system-wide double-click settings.
       
  1812 	RWsSession wsSession;
       
  1813 	User::LeaveIfError( wsSession.Connect() );
       
  1814 
       
  1815 	wsSession.SetDoubleClick( iDoubleClickMaxInterval, iDoubleClickMaxDistance);
       
  1816 	wsSession.Close();
       
  1817 	
       
  1818 	return CTestStep::doTestStepPostambleL();
       
  1819 	}