|
1 /* |
|
2 * Copyright (c) 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 "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 //utility class for tests |
|
18 //all utility methods should be implemented here |
|
19 |
|
20 #include "casrvengutils.h" |
|
21 #include "casrvplugin.h" |
|
22 |
|
23 class CCaStorageProxy; |
|
24 class CCaInnerEntry; |
|
25 |
|
26 class CTestUtils: public CBase |
|
27 { |
|
28 public: |
|
29 |
|
30 /**/ |
|
31 virtual ~CTestUtils(); |
|
32 |
|
33 /**/ |
|
34 static CTestUtils* NewL(); |
|
35 |
|
36 /**/ |
|
37 static CTestUtils* NewLC(); |
|
38 |
|
39 /**/ |
|
40 TUint FindAppUidL( const TDesC& aName, CCaStorageProxy* aStorage ); |
|
41 |
|
42 /**/ |
|
43 TInt LaunchApplicationL( const TUid aUid ); |
|
44 |
|
45 /**/ |
|
46 TInt SimpleCloseTaskL(TInt aUid); |
|
47 |
|
48 /**/ |
|
49 void WaitL(TInt aMicroSec); |
|
50 |
|
51 /**/ |
|
52 void InstallFinishedL(); |
|
53 |
|
54 /** |
|
55 * Gets RProperty |
|
56 */ |
|
57 TInt GetRProperty( TUid aCategory, TUint aKey, TDes& aValue ); |
|
58 |
|
59 /** |
|
60 * Gets RProperty |
|
61 */ |
|
62 TInt GetRProperty( TUid aCategory, TUint aKey, TInt& aValue ); |
|
63 |
|
64 /** |
|
65 * Sets RProperty |
|
66 */ |
|
67 TInt SetRProperty( TUid aCategory, TUint aKey, const TDesC& aValue ); |
|
68 |
|
69 /** |
|
70 * Sets RProperty |
|
71 */ |
|
72 TInt SetRProperty( TUid aCategory, TUint aKey, TInt aValue ); |
|
73 |
|
74 /** |
|
75 * Copys test Db |
|
76 */ |
|
77 TInt CopyDb(); |
|
78 |
|
79 /** |
|
80 * Checks if app exists in Db |
|
81 */ |
|
82 TBool AppExistsInStorageL( TInt aUid, CCaStorageProxy* aStorage); |
|
83 |
|
84 CCaInnerEntry* GetAppEntryL( TInt aUid, CCaStorageProxy* aStorage); |
|
85 |
|
86 TInt AppsWithFlagsOffL( TInt aFlags, CCaStorageProxy* aStorage); |
|
87 |
|
88 TInt GetAppFlagsL( TInt aUid, CCaStorageProxy* aStorage); |
|
89 |
|
90 TInt GetPackageFlagsL( const TDesC& aSource, CCaStorageProxy* aStorage); |
|
91 |
|
92 void RemoveAppL( TInt aUid, CCaStorageProxy* aStorage); |
|
93 void CopyMmcHistory(); |
|
94 |
|
95 CCaSrvPlugin* LoadPluginL( TUid aImplUid, TPluginParams aPluginParams ); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * Copys files |
|
101 */ |
|
102 TInt Copy( const TDesC& aSource, const TDesC& aDest ); |
|
103 |
|
104 CTestUtils(); |
|
105 |
|
106 void ConstructL(); |
|
107 |
|
108 RFs iFs; |
|
109 CFileMan* iFileManager; |
|
110 |
|
111 /** |
|
112 * Local Active Sheduler. |
|
113 * Own. |
|
114 */ |
|
115 CActiveSchedulerWait* iActiveWait; |
|
116 |
|
117 }; |