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

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

Issue 2767923002: Always use an async TaskScheduler in TestBrowserThreadBundle. (Closed)
Patch Set: fix-test-error Created 3 years, 8 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 | « 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 cc35627cded0adf9701e1b24b70b5f1bf2eca03f..23cc3b54934277f6bd2468197b9bd6e0daee3667 100644
--- a/content/public/test/test_browser_thread_bundle.cc
+++ b/content/public/test/test_browser_thread_bundle.cc
@@ -9,7 +9,6 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/test/scoped_async_task_scheduler.h"
-#include "base/test/scoped_task_scheduler.h"
#include "content/browser/browser_thread_impl.h"
#include "content/public/test/test_browser_thread.h"
@@ -58,7 +57,8 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() {
base::RunLoop().RunUntilIdle();
scoped_async_task_scheduler_.reset();
- scoped_task_scheduler_.reset();
+
+ base::RunLoop().RunUntilIdle();
// |message_loop_| needs to explicitly go away before fake threads in order
// for DestructionObservers hooked to |message_loop_| to be able to invoke
@@ -92,13 +92,8 @@ void TestBrowserThreadBundle::Init() {
void TestBrowserThreadBundle::CreateThreads() {
DCHECK(!threads_created_);
- if (options_ & REAL_TASK_SCHEDULER) {
- scoped_async_task_scheduler_ =
- base::MakeUnique<base::test::ScopedAsyncTaskScheduler>();
- } else {
- scoped_task_scheduler_ =
- base::MakeUnique<base::test::ScopedTaskScheduler>(message_loop_.get());
- }
+ scoped_async_task_scheduler_ =
+ base::MakeUnique<base::test::ScopedAsyncTaskScheduler>();
if (options_ & REAL_DB_THREAD) {
db_thread_.reset(new TestBrowserThread(BrowserThread::DB));
« 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