|
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: AppMngr2 Runtime API STIF test module |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_APPMNGR2RUNTIMEAPITEST_H |
|
20 #define C_APPMNGR2RUNTIMEAPITEST_H |
|
21 |
|
22 #include <TestScripterInternal.h> // CScriptBase |
|
23 #include <appmngr2runtimeobserver.h> // MAppMngr2RuntimeObserver |
|
24 #include "appmngr2testcommandobserver.h" // MAppMngr2TestCommandObserver |
|
25 #include <f32file.h> // RFs |
|
26 |
|
27 class CAppMngr2Runtime; |
|
28 class CAppMngr2InfoBase; |
|
29 class CAppMngr2AppInfo; |
|
30 class CAppMngr2PackageInfo; |
|
31 class CAppMngr2TestCommand; |
|
32 |
|
33 #define TEST_CLASS_VERSION_MAJOR 0 |
|
34 #define TEST_CLASS_VERSION_MINOR 0 |
|
35 #define TEST_CLASS_VERSION_BUILD 0 |
|
36 |
|
37 _LIT( KAppMngr2RuntimeApiTestModuleName, "appmngr2runtimeapitest.dll" ); |
|
38 _LIT( KAppMngr2RuntimeApiTestLogPath, "\\logs\\testframework\\appmngr2runtimeapitest\\" ); |
|
39 _LIT( KAppMngr2RuntimeApiTestLogFile, "appmngr2runtimeapitest.txt" ); |
|
40 _LIT( KAppMngr2RuntimeApiTestLogFileWithTitle, "appmngr2runtimeapitest_[%S].txt" ); |
|
41 |
|
42 |
|
43 NONSHARABLE_CLASS(CAppMngr2RuntimeApiTest) : public CScriptBase, |
|
44 public MAppMngr2RuntimeObserver, public MAppMngr2TestCommandObserver |
|
45 { |
|
46 public: // constructor and destructor |
|
47 static CAppMngr2RuntimeApiTest* NewL( CTestModuleIf& aTestModuleIf ); |
|
48 ~CAppMngr2RuntimeApiTest(); |
|
49 |
|
50 public: // from CScriptBase |
|
51 TInt RunMethodL( CStifItemParser& aItem ); |
|
52 |
|
53 public: // from MAppMngr2RuntimeObserver |
|
54 void RefreshInstalledApps(); |
|
55 void RefreshInstallationFiles(); |
|
56 |
|
57 public: // from MAppMngr2TestCommandObserver |
|
58 void CommandResult( CAppMngr2TestCommand& aCommand, TInt aCompletionCode ); |
|
59 |
|
60 private: // new functions |
|
61 CAppMngr2RuntimeApiTest( CTestModuleIf& aTestModuleIf ); |
|
62 void ConstructL(); |
|
63 void SendTestClassVersion(); |
|
64 void Print( TRefByValue<const TDesC> aFmt, ... ); |
|
65 void GetUidFromStringL( const TDesC& aString, TUid& aUid ); |
|
66 CAppMngr2PackageInfo* FindInstallationPackage( const TDesC& aName ); |
|
67 CAppMngr2AppInfo* FindInstalledApp( const TDesC& aName ); |
|
68 void CallInfoBaseFunctionsL( CAppMngr2InfoBase& aInfo, const TDesC& aTestName ); |
|
69 |
|
70 // test functions |
|
71 TInt CheckFilesExistL( CStifItemParser& aItem ); |
|
72 TInt LoadAllPluginsL( CStifItemParser& aItem ); |
|
73 TInt LoadPluginL( CStifItemParser& aItem ); |
|
74 TInt CheckPluginsLoadedL( CStifItemParser& aItem ); |
|
75 TInt LoadIconsL( CStifItemParser& aItem ); |
|
76 TInt GetAdditionalDirsToScanL( CStifItemParser& aItem ); |
|
77 TInt GetInstallationFilesL( CStifItemParser& aItem ); |
|
78 TInt CheckInstallationFilesL( CStifItemParser& aItem ); |
|
79 TInt ShowInstallationFileDetailsL( CStifItemParser& aItem ); |
|
80 TInt CheckShowDetailsEndedL( CStifItemParser& aItem ); |
|
81 TInt CheckNoInstallationFilesL( CStifItemParser& aItem ); |
|
82 TInt StartInstallFileL( CStifItemParser& aItem ); |
|
83 TInt CheckInstallEndedL( CStifItemParser& aItem ); |
|
84 TInt GetInstalledAppsL( CStifItemParser& aItem ); |
|
85 TInt CheckAppInstalledL( CStifItemParser& aItem ); |
|
86 TInt ShowInstalledDetailsL( CStifItemParser& aItem ); |
|
87 TInt CheckNoAppsInstalledL( CStifItemParser& aItem ); |
|
88 TInt StartUninstallAppL( CStifItemParser& aItem ); |
|
89 TInt CheckUninstallEndedL( CStifItemParser& aItem ); |
|
90 |
|
91 private: // data |
|
92 RPointerArray<CAppMngr2Runtime> iPlugins; |
|
93 RPointerArray<CAppMngr2AppInfo> iInstalledApps; |
|
94 RPointerArray<CAppMngr2PackageInfo> iInstallationPackages; |
|
95 CAppMngr2TestCommand* iInstallCommand; |
|
96 CAppMngr2TestCommand* iUninstallCommand; |
|
97 CAppMngr2TestCommand* iShowDetailsCommand; |
|
98 TInt iSWInstCommonResourceFileOffset; |
|
99 TInt iAppMngr2ResourceFileOffset; |
|
100 RFs iFs; |
|
101 }; |
|
102 |
|
103 #endif // C_APPMNGR2RUNTIMEAPITEST_H |
|
104 |