|
1 /* |
|
2 * Copyright (c) 2009-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 @file |
|
21 @internalComponent |
|
22 @test |
|
23 */ |
|
24 #ifndef APPREGINFOAPPARCSTEPS_H_ |
|
25 #define APPREGINFOAPPARCSTEPS_H_ |
|
26 |
|
27 #include <scs/oomteststep.h> |
|
28 #include <usif/scr/scr.h> |
|
29 |
|
30 using namespace Usif; |
|
31 |
|
32 class CScrApparcTestServer; |
|
33 |
|
34 _LIT(KScrApplicationRegistrationViewSubsessionStep,"ScrGetApplicationRegistrationView"); |
|
35 _LIT(KScrMultipleSubsessionsForAppRegistryViewStep,"ScrMultipleSubsessionsForAppRegistryView"); |
|
36 |
|
37 class CScrGetApplicationRegistrationViewSubsessionStep : public COomTestStep |
|
38 /** |
|
39 TEF test step which exercises the SCR GetApplicationRegistrationView interface |
|
40 */ |
|
41 { |
|
42 public: |
|
43 CScrGetApplicationRegistrationViewSubsessionStep(); |
|
44 ~CScrGetApplicationRegistrationViewSubsessionStep(); |
|
45 |
|
46 void MarkAsPerformanceStep(); |
|
47 |
|
48 protected: |
|
49 void ImplTestStepPreambleL(); |
|
50 void ImplTestStepL(); |
|
51 void ImplTestStepPostambleL(); |
|
52 |
|
53 // Utility Functions |
|
54 void PrintErrorL(const TDesC& aMsg, TInt aErrNum,...); |
|
55 |
|
56 static void GenerateIndexedAttributeNameL(TDes& aInitialAttributeName, TInt aIndex); |
|
57 TBool GetUidFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUid& aUid); |
|
58 // For reading data from ini file |
|
59 Usif::CApplicationRegistrationData* GetAppRegInfoFromConfigLC(HBufC* aConfigSection = NULL); |
|
60 void GetAppOwnedFilesL(RPointerArray<HBufC>& aOwnedFileArray, HBufC* aConfigSection = NULL); |
|
61 void GetAppServiceInfoL(RPointerArray<Usif::CServiceInfo>& aServiceInfoArray, HBufC* aConfigSection = NULL); |
|
62 void GetAppLocalizableInfoL(RPointerArray<Usif::CLocalizableAppInfo>& aLocalizableAppInfoArray, HBufC* aConfigSection = NULL); |
|
63 void GetAppOpaqueDataInfoL(RPointerArray<Usif::COpaqueData>& aAppOpaqueDataInfoArray, HBufC* aConfigSection = NULL); |
|
64 void GetServiceOpaqueDataInfoL(RPointerArray<Usif::COpaqueData>& aServiceOpaqueDataInfoArray, TInt aServiceOpaqueDataInfoCount, TInt aStartingIndex, HBufC* aConfigSection = NULL); |
|
65 TBool Get64BitIntegerFromConfigL(const TDesC& aConfigKeyName, TInt64& aRetVal,HBufC* aConfigsection = NULL); |
|
66 CPropertyEntry* GetPropertyFromConfigLC(TBool aIsSingle, TInt aIndex, TBool aSupportLocalized, HBufC* aConfigsection = NULL); |
|
67 void GetAppPropertiesL(RPointerArray<Usif::CPropertyEntry>& aAppPropertyArray, TBool aSupportLocalized, HBufC* aConfigSection = NULL ); |
|
68 void GetAppUidL(TUid& aAppUid, HBufC* aConfigsection = NULL); |
|
69 |
|
70 // For comparing data |
|
71 TBool CompareApplicationRegistrationDataL(Usif::CApplicationRegistrationData *aActualData, Usif::CApplicationRegistrationData *aExpectedData); |
|
72 TBool CompareFileOwnershipInfo(RPointerArray<HBufC> aActualData, RPointerArray<HBufC> aExpectedData); |
|
73 TBool CompareServiceInfoL(RPointerArray<Usif::CServiceInfo> aActualData, RPointerArray<Usif::CServiceInfo> aExpectedData); |
|
74 TBool CompareDataType(RPointerArray<Usif::CDataType> aActualData, RPointerArray<Usif::CDataType> aExpectedData); |
|
75 TBool CompareLocalizableAppInfo(RPointerArray<Usif::CLocalizableAppInfo> aActualData, RPointerArray<Usif::CLocalizableAppInfo> aExpectedData); |
|
76 TBool CompareCaptionandIconInfo(const CCaptionAndIconInfo* aActualData, const CCaptionAndIconInfo* aExpectedData); |
|
77 TBool CompareViewData(RPointerArray<Usif::CAppViewData> aActualData, RPointerArray<Usif::CAppViewData> aExpectedData); |
|
78 TBool CompareOpaqueDataL(RPointerArray<Usif::COpaqueData> aActualData, RPointerArray<Usif::COpaqueData> aExpectedData); |
|
79 |
|
80 void GetApplicationRegistrationDataFromConfigL(RPointerArray<Usif::CApplicationRegistrationData>& aEntries); |
|
81 |
|
82 void StartTimer(); |
|
83 void StopTimerAndPrintResultL(); |
|
84 void PrintPerformanceLog(TTime aTime); |
|
85 |
|
86 protected: |
|
87 Usif::RSoftwareComponentRegistry iScrSession; |
|
88 TBool iIsPerformanceTest; |
|
89 |
|
90 private: |
|
91 TTime iStartTime; |
|
92 }; |
|
93 |
|
94 |
|
95 class CScrMultipleSubsessionsForAppRegistryViewStep : public CScrGetApplicationRegistrationViewSubsessionStep |
|
96 /** |
|
97 TEF test step which exercises the SCR CScrAddConcurrentApplicationRegistrationViewEntryStep interface |
|
98 */ |
|
99 { |
|
100 public: |
|
101 CScrMultipleSubsessionsForAppRegistryViewStep(); |
|
102 ~CScrMultipleSubsessionsForAppRegistryViewStep(); |
|
103 |
|
104 protected: |
|
105 void ImplTestStepPreambleL(); |
|
106 void ImplTestStepL(); |
|
107 void ImplTestStepPostambleL(); |
|
108 }; |
|
109 |
|
110 #endif /* APPREGINFOAPPARCSTEPS_H_ */ |
|
111 |
|
112 |