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

Unified Diff: extensions/renderer/gc_callback_unittest.cc

Issue 2852373004: Use ScopedTaskEnvironment instead of MessageLoop in tests that use v8. (Closed)
Patch Set: Reset-RenderViewTest Created 3 years, 7 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 | « extensions/renderer/api_binding_test.h ('k') | gin/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/gc_callback_unittest.cc
diff --git a/extensions/renderer/gc_callback_unittest.cc b/extensions/renderer/gc_callback_unittest.cc
index 483f134dbec2361eeb1047c390c83fcb9d47e6b6..c03270d3c60c808bd647fe91822bb6b456bcb5ef 100644
--- a/extensions/renderer/gc_callback_unittest.cc
+++ b/extensions/renderer/gc_callback_unittest.cc
@@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "extensions/renderer/gc_callback.h"
+
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/features/feature.h"
-#include "extensions/renderer/gc_callback.h"
#include "extensions/renderer/scoped_web_frame.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_context_set.h"
@@ -34,8 +35,6 @@ class GCCallbackTest : public testing::Test {
GCCallbackTest() : script_context_set_(&active_extensions_) {}
protected:
- base::MessageLoop& message_loop() { return message_loop_; }
-
ScriptContextSet& script_context_set() { return script_context_set_; }
v8::Local<v8::Context> v8_context() {
@@ -71,7 +70,8 @@ class GCCallbackTest : public testing::Test {
RequestGarbageCollection();
}
- base::MessageLoop message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
+
ScopedWebFrame web_frame_; // (this will construct the v8::Isolate)
// ExtensionsRendererClient is a dependency of ScriptContextSet.
TestExtensionsRendererClient extensions_renderer_client_;
« no previous file with comments | « extensions/renderer/api_binding_test.h ('k') | gin/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698