Beispiel #1
0
/**
Check that the test plugin file has not been left in the filesystem from a previous aborted test.
*/
TVerdict CT_ApsScanStep::doTestStepPreambleL()
	{
	RSmlTestUtils fs;
	CleanupClosePushL(fs);
	User::LeaveIfError(fs.Connect());
	
	INFO_PRINTF1(_L("Verifies that dummy.rsc was not present during boot."));
	TBool fileExists = ETrue;
	TInt err = fs.IsFilePresent(KRscTargetPath, fileExists);
	TESTE(fileExists==EFalse, err);
	
	CleanupStack::PopAndDestroy(&fs);
	return TestStepResult();
	}
Beispiel #2
0
/*
Ecom factory function

Due to platsec we can't build plugin.dll to an alternative location and we can't
copy files from epoc32\release\winscw\udeb. Both plugin.rsc and plugin.dll must 
be on the same drive to be installed. 

The workaround to implement this tef-test is works like this:
1. This test plugin are copied into z: by the build tools
2. This plugin will not be installed during startup because CreateRecognizerL will leave
3. During the test a dummy plugin.rsc will be copied into c:\resource\plugins to trig Ecom
4. Apparc will re-scan and make sure all recognizers listed by Ecom are properly installed
5. Ecom will not install the copied dummy file as it has no matching dll on the same drive, but
6. This recognizer will detect the dummy file and chose not to leave from CreateRecognizerL
*/
CApaDataRecognizerType* CTestMimeRecognizer::CreateRecognizerL()
	{
	RSmlTestUtils fileServ;
	CleanupClosePushL(fileServ);
	User::LeaveIfError(fileServ.Connect());
	TBool fileExists = EFalse;
	User::LeaveIfError(fileServ.IsFilePresent(KRscTargetPath, fileExists));
	CleanupStack::PopAndDestroy(&fileServ);	
	
	if(!fileExists)
		User::Leave(KErrPathNotFound);			
	
	return new (ELeave) CTestMimeRecognizer();
	}
Beispiel #3
0
/*
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();
	}