GLDEF_C TInt E32Main() { __UHEAP_MARK; test.Title(); test.Start(_L("Validate Registry Tests.")); CTrapCleanup* cleanup = CTrapCleanup::New(); CActiveScheduler* scheduler = new(ELeave)CActiveScheduler; CActiveScheduler::Install(scheduler); TRAPD(err,DoTestsL()); // Cleanup files if(err != KErrNone) { DeletePlugin(); REComSession::FinalClose(); } test(err==KErrNone); DeletePlugin(); TRAPD(error,EComTestUtils::FileManDeleteFileL(KEComInvalidRscOnC)); UNUSED_VAR(error); delete scheduler; delete cleanup; test.End(); test.Close(); __UHEAP_MARKEND; return(0); }
OCStackResult PIStopPlugin(PIPlugin * plugin) { if (!plugin) { return OC_STACK_INVALID_PARAM; } return DeletePlugin((PIPluginBase *) plugin); }
OCStackResult DeletePluginList() { OCStackResult result = OC_STACK_OK; PIPluginBase * out = NULL; PIPluginBase * tmp = NULL; LL_FOREACH_SAFE(pluginList, out, tmp) { result = DeletePlugin(out); if (result != OC_STACK_OK) { break; } }
LOCAL_C void ValidateRegistryAgainstRscL() { test.Next(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-1489 ")); __UHEAP_MARK; // before strating the test, kill the EcomServer which is probably running from // the previous tests. KillEComServerL(); DeletePlugin(); // copy the plugin to C drive. CopyPlugin(); TUid interfaceUid= {0x102797A1}; RImplInfoPtrArray implArray; // normal discovery, ECom should discover the plugin REComSession::ListImplementationsL(interfaceUid, implArray); test(implArray.Count()==1); //Check that the implementation uid returned matched the specs above TUid implUid = implArray[0]->ImplementationUid(); TInt version = implArray[0]->Version(); TInt drive = implArray[0]->Drive(); // imp. uid test(implUid.iUid == 0x102797A2); // version test(version == 1); // C drive test(drive == EDriveC); // ECom Server is running. // Delete the plugin RSC file but not the corresponding DLL file, ECom rediscovery is triggered. TRAPD(err, EComTestUtils::FileManDeleteFileL(KEComPluginRSCOnC)); test(err==KErrNone); // Give ECOM a chance to do the rediscovery. // Otherwise ListImplementationsL could fail. User::After(KOneSecond * 3); REComSession::ListImplementationsL(interfaceUid, implArray); // Since the RSC file is deleted, the corresponding DLL should be deleted // from the ECom registry. test(implArray.Count()==0); //clean up implArray.ResetAndDestroy(); REComSession::FinalClose(); KillEComServerL(); __UHEAP_MARKEND; }