Index: content/public/test/test_browser_thread_bundle.cc |
diff --git a/content/public/test/test_browser_thread_bundle.cc b/content/public/test/test_browser_thread_bundle.cc |
index d68311235a368c3b0b9b5b24e0f3396b51fc8c98..211ecdfa4ab099dc04ba6b1c6f5f2ce8704b6ab9 100644 |
--- a/content/public/test/test_browser_thread_bundle.cc |
+++ b/content/public/test/test_browser_thread_bundle.cc |
@@ -7,6 +7,7 @@ |
#include "base/logging.h" |
#include "base/message_loop/message_loop.h" |
#include "base/run_loop.h" |
+#include "base/test/scoped_task_scheduler.h" |
#include "content/browser/browser_thread_impl.h" |
#include "content/public/test/test_browser_thread.h" |
@@ -52,6 +53,8 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() { |
ui_thread_->Stop(); |
base::RunLoop().RunUntilIdle(); |
+ task_scheduler_.reset(); |
+ |
// |message_loop_| needs to explicitly go away before fake threads in order |
// for DestructionObservers hooked to |message_loop_| to be able to invoke |
// BrowserThread::CurrentlyOn() -- ref. ~TestBrowserThread(). |
@@ -71,6 +74,9 @@ void TestBrowserThreadBundle::Init() { |
message_loop_.reset(new base::MessageLoopForUI()); |
} |
+ task_scheduler_.reset( |
+ new base::test::ScopedTaskScheduler(message_loop_.get())); |
+ |
ui_thread_.reset( |
new TestBrowserThread(BrowserThread::UI, message_loop_.get())); |