|
1 /** |
|
2 * Copyright (c) 2006-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 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @publishedAll |
|
22 @released |
|
23 */ |
|
24 #ifndef __LOWDISKSPACE_STEP_H__ |
|
25 #define __LOWDISKSPACE_STEP_H__ |
|
26 |
|
27 #include <test/testexecutestepbase.h> |
|
28 #include "PerformanceFunctionalityBase.h" |
|
29 |
|
30 class CLowDiskSpaceStep : public CPerformanceFunctionalityBase |
|
31 { |
|
32 class CLowDiskSpaceActive; |
|
33 friend class CLowDiskSpaceActive; |
|
34 private: |
|
35 enum TTransactionType |
|
36 { |
|
37 ERollbackTransaction, |
|
38 ECommitTransaction, |
|
39 }; |
|
40 public: |
|
41 CLowDiskSpaceStep(CPerformanceFunctionalityTestsSuite &aParent); |
|
42 TVerdict doTestStepPostambleL(); |
|
43 virtual TVerdict doTestStepL(); |
|
44 |
|
45 private: |
|
46 #ifndef __WINSCW__ |
|
47 void InitializeL(); |
|
48 void Cleanup(); |
|
49 #endif |
|
50 void PreTestL(); |
|
51 #ifndef __WINSCW__ |
|
52 void Activate(); |
|
53 void FillDiskL(); |
|
54 void ClearDiskL(); |
|
55 void HighDiskModeL(); |
|
56 void RefillL(); |
|
57 void PrintFail( const TDesC &aFunc, const TBool aRet, const TInt aErr ); |
|
58 TBool CrudTestL(); |
|
59 TBool DatabaseTestsL(); |
|
60 TBool MiscDbTestsL(); |
|
61 TBool StartHighdiskModeL(); |
|
62 TBool StartLowDiskModeL(); |
|
63 void FailTransactionTestL( const TTransactionType aTransactionType ); |
|
64 void StartServerTestL(); |
|
65 #endif |
|
66 |
|
67 private: // From CActive. |
|
68 void RunL(); |
|
69 void DoCancel(); |
|
70 TInt RunError(TInt aError); |
|
71 |
|
72 private: |
|
73 RFile *iFile; |
|
74 TInt iManyFiles; |
|
75 RArray< TBool (CLowDiskSpaceStep::*)() > *iTests; |
|
76 TInt iNextTest; |
|
77 TInt iRecievedError; |
|
78 CContactItem *iGroup; |
|
79 CContactItem *iCustomTemplate; |
|
80 TContactItemId iGroupedContact; |
|
81 TInt iExpectedError; |
|
82 TBool iCleanup; |
|
83 TBool iErrorPrinted; |
|
84 CLowDiskSpaceStep::CLowDiskSpaceActive *iMyActive; |
|
85 TDesC *iConfigSection; |
|
86 |
|
87 #ifndef __WINSCW__ |
|
88 private: |
|
89 class CLowDiskSpaceActive : public CActive |
|
90 { |
|
91 public: |
|
92 CLowDiskSpaceActive(CLowDiskSpaceStep *aStep) : CActive( EPriorityStandard ), |
|
93 iStep ( aStep ) |
|
94 {} |
|
95 void Activate(); |
|
96 private: // From CActive. |
|
97 void RunL(); |
|
98 void DoCancel(); |
|
99 TInt RunError(TInt aError); |
|
100 private: |
|
101 CLowDiskSpaceStep *iStep; |
|
102 }; |
|
103 #endif |
|
104 }; |
|
105 |
|
106 _LIT(KLowDiskSpaceStep,"LowDiskSpaceStep"); |
|
107 |
|
108 #endif |