|
1 /* |
|
2 * Copyright (c) 2004-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 |
|
21 /** |
|
22 @file |
|
23 */ |
|
24 #ifndef __TSISREGISTRYSTEP_H__ |
|
25 #define __TSISREGISTRYSTEP_H__ |
|
26 |
|
27 #include <test/testexecutestepbase.h> |
|
28 |
|
29 // Step names |
|
30 _LIT(KInstalledUids, "InstalledUids"); |
|
31 _LIT(KInstalledPackages, "InstalledPackages"); |
|
32 _LIT(KRemovablePackages, "RemovablePackages"); |
|
33 _LIT(KInRomNonRemovablePackages, "InRomNonRemovablePackages"); |
|
34 _LIT(KInstalledDrives, "InstalledDrives"); |
|
35 _LIT(KIsUidInstalled, "IsUidInstalled"); |
|
36 _LIT(KIsPackageInstalled, "IsPackageInstalled"); |
|
37 _LIT(KIsControllerInstalled, "IsControllerInstalled"); |
|
38 _LIT(KGetControllers, "GetControllers"); |
|
39 _LIT(KEntryUidOpenClose, "EntryUidOpenClose"); |
|
40 _LIT(KEntryNameOpenClose, "EntryNameOpenClose"); |
|
41 _LIT(KEntryPackageOpenClose, "EntryPackageOpenClose"); |
|
42 _LIT(KEntryMethods, "EntryMethods"); |
|
43 _LIT(KWritableEntryMethods, "WritableEntryMethods"); |
|
44 _LIT(KPoliceSids,"PoliceSids"); |
|
45 _LIT(KEntrySids, "EntrySids"); |
|
46 _LIT(KEntryDelete, "EntryDelete"); |
|
47 _LIT(KBackupRegistry, "BackupRegistry"); |
|
48 _LIT(KCreateTestRegistry, "CreateTestRegistry"); |
|
49 _LIT(KSaveGeneratedRegistry, "SaveGeneratedRegistry"); |
|
50 _LIT(KDeleteRegistry, "DeleteRegistry"); |
|
51 _LIT(KRestoreRegistry, "RestoreRegistry"); |
|
52 _LIT(KSidFileName, "SidToFileName"); |
|
53 _LIT(KModifiableFile, "ModifiableFile"); |
|
54 _LIT(KFileHash, "FileHash"); |
|
55 _LIT(KIsSidPresentStep, "IsSidPresent"); |
|
56 _LIT(KIsPackagePresentStep, "IsPackagePresent"); |
|
57 _LIT(KIntegrityCheckStep, "IntegrityCheck"); |
|
58 _LIT(KDateAndTimeIntegrityCheckStep, "DateAndTimeIntegrityCheck"); |
|
59 _LIT(KLoggingFileInfo, "LoggingFileInfo"); |
|
60 _LIT(KRomStubPerformanceStep, "RomStubPerformanceCheck"); |
|
61 _LIT(KCorruptCacheStep, "CorruptCacheStep"); |
|
62 _LIT(KCorruptCacheRecoverStep, "CorruptCacheRecoverStep"); |
|
63 _LIT(KEmbeddingPackageStep, "EmbeddingPackageStep"); |
|
64 _LIT(KCreateTokenByCopy, "CreateTokenByCopy"); |
|
65 _LIT(KCreateTokenFromStream, "CreateTokenFromStream"); |
|
66 _LIT(KCertificateChainListStep, "CertificateChainListStep"); |
|
67 _LIT(KCreateSisRegistryObject, "CreateSisRegistryObject"); |
|
68 _LIT(KSisRegistryDependencyStep, "SisRegistryDependencyStep"); |
|
69 _LIT(KSisRegistryFileDescStep, "SisRegistryFileDescStep"); |
|
70 _LIT(KControllerInfoStep, "ControllerInfoStep"); |
|
71 _LIT(KSisRegistryPropertyStep, "SisRegistryPropertyStep"); |
|
72 _LIT(KIsFileRegisteredStep, "IsFileRegistered"); |
|
73 _LIT(KGetComponentIdForUidStep, "GetComponentIdForUid"); |
|
74 |
|
75 // The following test steps added for performance tests. |
|
76 // If they are needed to be used for other tests, they should be extended. |
|
77 // For example, the retrieved results are compared with the expected ones. |
|
78 _LIT(KApplicationManagerStep, "ApplicationManager"); |
|
79 _LIT(KSidToPackage, "SidToPackage"); |
|
80 _LIT(KIsSidPresentSingleStep, "IsSidPresentSingle"); |
|
81 _LIT(KAddEntryStep, "AddEntry"); |
|
82 _LIT(KUpdateEntryStep, "UpdateEntry"); |
|
83 _LIT(KDeleteSingleEntry, "DeleteSingleEntry"); |
|
84 _LIT(KIsPackageExistInRomStep, "IsPackageExistInRom"); |
|
85 _LIT(KFileDescriptionsStep, "FileDescriptions"); |
|
86 _LIT(KIsAugmentationStep, "IsAugmentation"); |
|
87 _LIT(KFilesStep, "Files"); |
|
88 _LIT(KAugmentationsStep, "Augmentations"); |
|
89 _LIT(KPackageStep, "Package"); |
|
90 _LIT(KDependentPackagesStep, "DependentPackages"); |
|
91 _LIT(KDependenciesStep, "Dependencies"); |
|
92 _LIT(KEmbeddedPackagesStep, "EmbeddedPackages"); |
|
93 _LIT(KChangeLocale, "ChangeLocale"); |
|
94 |
|
95 // Base class for all steps |
|
96 class CSisRegistryTestStepBase : public CTestStep |
|
97 { |
|
98 public: |
|
99 void MarkAsPerformanceStep(); |
|
100 |
|
101 protected: |
|
102 // Extension of config parser to allow you to get array of descriptors |
|
103 void GetStringArrayFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, RArray<TPtrC>& aArray); |
|
104 TBool GetUidFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TUid& aUid); |
|
105 void GetUidArrayFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, RArray<TUid>& aArray); |
|
106 void GetIntArrayFromConfigL(const TDesC& aSectName, const TDesC& aKeyName, RArray<TInt>& aArray); |
|
107 HBufC8* GetControllerFromSisLC(const TDesC& aSisFileName); |
|
108 // Log function |
|
109 TVerdict PrintErrorAndReturnFailL(const TDesC& aMsg); |
|
110 // Performance test methods |
|
111 void StartTimer(); |
|
112 void StopTimerAndPrintResultL(); |
|
113 |
|
114 private: |
|
115 void PrintPerformanceLog(TTime aTime); |
|
116 protected: |
|
117 // For some test cases (AddEntry, UpdateEntry and DeleteEntry), the time is measured externally |
|
118 // because they are performed via another helper server (sisregistryaccess_server). To eliminate |
|
119 // the time spent for IPC communication and the time spent to connect to the SISRegistry, |
|
120 // the actual test time is measured on the sisregistry_access server side and returned to the test code. |
|
121 TInt iTimeMeasuredExternally; |
|
122 private: |
|
123 TBool iIsPerformanceTest; |
|
124 TTime iStartTime; |
|
125 }; |
|
126 |
|
127 // Backup Registry Step |
|
128 class CBackupRegistryStep : public CSisRegistryTestStepBase |
|
129 { |
|
130 public: |
|
131 CBackupRegistryStep(); |
|
132 virtual TVerdict doTestStepL(); |
|
133 }; |
|
134 |
|
135 // Create Test Registry Step |
|
136 class CCreateTestRegistryStep : public CSisRegistryTestStepBase |
|
137 { |
|
138 public: |
|
139 CCreateTestRegistryStep(); |
|
140 virtual TVerdict doTestStepL(); |
|
141 }; |
|
142 |
|
143 // Delete Registry Step |
|
144 class CDeleteRegistryStep : public CSisRegistryTestStepBase |
|
145 { |
|
146 public: |
|
147 CDeleteRegistryStep(); |
|
148 virtual TVerdict doTestStepL(); |
|
149 }; |
|
150 |
|
151 // Restore Registry Step |
|
152 class CRestoreRegistryStep : public CSisRegistryTestStepBase |
|
153 { |
|
154 public: |
|
155 CRestoreRegistryStep(); |
|
156 virtual TVerdict doTestStepL(); |
|
157 }; |
|
158 |
|
159 // Save Registry Step |
|
160 class CSaveRegistryStep : public CSisRegistryTestStepBase |
|
161 { |
|
162 public: |
|
163 CSaveRegistryStep(); |
|
164 virtual TVerdict doTestStepL(); |
|
165 }; |
|
166 |
|
167 #endif |
|
168 |