|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #if (!defined __T_BACKUP_STEP_H__) |
|
22 #define __T_BACKUP_STEP_H__ |
|
23 #include "apparctestserver.h" |
|
24 #include <babackup.h> |
|
25 |
|
26 class CT_BackupStep; |
|
27 struct CBackupTestThreadParams |
|
28 { |
|
29 TInt64 seed; |
|
30 CT_BackupStep* Step; |
|
31 }; |
|
32 |
|
33 |
|
34 |
|
35 //! A CT_BackupStep test class. |
|
36 /*! |
|
37 Performs Tests on Backup server |
|
38 */ |
|
39 class CT_BackupStep :public CTestStep |
|
40 { |
|
41 public: |
|
42 CT_BackupStep(); |
|
43 ~CT_BackupStep(); |
|
44 virtual TVerdict doTestStepPreambleL(); |
|
45 virtual TVerdict doTestStepPostambleL(); |
|
46 virtual TVerdict doTestStepL(); |
|
47 TInt DoBackupMultipleTestThreadEntryL(/*TAny* aPtr*/); |
|
48 |
|
49 //private: |
|
50 void doMainL(); |
|
51 void SetupSchedulerL(); |
|
52 void CloseScheduler(); |
|
53 void doTestsL(); |
|
54 void testMultipleClientsL(); |
|
55 void testRestartAppsL(); |
|
56 TRequestStatus testExtraRestartLockedOutL(); |
|
57 void testGetsCallbackOnBackupWrapperKillOtherL(); |
|
58 void testGetsCallbackOnBackupWrapperKillL(); |
|
59 void testGetsCallbackOnBackupStartInSecondWrapperL(); |
|
60 void testGetsCallbackOnBackupEndL(); |
|
61 void testGetsCallbackOnBackupStartL(); |
|
62 void FlushSchedulerQueueL(); |
|
63 static TInt BackupMultipleTestThreadEntry(TAny* aPtr); |
|
64 |
|
65 private: |
|
66 CBaBackupSessionWrapper* gWrapper; |
|
67 CActiveScheduler *testScheduler; |
|
68 }; |
|
69 |
|
70 _LIT(KT_BackupStep,"T_Backup"); |
|
71 |
|
72 //********************************** |
|
73 // CTestActive |
|
74 //********************************** |
|
75 |
|
76 class CTestActive : public CActive |
|
77 { |
|
78 public: |
|
79 CTestActive(); |
|
80 ~CTestActive(); |
|
81 void StartL(); |
|
82 void StartL(TRequestStatus& aRequestStatus); |
|
83 protected: |
|
84 void DoCancel(); |
|
85 void RunL(); |
|
86 |
|
87 TRequestStatus* iReport; |
|
88 }; |
|
89 |
|
90 // Class to test the n-th recieved event from the backup server is the same as the event |
|
91 // the object is initialised with |
|
92 |
|
93 |
|
94 class CTestBackupOperationObserver : public CTestActive, public MBackupOperationObserver |
|
95 { |
|
96 public: |
|
97 virtual void HandleBackupOperationEventL(const TBackupOperationAttributes& aBackupOperationAttributes); |
|
98 CTestBackupOperationObserver(const TBackupOperationAttributes& aEvent, CTestExecuteLogger& aLogger); |
|
99 CTestBackupOperationObserver(const TBackupOperationAttributes& aEvent, TInt aCount, CTestExecuteLogger& aLogger); |
|
100 void SetReadyToGo();/*{iCount=KOneOfOurEvents;};*/ |
|
101 inline CTestExecuteLogger& Logger() {return iLogger;}; |
|
102 private: |
|
103 TBackupOperationAttributes iEvent; |
|
104 TInt iCount; |
|
105 CTestExecuteLogger iLogger; |
|
106 }; |
|
107 |
|
108 class CThreadLaunchCounter : public CActive |
|
109 { |
|
110 public: |
|
111 CThreadLaunchCounter(); |
|
112 ~CThreadLaunchCounter(); |
|
113 void Start(); |
|
114 protected: |
|
115 void DoCancel(){}; |
|
116 void RunL(); |
|
117 private: |
|
118 TInt gCount; |
|
119 }; |
|
120 |
|
121 #endif |