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

Unified Diff: chrome/browser/chromeos/file_manager/file_watcher_unittest.cc

Issue 2965903002: Revert of file_manager: Migrate FILE thread to TaskScheduler (Closed)
Patch Set: Created 3 years, 5 months 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
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_watcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_manager/file_watcher_unittest.cc
diff --git a/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc b/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc
index 9ebf99cc6179dc062c21230feccee006e0acd572..6ba94877551948434960fe90a328bc6d22f3e523 100644
--- a/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc
+++ b/chrome/browser/chromeos/file_manager/file_watcher_unittest.cc
@@ -8,7 +8,6 @@
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
-#include "base/task_scheduler/task_scheduler.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/drive/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -130,9 +129,7 @@
CreateQuitCallback(
&run_loop, CreateCopyResultCallback(&changed_path, &on_change_error)),
CreateCopyResultCallback(&watcher_created));
- // Flush the task scheduler and spin the message loop and so the
- // base::FilePathWatcher is created.
- base::TaskScheduler::GetInstance()->FlushForTesting();
+ // Spin the message loop so the base::FilePathWatcher is created.
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(watcher_created);
@@ -147,11 +144,11 @@
ASSERT_EQ(temp_dir.GetPath().value(), changed_path.value());
// This is ugly, but FileWatcher should be deleted explicitly here, and
- // flush the task scheduler, so the base::FilePathWatcher is deleted.
+ // spin the message loop so the base::FilePathWatcher is deleted.
// Otherwise, base::FilePathWatcher may detect a change when the temporary
// directory is deleted, which may result in crash.
file_watcher.reset();
- base::TaskScheduler::GetInstance()->FlushForTesting();
+ base::RunLoop().RunUntilIdle();
}
} // namespace
« no previous file with comments | « chrome/browser/chromeos/file_manager/file_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698