installationservices/swcomponentregistry/test/tscr/source/appmanagersteps.cpp
changeset 60 245df5276b97
parent 24 84a16765cd86
equal deleted inserted replaced
53:ae54820ef82c 60:245df5276b97
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   200 
   200 
   201 void CScrComponentPresenceStep::ImplTestStepPostambleL()
   201 void CScrComponentPresenceStep::ImplTestStepPostambleL()
   202 	{
   202 	{
   203 	CScrTestStep::ImplTestStepPostambleL();
   203 	CScrTestStep::ImplTestStepPostambleL();
   204 	}
   204 	}
       
   205 
       
   206 // -----------CScrEMMCComponentStep-----------------
       
   207 
       
   208 CScrEMMCComponentStep::CScrEMMCComponentStep(CScrTestServer& aParent)   : CScrTestStep(aParent)
       
   209     {
       
   210     }
       
   211 
       
   212 void CScrEMMCComponentStep::ImplTestStepPreambleL()
       
   213     {
       
   214     CScrTestStep::ImplTestStepPreambleL();
       
   215     }
       
   216 
       
   217 void CScrEMMCComponentStep::ImplTestStepL()
       
   218     {
       
   219     TInt noOfComponents(0);
       
   220     GetIntFromConfig(ConfigSection(), KNoOfComponents, noOfComponents);
       
   221     
       
   222     TPtrC formatDrive;
       
   223     GetStringFromConfig(ConfigSection(), KFormatDrive, formatDrive);
       
   224     TInt drive;
       
   225     RFs fs;
       
   226     User::LeaveIfError(fs.Connect());
       
   227     User::LeaveIfError(fs.CharToDrive(formatDrive[0], drive));
       
   228     fs.Close();
       
   229     TDriveList filterFormatDrive;
       
   230     filterFormatDrive.FillZ(KMaxDrives);
       
   231     filterFormatDrive[drive] = 1;
       
   232         
       
   233     CComponentFilter* componentFilter = CComponentFilter::NewLC();
       
   234     componentFilter->SetInstalledDrivesL(filterFormatDrive);
       
   235             
       
   236     RArray<TComponentId> foundComponentIds;
       
   237     CleanupClosePushL(foundComponentIds);
       
   238         
       
   239     iScrSession.GetComponentIdsL(foundComponentIds, componentFilter);
       
   240     
       
   241     if (foundComponentIds.Count() != noOfComponents)
       
   242         {
       
   243         ERR_PRINTF1(_L("Mismatch for number of components found."));
       
   244         SetTestStepResult(EFail);
       
   245         }
       
   246     CleanupStack::PopAndDestroy(2);
       
   247     }
       
   248 
       
   249 void CScrEMMCComponentStep::ImplTestStepPostambleL()
       
   250     {
       
   251     CScrTestStep::ImplTestStepPostambleL();
       
   252     }
       
   253 
       
   254 // -----------CScrComponentPresentForNameVendorStep-----------------
       
   255 
       
   256 CScrComponentPresentForNameVendorStep::CScrComponentPresentForNameVendorStep(CScrTestServer& aParent)   : CScrTestStep(aParent)
       
   257     {
       
   258     }
       
   259 
       
   260 void CScrComponentPresentForNameVendorStep::ImplTestStepPreambleL()
       
   261     {
       
   262     CScrTestStep::ImplTestStepPreambleL();
       
   263     }
       
   264 
       
   265 void CScrComponentPresentForNameVendorStep::ImplTestStepL()
       
   266     {
       
   267     TPtrC name;
       
   268     GetStringFromConfig(ConfigSection(), KComponentName, name);
       
   269     
       
   270     TPtrC vendor;
       
   271     GetStringFromConfig(ConfigSection(), KVendorName, vendor);
       
   272     
       
   273     CComponentFilter* componentFilter = CComponentFilter::NewLC();
       
   274     componentFilter->SetNameL(name);
       
   275     componentFilter->SetVendorL(vendor);
       
   276     
       
   277     RArray<TComponentId> foundComponentIds;
       
   278     CleanupClosePushL(foundComponentIds);
       
   279         
       
   280     iScrSession.GetComponentIdsL(foundComponentIds, componentFilter);
       
   281     
       
   282     TInt noOfComponents(0);
       
   283     GetIntFromConfig(ConfigSection(), KNoOfComponents, noOfComponents);
       
   284         
       
   285     if (foundComponentIds.Count() != noOfComponents)
       
   286         {
       
   287         ERR_PRINTF1(_L("Mismatch for number of components found."));
       
   288         SetTestStepResult(EFail);
       
   289         }
       
   290     CleanupStack::PopAndDestroy(2);
       
   291     }
       
   292 
       
   293 void CScrComponentPresentForNameVendorStep::ImplTestStepPostambleL()
       
   294     {
       
   295     CScrTestStep::ImplTestStepPostambleL();
       
   296     }