|
1 /* |
|
2 * Copyright (c) 2007 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: Test Module DLL to Geocoding API |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <Stiftestinterface.h> |
|
22 |
|
23 |
|
24 #include "testmnclientlib.h" |
|
25 #include "testmngeocoder.h" |
|
26 |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // Ctestmnclientlib::Ctestmnclientlib |
|
30 // C++ default constructor can NOT contain any code, that |
|
31 // might leave. |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 CTestMNClientLib::CTestMNClientLib( |
|
35 CTestModuleIf& aTestModuleIf ): |
|
36 CScriptBase( aTestModuleIf ) |
|
37 { |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // Ctestmnclientlib::ConstructL |
|
42 // Symbian 2nd phase constructor can leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 void CTestMNClientLib::ConstructL() |
|
46 { |
|
47 iLog = CStifLogger::NewL( KtestmnclientlibLogPath, |
|
48 KtestmnclientlibLogFile, |
|
49 CStifLogger::ETxt, |
|
50 CStifLogger::EFile, |
|
51 EFalse ); |
|
52 |
|
53 Install(KProviderSisxPath); |
|
54 |
|
55 iTestMnGeocoder = CTestMnGeocoder::NewL(iLog); |
|
56 } |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // Ctestmnclientlib::NewL |
|
60 // Two-phased constructor. |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 CTestMNClientLib* CTestMNClientLib::NewL( |
|
64 CTestModuleIf& aTestModuleIf ) |
|
65 { |
|
66 CTestMNClientLib* self = new (ELeave) CTestMNClientLib( aTestModuleIf ); |
|
67 |
|
68 CleanupStack::PushL( self ); |
|
69 self->ConstructL(); |
|
70 CleanupStack::Pop(); |
|
71 |
|
72 return self; |
|
73 |
|
74 } |
|
75 |
|
76 // Destructor |
|
77 CTestMNClientLib::~CTestMNClientLib() |
|
78 { |
|
79 |
|
80 // Delete resources allocated from test methods |
|
81 Delete(); |
|
82 |
|
83 // Delete logger |
|
84 delete iLog; |
|
85 |
|
86 } |
|
87 |
|
88 // Dependency Provider Install |
|
89 TInt CTestMNClientLib::Install( const TDesC& aPackagePath ) |
|
90 { |
|
91 iLog->Log(_L("Installing [%S]..."), &aPackagePath ); |
|
92 |
|
93 TInt err = KErrNone; |
|
94 SwiUI::RSWInstSilentLauncher installer; |
|
95 |
|
96 err = installer.Connect(); |
|
97 if( KErrNone == err ) |
|
98 iLog->Log(_L("Connection to Installer Passed...")); |
|
99 |
|
100 SwiUI::TInstallOptionsPckg options; |
|
101 options().iUpgrade = SwiUI::EPolicyAllowed; |
|
102 options().iPackageInfo = SwiUI::EPolicyAllowed; |
|
103 options().iOverwrite = SwiUI::EPolicyAllowed; |
|
104 options().iKillApp = SwiUI::EPolicyAllowed; |
|
105 |
|
106 iLog->Log(_L("B4 Installation Passed...")); |
|
107 err = installer.SilentInstall( aPackagePath , options ); |
|
108 if( KErrNone == err ) |
|
109 iLog->Log(_L("Installation Passed with %d..."),err); |
|
110 else |
|
111 iLog->Log(_L("Installation Failed with %d..."),err); |
|
112 |
|
113 installer.Close(); |
|
114 return err; |
|
115 } |
|
116 |
|
117 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // LibEntryL is a polymorphic Dll entry point. |
|
121 // Returns: CScriptBase: New CScriptBase derived object |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 EXPORT_C CScriptBase* LibEntryL( |
|
125 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
126 { |
|
127 |
|
128 return ( CScriptBase* ) CTestMNClientLib::NewL( aTestModuleIf ); |
|
129 |
|
130 } |
|
131 |
|
132 |
|
133 // End of File |