|
1 // Copyright (c) 2008-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 #ifndef __T_BACKUPSRVDEFECTS_H__ |
|
17 #define __T_BACKUPSRVDEFECTS_H__ |
|
18 |
|
19 #include <e32debug.h> |
|
20 #include <e32test.h> |
|
21 #include <babackup.h> |
|
22 |
|
23 enum BUDefectTestMachineStates |
|
24 { |
|
25 EMachineStart, |
|
26 EMachineCloseAllsEndSameClient, |
|
27 EMachineCloseAllsEndOtherClient, |
|
28 EMachineCloseAllsEndCloseFile, |
|
29 EMachineCloseFileEnd, |
|
30 }; |
|
31 class CBackupFileObserver; |
|
32 |
|
33 // The class to schedule the CBaBackupSessionWrapper requests for the Backup server defect tests. |
|
34 class CBUDefectTestMachine : public CActive |
|
35 { |
|
36 public: |
|
37 static CBUDefectTestMachine* NewL(); |
|
38 ~CBUDefectTestMachine(); |
|
39 void RunL(); |
|
40 void DoCancel(); |
|
41 void Complete(); |
|
42 void SetFileObserver(CBackupFileObserver* aBackupFileObserver); |
|
43 private: |
|
44 CBUDefectTestMachine(); |
|
45 void ConstructL(); |
|
46 |
|
47 private: |
|
48 CBaBackupSessionWrapper* iWrapper; |
|
49 CBackupFileObserver* iBackupFileObserver; |
|
50 |
|
51 public: |
|
52 BUDefectTestMachineStates iNextState; |
|
53 }; |
|
54 |
|
55 |
|
56 class CBackupFileObserver : public CActive, public MBackupObserver |
|
57 { |
|
58 public: |
|
59 static CBackupFileObserver* NewL(CBUDefectTestMachine& aTestMachine, const TDesC& aLockedFileName); |
|
60 ~CBackupFileObserver(); |
|
61 void RunL(); |
|
62 void DoCancel(); |
|
63 void ChangeFileLockL(const TDesC& aFileName,TFileLockFlags aFlags); |
|
64 void CloseAll(MBackupObserver::TFileLockFlags aFlags); |
|
65 void CloseFileL(const TDesC& aFileName,MBackupObserver::TFileLockFlags aFlags); |
|
66 |
|
67 private: |
|
68 CBackupFileObserver(CBUDefectTestMachine& aTestMachine, const TDesC& aLockedFileName); |
|
69 void ConstructL(); |
|
70 private: |
|
71 CBUDefectTestMachine& iTestMachine; |
|
72 CBaBackupSessionWrapper* iWrapper; |
|
73 const TDesC& iLockedFileName; |
|
74 }; |
|
75 #endif // __T_BACKUPSRVDEFECTS_H__ |