| 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 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" | 5 #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 const ProvidedFileSystemObserver::ChildChanges child_changes_; | 117 const ProvidedFileSystemObserver::ChildChanges child_changes_; |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(ChangeEvent); | 119 DISALLOW_COPY_AND_ASSIGN(ChangeEvent); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 Observer() : list_changed_counter_(0), tag_updated_counter_(0) {} | 122 Observer() : list_changed_counter_(0), tag_updated_counter_(0) {} |
| 123 | 123 |
| 124 // ProvidedFileSystemInterfaceObserver overrides. | 124 // ProvidedFileSystemInterfaceObserver overrides. |
| 125 virtual void OnObservedEntryChanged( | 125 virtual void OnObservedEntryChanged( |
| 126 const ProvidedFileSystemInfo& file_system_info, | 126 const ProvidedFileSystemInfo& file_system_info, |
| 127 const base::FilePath& observed_path, | 127 const ObservedEntry& observed_entry, |
| 128 ProvidedFileSystemObserver::ChangeType change_type, | 128 ProvidedFileSystemObserver::ChangeType change_type, |
| 129 const ProvidedFileSystemObserver::ChildChanges& child_changes, | 129 const ProvidedFileSystemObserver::ChildChanges& child_changes, |
| 130 const base::Closure& callback) override { | 130 const base::Closure& callback) override { |
| 131 EXPECT_EQ(kFileSystemId, file_system_info.file_system_id()); | 131 EXPECT_EQ(kFileSystemId, file_system_info.file_system_id()); |
| 132 change_events_.push_back(new ChangeEvent(change_type, child_changes)); | 132 change_events_.push_back(new ChangeEvent(change_type, child_changes)); |
| 133 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); | 133 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); |
| 134 } | 134 } |
| 135 | 135 |
| 136 virtual void OnObservedEntryTagUpdated( | 136 virtual void OnObservedEntryTagUpdated( |
| 137 const ProvidedFileSystemInfo& file_system_info, | 137 const ProvidedFileSystemInfo& file_system_info, |
| 138 const base::FilePath& observed_path, | 138 const ObservedEntry& observed_entry) override { |
| 139 const std::string& tag) override { | |
| 140 EXPECT_EQ(kFileSystemId, file_system_info.file_system_id()); | 139 EXPECT_EQ(kFileSystemId, file_system_info.file_system_id()); |
| 141 ++tag_updated_counter_; | 140 ++tag_updated_counter_; |
| 142 } | 141 } |
| 143 | 142 |
| 144 virtual void OnObservedEntryListChanged( | 143 virtual void OnObservedEntryListChanged( |
| 145 const ProvidedFileSystemInfo& file_system_info, | 144 const ProvidedFileSystemInfo& file_system_info, |
| 146 const ObservedEntries& observed_entries) override { | 145 const ObservedEntries& observed_entries) override { |
| 147 EXPECT_EQ(kFileSystemId, file_system_info.file_system_id()); | 146 EXPECT_EQ(kFileSystemId, file_system_info.file_system_id()); |
| 148 ++list_changed_counter_; | 147 ++list_changed_counter_; |
| 149 } | 148 } |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 EXPECT_EQ(0u, observed_entries->size()); | 600 EXPECT_EQ(0u, observed_entries->size()); |
| 602 EXPECT_EQ(2, observer.list_changed_counter()); | 601 EXPECT_EQ(2, observer.list_changed_counter()); |
| 603 EXPECT_EQ(2, observer.tag_updated_counter()); | 602 EXPECT_EQ(2, observer.tag_updated_counter()); |
| 604 } | 603 } |
| 605 | 604 |
| 606 provided_file_system_->RemoveObserver(&observer); | 605 provided_file_system_->RemoveObserver(&observer); |
| 607 } | 606 } |
| 608 | 607 |
| 609 } // namespace file_system_provider | 608 } // namespace file_system_provider |
| 610 } // namespace chromeos | 609 } // namespace chromeos |
| OLD | NEW |