installationservices/swinstallationfw/test/tusif/source/tsifsuitestepbase.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalTechnology 
       
    22 */
       
    23 
       
    24 #include "tsifsuitestepbase.h"
       
    25 #include "tsifsuitedefs.h"
       
    26 #include <usif/scr/scr.h>
       
    27 
       
    28 using namespace Usif;
       
    29 
       
    30 TComponentId Usif::FindComponentInScrL(const TDesC& aName, const TDesC& aVendor)
       
    31 	{
       
    32 	RSoftwareComponentRegistry scr;
       
    33 	User::LeaveIfError(scr.Connect());
       
    34 	CleanupClosePushL(scr);
       
    35 
       
    36 	RSoftwareComponentRegistryView scrView;
       
    37 	CComponentFilter* filter = CComponentFilter::NewLC();
       
    38 	filter->SetNameL(aName);
       
    39 	filter->SetVendorL(aVendor);
       
    40 
       
    41 	scrView.OpenViewL(scr, filter);
       
    42 	CleanupClosePushL(scrView);
       
    43 
       
    44 	CComponentEntry* component = scrView.NextComponentL();
       
    45 	TComponentId componentId = 0;
       
    46 	if (component != NULL)
       
    47 		{
       
    48 		componentId = component->ComponentId();
       
    49 		delete component;
       
    50 		}
       
    51 
       
    52 	CleanupStack::PopAndDestroy(3, &scr);
       
    53 	
       
    54 	return componentId;
       
    55 	}
       
    56 
       
    57 CSifSuiteStepBase::~CSifSuiteStepBase()
       
    58 	{
       
    59 	}
       
    60 
       
    61 CSifSuiteStepBase::CSifSuiteStepBase()
       
    62 	{
       
    63 	}
       
    64 
       
    65 void CSifSuiteStepBase::ImplTestStepPreambleL()
       
    66 /**
       
    67  * Implementation of CTestStep base class virtual
       
    68  * It is used for doing all initialisation common to derived classes in here.
       
    69  * Make it being able to leave if there are any errors here as there's no point in
       
    70  * trying to run a test step if anything fails.
       
    71  * The leave will be picked up by the framework.
       
    72  */
       
    73 	{
       
    74 	INFO_PRINTF1(_L("I am in doTestStepPreambleL() of the class CSifSuiteStepBase!"));
       
    75 
       
    76 	SetTestStepResult(EPass);
       
    77 	}
       
    78 
       
    79 void CSifSuiteStepBase::ImplTestStepPostambleL()
       
    80 /**
       
    81  * Implementation of CTestStep base class virtual
       
    82  * It is used for doing all after test treatment common to derived classes in here.
       
    83  * Make it being able to leave
       
    84  * The leave will be picked up by the framework.
       
    85  */
       
    86 	{
       
    87 	INFO_PRINTF1(_L("I am in doTestStepPostambleL() of the class CSifSuiteStepBase!"));
       
    88 	}