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

Unified Diff: extensions/renderer/script_context_set_unittest.cc

Issue 1210513002: ScriptContextSetTest should close the main frame before finishing the test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/scoped_web_frame.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_context_set_unittest.cc
diff --git a/extensions/renderer/script_context_set_unittest.cc b/extensions/renderer/script_context_set_unittest.cc
index 44da610fc9c5cd5c0525a56f47926cf8c9e6bf10..ea9d0013fda8e23b09660d16a3e9ea210eafd3ce 100644
--- a/extensions/renderer/script_context_set_unittest.cc
+++ b/extensions/renderer/script_context_set_unittest.cc
@@ -8,23 +8,19 @@
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/features/feature.h"
+#include "extensions/renderer/scoped_web_frame.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_context_set.h"
#include "gin/public/context_holder.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/WebKit/public/web/WebLocalFrame.h"
-#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/WebKit/public/web/WebFrame.h"
#include "v8/include/v8.h"
namespace extensions {
TEST(ScriptContextSetTest, Lifecycle) {
base::MessageLoop loop;
-
- blink::WebView* webview = blink::WebView::create(nullptr);
- blink::WebLocalFrame* frame =
- blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, nullptr);
- webview->setMainFrame(frame);
+ ScopedWebFrame web_frame;
// Do this after construction of the webview, since it may construct the
// Isolate.
@@ -41,11 +37,11 @@ TEST(ScriptContextSetTest, Lifecycle) {
ExtensionIdSet active_extensions;
ScriptContextSet context_set(&extensions, &active_extensions);
ScriptContext* context = context_set.Register(
- frame, v8_context, 0, 0); // no extension group or world ID
+ web_frame.frame(), v8_context, 0, 0); // no extension group or world ID
// Context is valid and resembles correctness.
EXPECT_TRUE(context->is_valid());
- EXPECT_EQ(frame, context->web_frame());
+ EXPECT_EQ(web_frame.frame(), context->web_frame());
EXPECT_EQ(v8_context, context->v8_context());
// Context has been correctly added.
« no previous file with comments | « extensions/renderer/scoped_web_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698