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/registry.h" | 5 #include "chrome/browser/chromeos/file_system_provider/registry.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 | 153 |
154 TEST_F(FileSystemProviderRegistryTest, RememberFileSystem) { | 154 TEST_F(FileSystemProviderRegistryTest, RememberFileSystem) { |
155 MountOptions options(kFileSystemId, kDisplayName); | 155 MountOptions options(kFileSystemId, kDisplayName); |
156 options.writable = true; | 156 options.writable = true; |
157 options.supports_notify_tag = true; | 157 options.supports_notify_tag = true; |
158 options.opened_files_limit = kOpenedFilesLimit; | 158 options.opened_files_limit = kOpenedFilesLimit; |
159 | 159 |
160 ProvidedFileSystemInfo file_system_info( | 160 ProvidedFileSystemInfo file_system_info( |
161 kExtensionId, options, base::FilePath(FILE_PATH_LITERAL("/a/b/c")), | 161 kExtensionId, options, base::FilePath(FILE_PATH_LITERAL("/a/b/c")), |
162 false /* configurable */, extensions::SOURCE_FILE); | 162 false /* configurable */, true /* watchable */, extensions::SOURCE_FILE); |
163 | 163 |
164 Watchers watchers; | 164 Watchers watchers; |
165 watchers[WatcherKey(fake_watcher_.entry_path, fake_watcher_.recursive)] = | 165 watchers[WatcherKey(fake_watcher_.entry_path, fake_watcher_.recursive)] = |
166 fake_watcher_; | 166 fake_watcher_; |
167 | 167 |
168 registry_->RememberFileSystem(file_system_info, watchers); | 168 registry_->RememberFileSystem(file_system_info, watchers); |
169 | 169 |
170 TestingPrefServiceSyncable* const pref_service = | 170 TestingPrefServiceSyncable* const pref_service = |
171 profile_->GetTestingPrefService(); | 171 profile_->GetTestingPrefService(); |
172 ASSERT_TRUE(pref_service); | 172 ASSERT_TRUE(pref_service); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 &file_systems)); | 268 &file_systems)); |
269 } | 269 } |
270 | 270 |
271 TEST_F(FileSystemProviderRegistryTest, UpdateWatcherTag) { | 271 TEST_F(FileSystemProviderRegistryTest, UpdateWatcherTag) { |
272 MountOptions options(kFileSystemId, kDisplayName); | 272 MountOptions options(kFileSystemId, kDisplayName); |
273 options.writable = true; | 273 options.writable = true; |
274 options.supports_notify_tag = true; | 274 options.supports_notify_tag = true; |
275 | 275 |
276 ProvidedFileSystemInfo file_system_info( | 276 ProvidedFileSystemInfo file_system_info( |
277 kExtensionId, options, base::FilePath(FILE_PATH_LITERAL("/a/b/c")), | 277 kExtensionId, options, base::FilePath(FILE_PATH_LITERAL("/a/b/c")), |
278 false /* configurable */, extensions::SOURCE_FILE); | 278 false /* configurable */, true /* watchable */, extensions::SOURCE_FILE); |
279 | 279 |
280 Watchers watchers; | 280 Watchers watchers; |
281 watchers[WatcherKey(fake_watcher_.entry_path, fake_watcher_.recursive)] = | 281 watchers[WatcherKey(fake_watcher_.entry_path, fake_watcher_.recursive)] = |
282 fake_watcher_; | 282 fake_watcher_; |
283 | 283 |
284 registry_->RememberFileSystem(file_system_info, watchers); | 284 registry_->RememberFileSystem(file_system_info, watchers); |
285 | 285 |
286 fake_watcher_.last_tag = "updated-tag"; | 286 fake_watcher_.last_tag = "updated-tag"; |
287 registry_->UpdateWatcherTag(file_system_info, fake_watcher_); | 287 registry_->UpdateWatcherTag(file_system_info, fake_watcher_); |
288 | 288 |
(...skipping 25 matching lines...) Expand all Loading... |
314 fake_watcher_.entry_path.value(), &watcher)); | 314 fake_watcher_.entry_path.value(), &watcher)); |
315 | 315 |
316 std::string last_tag; | 316 std::string last_tag; |
317 EXPECT_TRUE(watcher->GetStringWithoutPathExpansion(kPrefKeyWatcherLastTag, | 317 EXPECT_TRUE(watcher->GetStringWithoutPathExpansion(kPrefKeyWatcherLastTag, |
318 &last_tag)); | 318 &last_tag)); |
319 EXPECT_EQ(fake_watcher_.last_tag, last_tag); | 319 EXPECT_EQ(fake_watcher_.last_tag, last_tag); |
320 } | 320 } |
321 | 321 |
322 } // namespace file_system_provider | 322 } // namespace file_system_provider |
323 } // namespace chromeos | 323 } // namespace chromeos |
OLD | NEW |