コード例 #1
0
/**
   Auxiliary function for all Test Cases
  
   The method creates & sets the test step's user interface object and
   launches the test step.
   
   @SYMTestCaseID UIF-TPARENT-doTestStepL
  
   @SYMDEF
  
   @SYMTestCaseDesc This test aims to test that the parent of a control created
                    in a container has the view as its parent.
  
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions The view creates a control, and sets the container window
                   for the control to be itself 
  
   @SYMTestExpectedResults The control is queried to confirm that its parent
                           is the view.
   
 
 */
TVerdict CTestParentStep::doTestStepL() // main function called by E32
	{
  	PreallocateHALBuffer();
	__UHEAP_MARK;
	SetTestStepID(_L("UIF-TPARENT-doTestStepL"));
	// Before creating the CEikonEnv we must create C:\parent.txt.
	// The presence of this file will modify the behaviour of 
	// staticsettingsinit
	RSmlTestUtils utils;
	User::LeaveIfError(utils.Connect());
	CleanupClosePushL(utils);
	_LIT(KFile, "c:\\parent.txt");
	utils.CreateFileL(KFile);
	    
	CEikonEnv* coe=new CEikonEnv;
	TRAPD(err,ConstructAppL(coe));

	if (!err)
		coe->ExecuteD();
	
	utils.DeleteFileL(KFile);
	CleanupStack::PopAndDestroy(&utils);

	REComSession::FinalClose();
	
	RecordTestResultL();
	CloseTMSGraphicsStep();
	__UHEAP_MARKEND;
	

	return TestStepResult();
	}
コード例 #2
0
ファイル: T_ApsScan.cpp プロジェクト: fedor4ever/default
/*
Delete the plugin file which was installed during the test from c:.
*/
TVerdict CT_ApsScanStep::doTestStepPostambleL()
	{
	RSmlTestUtils fs;
	CleanupClosePushL(fs);
	User::LeaveIfError(fs.Connect());

	TBool fileExists = EFalse;
	fs.IsFilePresent(KRscTargetPath, fileExists);
	if(fileExists)
		{
		fs.ChangeFilePermissionL(KRscTargetPath); // clear readonly attribute inherited from z:
		const TInt err = fs.DeleteFileL(KRscTargetPath);
		if(err == KErrNone) 
			INFO_PRINTF1(_L("Removed temporary file dummy.rsc"));
		else 
			INFO_PRINTF1(_L("Failed to remove temporary file dummy.rsc"));	
		}
		
	CleanupStack::PopAndDestroy(&fs);
	return TestStepResult();
	}