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

Unified Diff: extensions/renderer/script_context_set_unittest.cc

Issue 359413004: Add support for using AMD modules from extensions modules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: extensions_renderer should depend on gin Created 6 years, 5 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/script_context.cc ('k') | extensions/renderer/v8_schema_registry.h » ('j') | 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 48272f16e416cd80049b6bb1d02dcf5f56484ea3..6b8849b54283f66baab8b6cc7eeb7a7713f0f32d 100644
--- a/extensions/renderer/script_context_set_unittest.cc
+++ b/extensions/renderer/script_context_set_unittest.cc
@@ -7,6 +7,8 @@
#include "extensions/common/features/feature.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_context_set.h"
+#include "gin/public/context_holder.h"
+#include "gin/public/isolate_holder.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "v8/include/v8.h"
@@ -19,15 +21,20 @@ TEST(ScriptContextSet, Lifecycle) {
ScriptContextSet context_set;
v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ gin::IsolateHolder isolate_holder(isolate, NULL);
v8::HandleScope handle_scope(isolate);
- v8::Handle<v8::Context> v8_context(v8::Context::New(isolate));
+ gin::ContextHolder context_holder(isolate);
+ context_holder.SetContext(v8::Context::New(isolate));
// Dirty hack, but we don't actually need the frame, and this is easier than
// creating a whole webview.
blink::WebFrame* frame = reinterpret_cast<blink::WebFrame*>(1);
const Extension* extension = NULL;
- ScriptContext* context = new ScriptContext(
- v8_context, frame, extension, Feature::BLESSED_EXTENSION_CONTEXT);
+ ScriptContext* context =
+ new ScriptContext(context_holder.context(),
+ frame,
+ extension,
+ Feature::BLESSED_EXTENSION_CONTEXT);
context_set.Add(context);
EXPECT_EQ(1u, context_set.GetAll().count(context));
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | extensions/renderer/v8_schema_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698