| 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
|
|
|