1 /* |
1 /* |
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2005-2010 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" |
27 #endif |
28 #endif |
28 #include <e32def.h> |
29 #include <e32def.h> |
29 |
30 |
30 _LIT(KSwiLauncherCapTestName, "Swi Launcher capability test"); |
31 _LIT(KSwiLauncherCapTestName, "Swi Launcher capability test"); |
31 |
32 |
32 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
33 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
33 _LIT(KSwiLauncherInstallServerUtilCapTestName, "Swi Launcher Utils for InstallServer capability test"); |
34 _LIT(KSwiLauncherInstallServerUtilCapTestName, "Swi Launcher Utils for InstallServer capability test"); |
34 _LIT(KSwiLauncherSisRegistryServerUtilCapTestName, "Swi Launcher Utils for SisRegistryServer capability test"); |
35 _LIT(KSwiLauncherSisRegistryServerUtilCapTestName, "Swi Launcher Utils for SisRegistryServer capability test"); |
35 |
36 _LIT(KSisLauncherSwiSidCapTest, "Sis Launcher API's which require SWI Sid"); |
36 const TUid KInstallServerUid = {0x101F7295}; |
37 const TUid KInstallServerUid = {0x101F7295}; |
37 const TUid KSisRegistryServerUid = {0x10202DCA}; |
38 const TUid KSisRegistryServerUid = {0x10202DCA}; |
38 #endif |
39 #endif |
39 |
40 |
40 |
41 |
200 void CSwiLauncherSisRegistryServerUtilCapTest::RunTestL() |
201 void CSwiLauncherSisRegistryServerUtilCapTest::RunTestL() |
201 { |
202 { |
202 Swi::RSisLauncherSession launcher; |
203 Swi::RSisLauncherSession launcher; |
203 CleanupClosePushL(launcher); |
204 CleanupClosePushL(launcher); |
204 |
205 |
|
206 const RArray<Swi::TAppUpdateInfo> appUpdateInfo; |
|
207 |
205 if (launcher.Connect() != KErrNone) |
208 if (launcher.Connect() != KErrNone) |
206 { |
209 { |
207 CleanupStack::PopAndDestroy(&launcher); |
210 CleanupStack::PopAndDestroy(&launcher); |
208 return; |
211 return; |
209 } |
212 } |
213 RCPointerArray<HBufC8> mimeTypes; |
216 RCPointerArray<HBufC8> mimeTypes; |
214 CleanupClosePushL(mimeTypes); |
217 CleanupClosePushL(mimeTypes); |
215 |
218 |
216 TRAP(err, launcher.UnregisterSifLauncherMimeTypesL(mimeTypes)); |
219 TRAP(err, launcher.UnregisterSifLauncherMimeTypesL(mimeTypes)); |
217 CheckFailL(err, _L("UnregisterSifLauncherMimeTypesL")); |
220 CheckFailL(err, _L("UnregisterSifLauncherMimeTypesL")); |
|
221 |
|
222 TRAP(err, launcher.NotifyNewAppsL(appUpdateInfo)); |
|
223 CheckFailL(err, _L("NotifyNewAppsL - update apparc")); |
218 |
224 |
219 CleanupStack::PopAndDestroy(2, &launcher); // mimeTypes |
225 CleanupStack::PopAndDestroy(2, &launcher); // mimeTypes |
220 } |
226 } |
|
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 |
221 #endif |
267 #endif |