1 /* |
|
2 * Copyright (c) 2008-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 #include "tbackuprestorestep.h" |
|
20 #include <test/testexecutelog.h> |
|
21 |
|
22 #include <f32file.h> |
|
23 |
|
24 #include <swi/launcher.h> |
|
25 #include "tui.h" |
|
26 |
|
27 CTStepInstall::CTStepInstall() |
|
28 { |
|
29 SetTestStepName(KTStepInstall); |
|
30 } |
|
31 |
|
32 TVerdict CTStepInstall::doTestStepL() |
|
33 { |
|
34 if (TestStepResult() != EPass) |
|
35 { |
|
36 return TestStepResult(); |
|
37 } |
|
38 |
|
39 RFs fs; |
|
40 User::LeaveIfError(fs.Connect()); |
|
41 CleanupClosePushL(fs); |
|
42 fs.ShareProtected(); |
|
43 |
|
44 CInstallPrefs* prefs = CInstallPrefs::NewLC(); |
|
45 prefs->SetPerformRevocationCheck(EFalse); |
|
46 |
|
47 TInt expectedResult; |
|
48 if (GetIntFromConfig(ConfigSection(),_L("InstallResult"), expectedResult) == EFalse) |
|
49 { |
|
50 expectedResult = KErrNone; |
|
51 } |
|
52 |
|
53 while (NextPackage()) |
|
54 { |
|
55 TPtrC sisfilename(SISFileNameL()); |
|
56 INFO_PRINTF2(_L("Installing %S"), &sisfilename); |
|
57 |
|
58 TUI ui; |
|
59 RFile file; |
|
60 User::LeaveIfError(file.Open(fs, sisfilename, EFileRead)); |
|
61 |
|
62 TInt err = Launcher::Install (ui, file, *prefs); |
|
63 |
|
64 if (err != expectedResult) |
|
65 { |
|
66 INFO_PRINTF3(_L("Expected %d, got %d"), expectedResult, err); |
|
67 SetTestStepResult(EFail); |
|
68 } |
|
69 } |
|
70 CleanupStack::PopAndDestroy(2, &fs); // prefs |
|
71 |
|
72 return TestStepResult(); |
|
73 } |
|
74 |
|