1 /* |
1 /* |
2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
22 |
22 |
23 #include "swilaunchercaptest.h" |
23 #include "swilaunchercaptest.h" |
24 #include "sislauncherclient.h" |
24 #include "sislauncherclient.h" |
25 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
25 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
26 #include "swtypereginfo.h" |
26 #include "swtypereginfo.h" |
27 #include "sislauncherclient.h" |
|
28 #endif |
27 #endif |
29 #include <e32def.h> |
28 #include <e32def.h> |
30 |
29 |
31 _LIT(KSwiLauncherCapTestName, "Swi Launcher capability test"); |
30 _LIT(KSwiLauncherCapTestName, "Swi Launcher capability test"); |
32 |
31 |
33 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
32 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
34 _LIT(KSwiLauncherInstallServerUtilCapTestName, "Swi Launcher Utils for InstallServer capability test"); |
33 _LIT(KSwiLauncherInstallServerUtilCapTestName, "Swi Launcher Utils for InstallServer capability test"); |
35 _LIT(KSwiLauncherSisRegistryServerUtilCapTestName, "Swi Launcher Utils for SisRegistryServer capability test"); |
34 _LIT(KSwiLauncherSisRegistryServerUtilCapTestName, "Swi Launcher Utils for SisRegistryServer capability test"); |
36 _LIT(KSisLauncherSwiSidCapTest, "Sis Launcher API's which require SWI Sid"); |
35 |
37 const TUid KInstallServerUid = {0x101F7295}; |
36 const TUid KInstallServerUid = {0x101F7295}; |
38 const TUid KSisRegistryServerUid = {0x10202DCA}; |
37 const TUid KSisRegistryServerUid = {0x10202DCA}; |
39 #endif |
38 #endif |
40 |
39 |
41 |
40 |
159 TBuf<128> testDocFileOnSysDrive = sysDrive.Name(); |
158 TBuf<128> testDocFileOnSysDrive = sysDrive.Name(); |
160 testDocFileOnSysDrive.Append(KFilePath); |
159 testDocFileOnSysDrive.Append(KFilePath); |
161 |
160 |
162 User::LeaveIfError(file.Open(fs, testDocFileOnSysDrive , EFileShareExclusive|EFileRead)); |
161 User::LeaveIfError(file.Open(fs, testDocFileOnSysDrive , EFileShareExclusive|EFileRead)); |
163 |
162 |
164 RCPointerArray<Usif::CSoftwareTypeRegInfo> regInfoArray; |
163 RCPointerArray<Swi::CSoftwareTypeRegInfo> regInfoArray; |
165 CleanupClosePushL(regInfoArray); |
164 CleanupClosePushL(regInfoArray); |
166 |
165 |
167 TRAP(err, launcher.ParseSwTypeRegFileL(file, regInfoArray)); |
166 TRAP(err, launcher.ParseSwTypeRegFileL(file, regInfoArray)); |
168 CheckFailL(err, _L("ParseSwTypeRegFileL")); |
167 CheckFailL(err, _L("ParseSwTypeRegFileL")); |
169 |
168 |
201 void CSwiLauncherSisRegistryServerUtilCapTest::RunTestL() |
200 void CSwiLauncherSisRegistryServerUtilCapTest::RunTestL() |
202 { |
201 { |
203 Swi::RSisLauncherSession launcher; |
202 Swi::RSisLauncherSession launcher; |
204 CleanupClosePushL(launcher); |
203 CleanupClosePushL(launcher); |
205 |
204 |
206 const RArray<Swi::TAppUpdateInfo> appUpdateInfo; |
|
207 |
|
208 if (launcher.Connect() != KErrNone) |
205 if (launcher.Connect() != KErrNone) |
209 { |
206 { |
210 CleanupStack::PopAndDestroy(&launcher); |
207 CleanupStack::PopAndDestroy(&launcher); |
211 return; |
208 return; |
212 } |
209 } |
216 RCPointerArray<HBufC8> mimeTypes; |
213 RCPointerArray<HBufC8> mimeTypes; |
217 CleanupClosePushL(mimeTypes); |
214 CleanupClosePushL(mimeTypes); |
218 |
215 |
219 TRAP(err, launcher.UnregisterSifLauncherMimeTypesL(mimeTypes)); |
216 TRAP(err, launcher.UnregisterSifLauncherMimeTypesL(mimeTypes)); |
220 CheckFailL(err, _L("UnregisterSifLauncherMimeTypesL")); |
217 CheckFailL(err, _L("UnregisterSifLauncherMimeTypesL")); |
221 |
|
222 TRAP(err, launcher.NotifyNewAppsL(appUpdateInfo)); |
|
223 CheckFailL(err, _L("NotifyNewAppsL - update apparc")); |
|
224 |
218 |
225 CleanupStack::PopAndDestroy(2, &launcher); // mimeTypes |
219 CleanupStack::PopAndDestroy(2, &launcher); // mimeTypes |
226 } |
220 } |
227 |
|
228 //CSisLauncherSwiSidTest---------------------------------------------------------------------------------------------------------------------------------- |
|
229 |
|
230 CSisLauncherSwiSidTest* CSisLauncherSwiSidTest::NewL() |
|
231 { |
|
232 CSisLauncherSwiSidTest* self = new (ELeave) CSisLauncherSwiSidTest(); |
|
233 CleanupStack::PushL(self); |
|
234 self->ConstructL(); |
|
235 CleanupStack::Pop(self); |
|
236 return self; |
|
237 } |
|
238 |
|
239 CSisLauncherSwiSidTest::CSisLauncherSwiSidTest() |
|
240 { |
|
241 SetCapabilityRequired(ECapabilityTCB); |
|
242 SetSidRequired(KInstallServerUid); |
|
243 } |
|
244 |
|
245 void CSisLauncherSwiSidTest::ConstructL() |
|
246 { |
|
247 SetNameL(KSisLauncherSwiSidCapTest); |
|
248 } |
|
249 |
|
250 void CSisLauncherSwiSidTest::RunTestL() |
|
251 { |
|
252 Swi::RSisLauncherSession launcher; |
|
253 CleanupClosePushL(launcher); |
|
254 const RPointerArray<Usif::CApplicationRegistrationData> appRegData; |
|
255 TInt err = launcher.Connect(); |
|
256 if (err != KErrNone) |
|
257 { |
|
258 CleanupStack::PopAndDestroy(&launcher); |
|
259 return; |
|
260 } |
|
261 err=KErrNone; |
|
262 TRAP(err, launcher.NotifyNewAppsL(appRegData)); |
|
263 CheckFailL(err, _L("NotifyNewAppsL - force registration")); |
|
264 CleanupStack::PopAndDestroy(&launcher); |
|
265 } |
|
266 |
|
267 #endif |
221 #endif |