Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3244)

Unified Diff: chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc

Issue 703123003: [fsp] Pass more detailed errors to the providing extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a bug. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc b/chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc
index 905458dc7fe39b595ed6339be664b1726a8464a0..649e1ac68fa042faf6ac59443de8649285e796d7 100644
--- a/chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/provided_file_system_unittest.cc
@@ -757,12 +757,12 @@ TEST_F(FileSystemProviderProvidedFileSystemTest, Notify) {
const storage::WatcherManager::ChangeType change_type =
storage::WatcherManager::CHANGED;
const std::string tag = "hello-world";
- EXPECT_TRUE(provided_file_system_->Notify(
- base::FilePath::FromUTF8Unsafe(kDirectoryPath),
- false /* recursive */,
- change_type,
- make_scoped_ptr(new ProvidedFileSystemObserver::Changes),
- tag));
+
+ Log log;
+ provided_file_system_->Notify(
+ base::FilePath::FromUTF8Unsafe(kDirectoryPath), false /* recursive */,
+ change_type, make_scoped_ptr(new ProvidedFileSystemObserver::Changes),
+ tag, base::Bind(&LogStatus, base::Unretained(&log)));
// Confirm that the notification callback was called.
ASSERT_EQ(1u, notification_log.size());
@@ -785,6 +785,9 @@ TEST_F(FileSystemProviderProvidedFileSystemTest, Notify) {
// Wait until all observers finish handling the notification.
base::RunLoop().RunUntilIdle();
+ ASSERT_EQ(1u, log.size());
+ EXPECT_EQ(base::File::FILE_OK, log[0]);
+
// Confirm, that the watcher still exists, and that the tag is updated.
ASSERT_EQ(1u, watchers->size());
EXPECT_EQ(tag, watchers->begin()->second.last_tag);
@@ -798,13 +801,15 @@ TEST_F(FileSystemProviderProvidedFileSystemTest, Notify) {
storage::WatcherManager::DELETED;
const ProvidedFileSystemObserver::Changes changes;
const std::string tag = "chocolate-disco";
- EXPECT_TRUE(provided_file_system_->Notify(
- base::FilePath::FromUTF8Unsafe(kDirectoryPath),
- false /* recursive */,
- change_type,
- make_scoped_ptr(new ProvidedFileSystemObserver::Changes),
- tag));
+
+ Log log;
+ provided_file_system_->Notify(
+ base::FilePath::FromUTF8Unsafe(kDirectoryPath), false /* recursive */,
+ change_type, make_scoped_ptr(new ProvidedFileSystemObserver::Changes),
+ tag, base::Bind(&LogStatus, base::Unretained(&log)));
base::RunLoop().RunUntilIdle();
+ ASSERT_EQ(1u, log.size());
+ EXPECT_EQ(base::File::FILE_OK, log[0]);
// Confirm that the notification callback was called.
ASSERT_EQ(2u, notification_log.size());

Powered by Google App Engine
This is Rietveld 408576698