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