windowing/windowserver/test/tauto/TCapKey.CPP
changeset 116 171fae344dd4
parent 103 2717213c588a
equal deleted inserted replaced
103:2717213c588a 116:171fae344dd4
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   453 void CTCaptureKey::BadParams()
   453 void CTCaptureKey::BadParams()
   454 	{
   454 	{
   455 	TInt retVal;
   455 	TInt retVal;
   456 	TInt resCount=Client()->iWs.ResourceCount();
   456 	TInt resCount=Client()->iWs.ResourceCount();
   457 	for(TInt index=0;index<numErrorKeys;index++)
   457 	for(TInt index=0;index<numErrorKeys;index++)
   458 	{
   458 		{
   459 		retVal = Client()->iGroup->GroupWin()->CaptureKey(errorKeys[index].keyCode,errorKeys[index].modifier_mask,errorKeys[index].modifiers);
   459 		retVal = Client()->iGroup->GroupWin()->CaptureKey(errorKeys[index].keyCode,errorKeys[index].modifier_mask,errorKeys[index].modifiers, errorKeys[index].priority);
   460 		TEST(retVal==KErrArgument);
   460 		TEST(retVal==KErrArgument);
   461 		if (retVal!=KErrArgument)
   461 		if (retVal!=KErrArgument)
   462 			INFO_PRINTF3(_L("Client()->iGroup->GroupWin()->CaptureKey() return value - Expected: %d, Actual: %d"), KErrArgument, retVal);	
   462 			{
   463 	}
   463 			_LIT(KMsg, "CaptureKey() with bad parameter set %d returned %d - expected KErrArgument (%d)");
       
   464 			LOG_MESSAGE4(KMsg, index, retVal, KErrArgument);	
       
   465 			}
       
   466 
       
   467 		retVal = Client()->iGroup->GroupWin()->CaptureKeyUpAndDowns(errorKeys[index].keyCode, errorKeys[index].modifier_mask, errorKeys[index].modifiers, errorKeys[index].priority);
       
   468 		TEST(retVal == KErrArgument);
       
   469 		if (retVal != KErrArgument)
       
   470 			{
       
   471 			_LIT(KMsg, "CaptureKeyUpAndDowns() with bad parameter set %d returned %d - expected KErrArgument (%d)");
       
   472 			LOG_MESSAGE4(KMsg, index, retVal, KErrArgument);	
       
   473 			}
       
   474 
       
   475 		retVal = Client()->iGroup->GroupWin()->CaptureLongKey(errorKeys[index].keyCode, errorKeys[index].keyCode, errorKeys[index].modifier_mask, errorKeys[index].modifiers, errorKeys[index].priority, ELongCaptureNormal);
       
   476 		TEST(retVal == KErrArgument);
       
   477 		if (retVal != KErrArgument)
       
   478 			{
       
   479 			_LIT(KMsg, "CaptureLongKey() with bad parameter set %d returned %d - expected KErrArgument (%d)");
       
   480 			LOG_MESSAGE4(KMsg, index, retVal, KErrArgument);	
       
   481 			}
       
   482 		}
       
   483 
   464 	retVal = Client()->iWs.ResourceCount();
   484 	retVal = Client()->iWs.ResourceCount();
   465 	TEST(retVal==resCount);
   485 	TEST(retVal==resCount);
   466 	if (retVal!=resCount)
   486 	if (retVal!=resCount)
   467 		INFO_PRINTF3(_L("Client()->iWs.ResourceCount() return value - Expected: %d, Actual: %d"), resCount, retVal);	
   487 		{
       
   488 		_LIT(KMsg, "Resource count %d - expected %d");
       
   489 		LOG_MESSAGE3(KMsg, retVal, resCount);	
       
   490 		}
   468 	}
   491 	}
   469 
   492 
   470 void CTCaptureKey::SetMode(TTestMode aMode)
   493 void CTCaptureKey::SetMode(TTestMode aMode)
   471 	{
   494 	{
   472 #if defined(LOGGING)
   495 #if defined(LOGGING)
   799 @SYMTestPriority    High
   822 @SYMTestPriority    High
   800 
   823 
   801 @SYMTestStatus      Implemented
   824 @SYMTestStatus      Implemented
   802 
   825 
   803 @SYMTestActions     Memorizes amount of objects that the server has allocated for that client.
   826 @SYMTestActions     Memorizes amount of objects that the server has allocated for that client.
   804 					Tries to register 3 different capture keys with invalid
   827 					Tries to register capture keys with invalid modifiers and
   805 					modifiers and modifirs mask pair.
   828 					modifier mask pairs, using each of the RWindowGroup capture
       
   829 					functions CaptureKey(), CaptureKeyUpAndDowns() and
       
   830 					CaptureLongKey().
   806 
   831 
   807 @SYMTestExpectedResults Makes sure that the number of server-side objects for the 
   832 @SYMTestExpectedResults Makes sure that the number of server-side objects for the 
   808 					session didn't change.
   833 					session didn't change.
   809 */
   834 */
   810 		case 5:
   835 		case 5: