Chromium Code Reviews| Index: components/arc/test/fake_file_system_instance.h |
| diff --git a/components/arc/test/fake_file_system_instance.h b/components/arc/test/fake_file_system_instance.h |
| index 5fa4ac8032ed192352d3d252f12a5f30b2a78855..a019368f3aec65185263d009ff78033efa5bc2e3 100644 |
| --- a/components/arc/test/fake_file_system_instance.h |
| +++ b/components/arc/test/fake_file_system_instance.h |
| @@ -8,6 +8,7 @@ |
| #include <stdint.h> |
| #include <map> |
| +#include <set> |
| #include <string> |
| #include <utility> |
| #include <vector> |
| @@ -102,12 +103,20 @@ class FakeFileSystemInstance : public mojom::FileSystemInstance { |
| FakeFileSystemInstance(); |
| ~FakeFileSystemInstance() override; |
| + // Returns true if Init() has been called. |
| + bool InitCalled(); |
| + |
| // Adds a file accessible by content URL based methods. |
| void AddFile(const File& file); |
| // Adds a document accessible by document provider based methods. |
| void AddDocument(const Document& document); |
| + // Triggers watchers installed to a document. |
| + void TriggerWatchers(const std::string& authority, |
| + const std::string& document_id, |
| + mojom::ChangeType type); |
| + |
| // mojom::FileSystemInstance: |
| void AddWatcher(const std::string& authority, |
| const std::string& document_id, |
| @@ -136,6 +145,8 @@ class FakeFileSystemInstance : public mojom::FileSystemInstance { |
| base::ScopedTempDir temp_dir_; |
| + mojom::FileSystemHostPtr host_; |
| + |
| // Mapping from a content URL to a file. |
| std::map<std::string, File> files_; |
| @@ -145,6 +156,14 @@ class FakeFileSystemInstance : public mojom::FileSystemInstance { |
| // Mapping from a document key to its child documents. |
| std::map<DocumentKey, std::vector<DocumentKey>> child_documents_; |
| + // Mapping from a document key to its watchers. |
| + std::map<DocumentKey, std::set<int64_t>> document_to_watchers_; |
| + |
| + // Mapping from a watcher ID to a document key. |
| + std::map<int64_t, DocumentKey> watcher_to_document_; |
| + |
| + int64_t next_watcher_id_ = 1; |
|
hidehiko
2017/02/23 11:30:45
Just curious: any reasons this id starts from 1 ra
Shuhei Takahashi
2017/02/24 06:08:58
Because 0 is not obvious to me if it indicates fai
|
| + |
| DISALLOW_COPY_AND_ASSIGN(FakeFileSystemInstance); |
| }; |