| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WEBKIT_BROWSER_FILEAPI_MOCK_FILE_CHANGE_OBSERVER_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_MOCK_FILE_CHANGE_OBSERVER_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_MOCK_FILE_CHANGE_OBSERVER_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_MOCK_FILE_CHANGE_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "storage/browser/fileapi/file_observers.h" | 10 #include "storage/browser/fileapi/file_observers.h" |
| 11 #include "storage/browser/fileapi/file_system_url.h" | 11 #include "storage/browser/fileapi/file_system_url.h" |
| 12 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" | 12 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
| 13 | 13 |
| 14 namespace storage { | 14 namespace storage { |
| 15 | 15 |
| 16 // Mock file change observer. | 16 // Mock file change observer. |
| 17 class MockFileChangeObserver : public FileChangeObserver { | 17 class MockFileChangeObserver : public FileChangeObserver { |
| 18 public: | 18 public: |
| 19 MockFileChangeObserver(); | 19 MockFileChangeObserver(); |
| 20 virtual ~MockFileChangeObserver(); | 20 virtual ~MockFileChangeObserver(); |
| 21 | 21 |
| 22 // Creates a ChangeObserverList which only contains given |observer|. | 22 // Creates a ChangeObserverList which only contains given |observer|. |
| 23 static ChangeObserverList CreateList(MockFileChangeObserver* observer); | 23 static ChangeObserverList CreateList(MockFileChangeObserver* observer); |
| 24 | 24 |
| 25 // FileChangeObserver overrides. | 25 // FileChangeObserver overrides. |
| 26 virtual void OnCreateFile(const FileSystemURL& url) OVERRIDE; | 26 virtual void OnCreateFile(const FileSystemURL& url) override; |
| 27 virtual void OnCreateFileFrom(const FileSystemURL& url, | 27 virtual void OnCreateFileFrom(const FileSystemURL& url, |
| 28 const FileSystemURL& src) OVERRIDE; | 28 const FileSystemURL& src) override; |
| 29 virtual void OnRemoveFile(const FileSystemURL& url) OVERRIDE; | 29 virtual void OnRemoveFile(const FileSystemURL& url) override; |
| 30 virtual void OnModifyFile(const FileSystemURL& url) OVERRIDE; | 30 virtual void OnModifyFile(const FileSystemURL& url) override; |
| 31 virtual void OnCreateDirectory(const FileSystemURL& url) OVERRIDE; | 31 virtual void OnCreateDirectory(const FileSystemURL& url) override; |
| 32 virtual void OnRemoveDirectory(const FileSystemURL& url) OVERRIDE; | 32 virtual void OnRemoveDirectory(const FileSystemURL& url) override; |
| 33 | 33 |
| 34 void ResetCount() { | 34 void ResetCount() { |
| 35 create_file_count_ = 0; | 35 create_file_count_ = 0; |
| 36 create_file_from_count_ = 0; | 36 create_file_from_count_ = 0; |
| 37 remove_file_count_ = 0; | 37 remove_file_count_ = 0; |
| 38 modify_file_count_ = 0; | 38 modify_file_count_ = 0; |
| 39 create_directory_count_ = 0; | 39 create_directory_count_ = 0; |
| 40 remove_directory_count_ = 0; | 40 remove_directory_count_ = 0; |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 int modify_file_count_; | 94 int modify_file_count_; |
| 95 int create_directory_count_; | 95 int create_directory_count_; |
| 96 int remove_directory_count_; | 96 int remove_directory_count_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(MockFileChangeObserver); | 98 DISALLOW_COPY_AND_ASSIGN(MockFileChangeObserver); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace storage | 101 } // namespace storage |
| 102 | 102 |
| 103 #endif // WEBKIT_BROWSER_FILEAPI_MOCK_FILE_CHANGE_OBSERVER_H_ | 103 #endif // WEBKIT_BROWSER_FILEAPI_MOCK_FILE_CHANGE_OBSERVER_H_ |
| OLD | NEW |