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

Unified Diff: content/public/test/test_browser_thread_bundle.cc

Issue 2557083002: Run ScopedTaskScheduler tasks synchronously. (Closed)
Patch Set: rebase Created 4 years 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 | « content/public/test/test_browser_thread_bundle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
« no previous file with comments | « content/public/test/test_browser_thread_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698