installationservices/swcomponentregistry/test/tscr/inc/tscrstep.h
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
child 27 e8965914fac7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
       
     2 * Copyright (c) 2008-2010 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 * Defines the basic test step for the Software Component Registry test harness
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalComponent
       
    23  @test
       
    24 */
       
    25 
       
    26 #ifndef TSCRSTEP_H
       
    27 #define TSCRSTEP_H
       
    28 
       
    29 #include <scs/oomteststep.h>
       
    30 #include <usif/usifcommon.h>
       
    31 #include <usif/scr/scr.h>
       
    32 #include <usif/scr/appreginfo.h>
       
    33 
       
    34 class CScrTestServer;
       
    35 
       
    36 // Shared operators for comparing properties
       
    37 TBool operator !=(Usif::CPropertyEntry& lhsEntry, Usif::CPropertyEntry& rhsEntry);
       
    38 TBool operator ==(Usif::CPropertyEntry& lhsEntry, Usif::CPropertyEntry& rhsEntry);
       
    39 TBool operator ==(const Usif::CComponentEntry& aLhsEntry, const Usif::CComponentEntry& aRhsEntry);
       
    40 TBool operator !=(const Usif::CComponentEntry& aLhsEntry, const Usif::CComponentEntry& aRhsEntry);
       
    41 
       
    42 class CScrTestStep : public COomTestStep
       
    43 /**
       
    44  	Base class used to provide handy functions available to test step classes.
       
    45  */
       
    46 	{
       
    47 	friend class CScrPerformanceTestStep;
       
    48 public:
       
    49 	virtual ~CScrTestStep();
       
    50 	void MarkAsPerformanceStep();
       
    51 	
       
    52 protected:
       
    53 	CScrTestStep(CScrTestServer& aParent);
       
    54 	
       
    55 	// From COomTestStep
       
    56 	void ImplTestStepPreambleL();
       
    57 	void ImplTestStepL();
       
    58 	void ImplTestStepPostambleL();
       
    59 	RScsClientBase* ClientHandle();
       
    60 	
       
    61 	// Utility Functions
       
    62 	void PrintErrorL(const TDesC& aMsg, TInt aErrNum,...);
       
    63 	
       
    64 	// Shared code for comparing properties
       
    65 	TBool ComparePropertiesL(RPointerArray<Usif::CPropertyEntry>& aFoundProperties, RPointerArray<Usif::CPropertyEntry>& aExpectedProperties);
       
    66 	static void GenerateIndexedAttributeNameL(TDes& aInitialAttributeName, TInt aIndex);
       
    67 	void CompareComponentIdsL(RArray<Usif::TComponentId>& aFoundComponents, RArray<Usif::TComponentId>& aExpectedComponents);
       
    68 	
       
    69 	// Helper functions for getting common test step attributes	
       
    70 	void AppendSharedComponentIdL(Usif::TComponentId aComponentId);
       
    71 	void GetSoftwareTypeNameL(TPtrC& aSwTypeName);
       
    72 	TBool GetGlobalIdNameL(TPtrC& aGlobalIdName);
       
    73 	Usif::CGlobalComponentId* GetGlobalComponentIdLC();
       
    74 	Usif::CGlobalComponentId* GetGlobalComponentIdLC(const TDesC& aGlobalIdName, const TDesC& aSwTypeName);
       
    75 	HBufC* GetVersionFromConfigL(const TDesC& aVersionName);
       
    76 	void GetExpectedVersionedComponentIdListL(RPointerArray<Usif::CVersionedComponentId>& aVerCompIdList);
       
    77 	TBool CompareVersionedComponentIdsL(RPointerArray<Usif::CVersionedComponentId>& aFoundVerCompIdList, RPointerArray<Usif::CVersionedComponentId>& aExpectedVerCompIdList);
       
    78 	TBool GetLocaleFromConfigL(const TDesC& aParamName, TLanguage &aLocale);
       
    79 	TBool GetLocaleFromConfigL(TLanguage &aLocale);
       
    80 	void GetFileNameFromConfigL(TPtrC& aFileName);
       
    81 	void GetFileNameListFromConfigL(RPointerArray<HBufC>& aFileList);
       
    82 	TInt GetComponentIdL();
       
    83 	void ReadAllSharedComponentIdsL(RArray<TInt>& aComponentList);
       
    84 	void GetComponentNameFromConfigL(TPtrC& aComponentName);
       
    85 	void GetVendorNameFromConfigL(TPtrC& aVendorName);
       
    86 	Usif::CComponentEntry* GetComponentEntryFromConfigLC(TBool aIsSingle=ETrue, TInt aIndex=0); 
       
    87 	void GetPropertiesFromConfigL(RPointerArray<Usif::CPropertyEntry>& aProperties, TBool aSupportLocalized=EFalse);
       
    88 	Usif::CPropertyEntry* GetPropertyFromConfigLC(TBool aIsSingle, TInt aIndex = 0, TBool aSupportLocalized=EFalse);
       
    89 	void GetComponentIdsFromConfigL(RArray<Usif::TComponentId>& aComponentIds);
       
    90 	void GetComponentLocalizablesFromConfigL(TInt aIndex, TPtrC& aName, TPtrC& aVendor, TLanguage& aLocale);
       
    91 	void GetLocalisedComponentsFromConfigL(RPointerArray<Usif::CLocalizableComponentInfo>& aComponentInfo);
       
    92 	TBool GetInstalledDrivesFromConfigL(TDriveList& aDriveList, const TDesC& aAttributeName);
       
    93 	TBool GetScomoStateFromConfigL(Usif::TScomoState& aScomoState, const TDesC& aAttributeName);
       
    94 	TInt GetSetSizeFromConfigL();
       
    95 	TBool Get64BitIntegerFromConfigL(const TDesC& aConfigKeyName, TInt64& aRetVal);
       
    96 	Usif::CApplicationRegistrationData* GetAppRegInfoFromConfigLC();
       
    97 	void GetAppOwnedFilesL(RPointerArray<HBufC>& aOwnedFileArray);
       
    98 	void GetAppServiceInfoL(RPointerArray<Usif::CServiceInfo>& aServiceInfoArray);
       
    99 	void GetAppLocalizableInfoL(RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoArray);
       
   100 	void GetAppOpaqueDataInfoL(RPointerArray<Usif::COpaqueData>& aAppOpaqueDataInfoArray);
       
   101 	void GetServiceOpaqueDataInfoL(RPointerArray<Usif::COpaqueData>& aServiceOpaqueDataInfoArray, TInt aServiceOpaqueDataInfoCount, TInt aStartingIndex);
       
   102 	Usif::TComponentId GetCompIdFromConfigL();
       
   103     TBool GetUidFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUid& aUid);
       
   104 	
       
   105 	TUid GetServiceUidL();
       
   106 	void GetAppUidL(TUid& aAppUid);
       
   107 	void GetViewDataInfoFromConfigL(RPointerArray<Usif::CAppViewData>& aAppViewInfoArray);
       
   108 	TBool NotEqual(const Usif::CCaptionAndIconInfo *aLhsEntry, const Usif::CCaptionAndIconInfo *aRhsEntry) const;
       
   109 	TBool NotEqualL(const RPointerArray<Usif::CServiceInfo>& aLhsEntry, const RPointerArray<Usif::CServiceInfo>& aRhsEntry) const;
       
   110 	
       
   111 	// Read component names from config file and add a new component
       
   112 	Usif::TComponentId AddNonLocalisableComponentL(Usif::RSoftwareComponentRegistry& aScrSession);
       
   113 	
       
   114 	// Read filter properties from config file
       
   115 	Usif::CComponentFilter* ReadComponentFilterFromConfigLC();
       
   116 	void ReadFilterPropertiesL(Usif::CComponentFilter* aFilter, TInt aPropertiesCount);
       
   117 	// Read Application info filter from config file
       
   118 	void ReadAppInfoFilterFromConfigL(Usif::CAppInfoFilter** aFilter);
       
   119 	Usif::TAppRegInfo* CScrTestStep::GetAppInfoFromConfigL(TBool aIsSingle , TInt aIndex=0 );
       
   120 	
       
   121 	void StartTimer();
       
   122 	void StopTimerAndPrintResultL();
       
   123 	void PrintPerformanceLog(TTime aTime);
       
   124 
       
   125 private:
       
   126 	TInt ReadSharedComponentIdL(TInt aOffset);	
       
   127 
       
   128 protected:
       
   129 	CScrTestServer& iParent;
       
   130 	Usif::RSoftwareComponentRegistry iScrSession;
       
   131 	TBool iIsPerformanceTest;
       
   132 	
       
   133 	// For plugin management test cases, the time is measured externally because they are performed via another accessor server (scr accessor).
       
   134 	// The actual test time is measured on the scr accessor server side and returned to the test code.
       
   135 	TInt iTimeMeasuredExternally;
       
   136 		
       
   137 private:	
       
   138 	TTime iStartTime;
       
   139 	};
       
   140 
       
   141 #endif /* TSCRSTEP_H */