OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FAKE_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FAKE_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FAKE_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FAKE_FILE_SYSTEM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // file system with FakeDriveService, for testing purpose. | 35 // file system with FakeDriveService, for testing purpose. |
36 // Note that this class doesn't support "caching" at the moment, so the number | 36 // Note that this class doesn't support "caching" at the moment, so the number |
37 // of interactions to the FakeDriveService may be bigger than the real | 37 // of interactions to the FakeDriveService may be bigger than the real |
38 // implementation. | 38 // implementation. |
39 // Currently most methods are empty (not implemented). | 39 // Currently most methods are empty (not implemented). |
40 class FakeFileSystem : public FileSystemInterface { | 40 class FakeFileSystem : public FileSystemInterface { |
41 public: | 41 public: |
42 explicit FakeFileSystem(DriveServiceInterface* drive_service); | 42 explicit FakeFileSystem(DriveServiceInterface* drive_service); |
43 virtual ~FakeFileSystem(); | 43 virtual ~FakeFileSystem(); |
44 | 44 |
45 // Initialization for testing. This can be called instead of Initialize | |
46 // for testing purpose. Returns true for success. | |
47 bool InitializeForTesting(); | |
48 | |
49 // FileSystemInterface Overrides. | 45 // FileSystemInterface Overrides. |
50 virtual void Initialize() OVERRIDE; | |
51 virtual void AddObserver(FileSystemObserver* observer) OVERRIDE; | 46 virtual void AddObserver(FileSystemObserver* observer) OVERRIDE; |
52 virtual void RemoveObserver(FileSystemObserver* observer) OVERRIDE; | 47 virtual void RemoveObserver(FileSystemObserver* observer) OVERRIDE; |
53 virtual void CheckForUpdates() OVERRIDE; | 48 virtual void CheckForUpdates() OVERRIDE; |
54 virtual void TransferFileFromLocalToRemote( | 49 virtual void TransferFileFromLocalToRemote( |
55 const base::FilePath& local_src_file_path, | 50 const base::FilePath& local_src_file_path, |
56 const base::FilePath& remote_dest_file_path, | 51 const base::FilePath& remote_dest_file_path, |
57 const FileOperationCallback& callback) OVERRIDE; | 52 const FileOperationCallback& callback) OVERRIDE; |
58 virtual void OpenFile(const base::FilePath& file_path, | 53 virtual void OpenFile(const base::FilePath& file_path, |
59 OpenMode open_mode, | 54 OpenMode open_mode, |
60 const std::string& mime_type, | 55 const std::string& mime_type, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // invalidate the weak pointers before any other members are destroyed. | 186 // invalidate the weak pointers before any other members are destroyed. |
192 base::WeakPtrFactory<FakeFileSystem> weak_ptr_factory_; | 187 base::WeakPtrFactory<FakeFileSystem> weak_ptr_factory_; |
193 | 188 |
194 DISALLOW_COPY_AND_ASSIGN(FakeFileSystem); | 189 DISALLOW_COPY_AND_ASSIGN(FakeFileSystem); |
195 }; | 190 }; |
196 | 191 |
197 } // namespace test_util | 192 } // namespace test_util |
198 } // namespace drive | 193 } // namespace drive |
199 | 194 |
200 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FAKE_FILE_SYSTEM_H_ | 195 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FAKE_FILE_SYSTEM_H_ |
OLD | NEW |