windowing/windowserver/test/tauto/TPANIC.CPP
changeset 136 62bb7c97884c
parent 103 2717213c588a
equal deleted inserted replaced
121:d72fc2aace31 136:62bb7c97884c
     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".
  1148 		break;
  1148 		break;
  1149 		}
  1149 		}
  1150 	return(EWsExitReasonBad);
  1150 	return(EWsExitReasonBad);
  1151 	}
  1151 	}
  1152 
  1152 
       
  1153 /** Checks that activating a RWindow before calling EnableAdvancedPointers will panic the client.
       
  1154 */
       
  1155 LOCAL_C TInt DoTestAdvancePointerActivatePanicL(TInt /*aTest*/,TAny *aScreenNumber)
       
  1156     {
       
  1157     RWsSession ws;
       
  1158     User::LeaveIfError(ws.Connect());
       
  1159 
       
  1160     CWsScreenDevice *scrdev=new(ELeave) CWsScreenDevice(ws);
       
  1161     User::LeaveIfError(scrdev->Construct((TInt)aScreenNumber));
       
  1162     
       
  1163     RWindowGroup group(ws);
       
  1164     User::LeaveIfError(group.Construct(888));
       
  1165     RWindow win(ws);
       
  1166     User::LeaveIfError(win.Construct(group, 1));
       
  1167     win.Activate();
       
  1168     win.EnableAdvancedPointers(); // This will panic
       
  1169     ws.Flush();
       
  1170     return(EWsExitReasonBad);
       
  1171     }
       
  1172 
       
  1173 
  1153 LOCAL_C TInt DoMoveToGroupPanicTestL(TInt aTest, TAny *aScreenNumber)
  1174 LOCAL_C TInt DoMoveToGroupPanicTestL(TInt aTest, TAny *aScreenNumber)
  1154 	{
  1175 	{
  1155 	RWsSession ws;
  1176 	RWsSession ws;
  1156 	User::LeaveIfError(ws.Connect());
  1177 	User::LeaveIfError(ws.Connect());
  1157 	// use correct screen
  1178 	// use correct screen
  1614 
  1635 
  1615 void CTPanic::TestUnInitPanicL()
  1636 void CTPanic::TestUnInitPanicL()
  1616 	{
  1637 	{
  1617 	TEST(iTest->TestWsPanicL(&DoUnInitPanicTest,EWservPanicUninitialisedClient,0,(TAny*)iTest->iScreenNumber));
  1638 	TEST(iTest->TestWsPanicL(&DoUnInitPanicTest,EWservPanicUninitialisedClient,0,(TAny*)iTest->iScreenNumber));
  1618 	}
  1639 	}
       
  1640 
       
  1641 void CTPanic::TestEnableAdvancePointerActivatePanicL()
       
  1642     {
       
  1643     TEST(iTest->TestWsPanicL(&DoTestAdvancePointerActivatePanicL,EWservPanicUnableToEnableAdvPointer, 0, (TAny*)iTest->iScreenNumber));
       
  1644     }
  1619 
  1645 
  1620 void CTPanic::ConstructL()
  1646 void CTPanic::ConstructL()
  1621 	{
  1647 	{
  1622 	TheGc->Activate(*BaseWin->Win());
  1648 	TheGc->Activate(*BaseWin->Win());
  1623 	TheGc->Clear();
  1649 	TheGc->Clear();
  1872 		case 17:
  1898 		case 17:
  1873 			{
  1899 			{
  1874 			_LIT(KPanicTest, "Non-Redraw Drawing inside Redrawer Panic Test");
  1900 			_LIT(KPanicTest, "Non-Redraw Drawing inside Redrawer Panic Test");
  1875 			iTest->LogSubTest(KPanicTest);
  1901 			iTest->LogSubTest(KPanicTest);
  1876 			TestNonRedrawRedrawerL();
  1902 			TestNonRedrawRedrawerL();
  1877 			}			
  1903 			}
       
  1904 			break;
       
  1905 	  case 18:
       
  1906       {
       
  1907       _LIT(KPanicTest, "Enable advanced pointer Panic Test");
       
  1908       iTest->LogSubTest(KPanicTest);
       
  1909       TestEnableAdvancePointerActivatePanicL();
       
  1910       }   
       
  1911 			break;
       
  1912 						
  1878 #endif			
  1913 #endif			
  1879 		default:
  1914 		default:
  1880             		((CTPanicStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
  1915             		((CTPanicStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
  1881 			((CTPanicStep*)iStep)->CloseTMSGraphicsStep();
  1916 			((CTPanicStep*)iStep)->CloseTMSGraphicsStep();
  1882 			TestComplete();
  1917 			TestComplete();