|
1 /* |
|
2 * Copyright (c) 2008 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 "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: Defination of class MT_CHSPS |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MT_HSPS_H |
|
20 #define C_MT_HSPS_H |
|
21 |
|
22 #include <ceunittestsuiteclass.h> |
|
23 #include <eunitdecorators.h> |
|
24 #include <liwservicehandler.h> |
|
25 #include <hspsthememanagement.h> |
|
26 |
|
27 // Service API interface literals |
|
28 _LIT8( KHSPS, "Service.HSPS" ); |
|
29 _LIT8( KHSPSConfigurationIf, "IConfiguration" ); |
|
30 _LIT8( KHSPSTestAppUid, "536874929"); |
|
31 |
|
32 // Configuration installation files |
|
33 _LIT( KHSPSInstallMinimalRootConf, "c:\\data\\mt_hsps\\minimalconf\\root\\manifest.dat"); |
|
34 _LIT( KHSPSInstallMinimalViewConf, "c:\\data\\mt_hsps\\minimalconf\\view\\manifest.dat"); |
|
35 _LIT( KHSPSInstallMinimalWidgetConf, "c:\\data\\mt_hsps\\minimalconf\\widget\\manifest.dat"); |
|
36 _LIT( KHSPSInstallTypicalRootConf, "c:\\data\\mt_hsps\\typicalconf\\root\\manifest.dat"); |
|
37 _LIT( KHSPSInstallTypicalView1Conf, "c:\\data\\mt_hsps\\typicalconf\\view1\\manifest.dat"); |
|
38 _LIT( KHSPSInstallTypicalView2Conf, "c:\\data\\mt_hsps\\typicalconf\\view2\\manifest.dat"); |
|
39 _LIT( KHSPSInstallTypicalWidgetConf, "c:\\data\\mt_hsps\\typicalconf\\widget\\manifest.dat"); |
|
40 _LIT( KHSPSInstallOperatorRootConf, "c:\\data\\mt_hsps\\operatorconf\\root\\manifest.dat"); |
|
41 _LIT( KHSPSInstallOperatorViewConf, "c:\\data\\mt_hsps\\operatorconf\\view\\manifest.dat"); |
|
42 _LIT( KHSPSInstallFinnishWidgetConf, "c:\\data\\mt_hsps\\finnish_widget\\manifest.dat"); |
|
43 _LIT( KHSPSInstallInstalledWidgetConf, "c:\\data\\mt_hsps\\installed_widget\\manifest.dat"); |
|
44 _LIT( KHSPSInstallInstalledWidgetConfV2, "c:\\data\\mt_hsps\\installed_widget_v2\\manifest.dat"); |
|
45 |
|
46 // Triggers for notifications |
|
47 enum MT_THSPSTrigger |
|
48 { |
|
49 EHspsTriggerRunNothing = 0, |
|
50 EHspsTriggerRunRemovePluginCase, |
|
51 EHspsTriggerRunAddPluginCase, |
|
52 EHspsTriggerRunInstallationCase, |
|
53 EHspsTriggerRunSetActivePluginCase, |
|
54 EHspsTriggerRunReplacePluginCase, |
|
55 EHspsTriggerRunUpdateInstallationCase, |
|
56 EHspsTriggerRunUninstallationCase |
|
57 }; |
|
58 |
|
59 // Active configuration ids |
|
60 const TInt KHSPSMTAppUid( 0x20000FB1 ); |
|
61 const TInt KHSPSMTInterfaceUid( 0x998 ); |
|
62 const TInt KHSPSActiveConfMinimal( 0x2000B100 ); |
|
63 const TInt KHSPSActiveConfTypical( 0x2000B110 ); |
|
64 const TInt KHSPSActiveConfOperator( 0x2000B130 ); |
|
65 const TInt KHSPSMinimalViewConf( 0x2000B101 ); |
|
66 const TInt KHSPSMinimalWidgetConf( 0x2000B102 ); |
|
67 const TInt KHSPSTypicalView1Conf( 0x2000B111 ); |
|
68 const TInt KHSPSTypicalView2Conf( 0x2000B112 ); |
|
69 const TInt KHSPSTypicalWidgetConf( 0x2000B120 ); |
|
70 const TInt KHSPSOperatorViewConf( 0x2000B131 ); |
|
71 const TInt KHSPSFinnishWidgetConf( 0x2000B132 ); |
|
72 const TInt KHSPSInstalledWidgetConf( 0x2000B133 ); |
|
73 |
|
74 class MT_CHSPSResource |
|
75 : public CBase |
|
76 { |
|
77 public: |
|
78 MT_CHSPSResource( |
|
79 const TDesC& aPath, |
|
80 TInt aExpectedSize ); |
|
81 |
|
82 virtual ~MT_CHSPSResource(); |
|
83 public: |
|
84 TFileName iPath; |
|
85 TInt iSize; |
|
86 }; |
|
87 |
|
88 /** |
|
89 * This class is an abstract class of HSPS SAPI tester classes |
|
90 */ |
|
91 NONSHARABLE_CLASS( MT_CHSPS ) |
|
92 : public CEUnitTestSuiteClass, public MhspsThemeManagementServiceObserver |
|
93 { |
|
94 protected: // Constructors and destructors |
|
95 |
|
96 MT_CHSPS(); |
|
97 |
|
98 virtual ~MT_CHSPS(); |
|
99 |
|
100 protected: // New methods |
|
101 |
|
102 void RunTestStepSyncL( |
|
103 TUint8* aMethod, |
|
104 TUint8* aInParams, |
|
105 TUint8* aExpOutParams, |
|
106 TBool aMeasureExecTime = EFalse ); |
|
107 |
|
108 void RunTestStepAsyncL( |
|
109 TUint8* aMethod, |
|
110 TUint8* aInParams, |
|
111 TUint8* aExpOutParams, |
|
112 TInt aTriggerCase ); |
|
113 |
|
114 void SetActiveConfigurationL( |
|
115 const TDesC8& aAppUid, |
|
116 TInt aConfUid ); |
|
117 |
|
118 void ResetResources(); |
|
119 |
|
120 void AddResourceL( |
|
121 const TDesC& aFileName, |
|
122 const TInt aExpectedSize ); |
|
123 |
|
124 void CheckResourcesL(); |
|
125 |
|
126 // Request Notification testing purposes |
|
127 void RunNotificationTriggerL( TInt aTriggerCase ); |
|
128 |
|
129 void RunRemovePluginCase(); |
|
130 |
|
131 void RunAddPluginCase(); |
|
132 |
|
133 void RunInstallationCase(); |
|
134 |
|
135 void RunUpdateInstallationCase(); |
|
136 |
|
137 void RunUninstallationCase(); |
|
138 |
|
139 void RunSetActivePluginCase(); |
|
140 |
|
141 void RunReplacePluginCase(); |
|
142 |
|
143 void RestoreTestDataL( TInt aTriggerCase ); |
|
144 |
|
145 void RestoreRemovedPluginCase(); |
|
146 |
|
147 void RestoreAddedPluginCase(); |
|
148 |
|
149 void StartTiming( |
|
150 TDesC8& aMethod ); |
|
151 |
|
152 void StopTiming(); |
|
153 |
|
154 void SetCentralRepositoryKeyL( |
|
155 TInt aKey, |
|
156 TInt aValue ); |
|
157 |
|
158 void RemoveResourceFilesL( RFs& aFileSession ); |
|
159 |
|
160 public: // From base class MhspsThemeManagementServiceObserver |
|
161 |
|
162 /** |
|
163 * Realisation of MhspsThemeManagementServiceObserver Interface |
|
164 * @param aMessage contains a service completion message |
|
165 */ |
|
166 void HandlehspsClientMessage( ThspsServiceCompletedMessage aMessage ); |
|
167 |
|
168 public: |
|
169 /** |
|
170 * Attachs SAPI client to a service. |
|
171 * @param aSapi SAPI designation. |
|
172 * @param aInterface Interface name. |
|
173 * @param aAppUid Application Identifier. |
|
174 */ |
|
175 void AttachServiceL( |
|
176 const TDesC8& aSapi, |
|
177 const TDesC8& aInterface, |
|
178 const TDesC8& aAppUid, |
|
179 const TBool aUseTiming = EFalse ); |
|
180 |
|
181 void DetachServiceL(); |
|
182 |
|
183 MLiwInterface* Interface(); |
|
184 protected: // Data |
|
185 |
|
186 CLiwServiceHandler* iServiceHandler; |
|
187 MLiwInterface* iInterface; |
|
188 CLiwCriteriaItem* iService; |
|
189 // This is only needed in request notification testing when restoring test data |
|
190 TInt iAddedPluginId; |
|
191 TTime iStartTime; |
|
192 RPointerArray<MT_CHSPSResource> iResourceArray; |
|
193 |
|
194 }; |
|
195 |
|
196 #endif // C_MT_HSPS_H |
|
197 |
|
198 // End of file |