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

Unified Diff: content/test/blink_test_environment.cc

Issue 2610473002: Use TaskScheduler instead of WorkerPool in v8_platform.cc. (Closed)
Patch Set: rebase Created 3 years, 10 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/renderer/pepper/host_var_tracker_unittest.cc ('k') | extensions/renderer/api_binding_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/blink_test_environment.cc
diff --git a/content/test/blink_test_environment.cc b/content/test/blink_test_environment.cc
index 510662545c2960e90a935da13a11dfecc7fc1e28..67c7a1bb4ea3cce545a08aea20308b2fde95d84c 100644
--- a/content/test/blink_test_environment.cc
+++ b/content/test/blink_test_environment.cc
@@ -10,6 +10,7 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/string_tokenizer.h"
+#include "base/test/scoped_async_task_scheduler.h"
#include "base/test/test_discardable_memory_allocator.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "build/build_config.h"
@@ -36,17 +37,9 @@ namespace {
class TestEnvironment {
public:
-#if defined(OS_ANDROID)
- // Android UI message loop goes through Java, so don't use it in tests.
- typedef base::MessageLoop MessageLoopType;
-#else
- typedef base::MessageLoopForUI MessageLoopType;
-#endif
-
TestEnvironment() {
- main_message_loop_.reset(new MessageLoopType);
-
- // TestBlinkWebUnitTestSupport must be instantiated after MessageLoopType.
+ // TestBlinkWebUnitTestSupport must be instantiated after the main
+ // MessageLoop.
blink_test_support_.reset(new TestBlinkWebUnitTestSupport);
content_initializer_.reset(new content::TestContentClientInitializer());
@@ -62,7 +55,17 @@ class TestEnvironment {
}
private:
- std::unique_ptr<MessageLoopType> main_message_loop_;
+#if defined(OS_ANDROID)
+ // Android UI message loop goes through Java, so don't use it in tests.
+ base::MessageLoop main_message_loop_;
+#else
+ base::MessageLoopForUI main_message_loop_;
+#endif
+
+ // Required by gin::V8Platform::CallOnBackgroundThread(). Can't be a
+ // ScopedTaskScheduler because v8 synchronously waits for tasks to run.
+ base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler;
+
std::unique_ptr<TestBlinkWebUnitTestSupport> blink_test_support_;
std::unique_ptr<TestContentClientInitializer> content_initializer_;
base::TestDiscardableMemoryAllocator discardable_memory_allocator_;
« no previous file with comments | « content/renderer/pepper/host_var_tracker_unittest.cc ('k') | extensions/renderer/api_binding_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698