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

Unified Diff: chrome/renderer/extensions/module_system_unittest.cc

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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 | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/native_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/module_system_unittest.cc
diff --git a/chrome/renderer/extensions/module_system_unittest.cc b/chrome/renderer/extensions/module_system_unittest.cc
index f5f7db6d4d0e347111256b670e1ed05d62d8cc83..4c88cca49c644451f0afd8c21413db74d2795847 100644
--- a/chrome/renderer/extensions/module_system_unittest.cc
+++ b/chrome/renderer/extensions/module_system_unittest.cc
@@ -6,13 +6,15 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/renderer/extensions/module_system.h"
+// TODO(cduvall/kalman): Put this file in extensions namespace.
using extensions::ModuleSystem;
using extensions::NativeHandler;
+using extensions::ObjectBackedNativeHandler;
-class CounterNatives : public NativeHandler {
+class CounterNatives : public ObjectBackedNativeHandler {
public:
- explicit CounterNatives(v8::Isolate* isolate)
- : NativeHandler(isolate), counter_(0) {
+ explicit CounterNatives(v8::Handle<v8::Context> context)
+ : ObjectBackedNativeHandler(context), counter_(0) {
RouteFunction("Get", base::Bind(&CounterNatives::Get,
base::Unretained(this)));
RouteFunction("Increment", base::Bind(&CounterNatives::Increment,
@@ -173,7 +175,7 @@ TEST_F(ModuleSystemTest, TestLazyFieldIsOnlyEvaledOnce) {
ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
module_system_->RegisterNativeHandler(
"counter",
- scoped_ptr<NativeHandler>(new CounterNatives(v8::Isolate::GetCurrent())));
+ scoped_ptr<NativeHandler>(new CounterNatives(v8::Context::GetCurrent())));
RegisterModule("lazy",
"requireNative('counter').Increment();"
"exports.x = 5;");
@@ -227,7 +229,7 @@ TEST_F(ModuleSystemTest, TestModulesOnlyGetEvaledOnce) {
ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
module_system_->RegisterNativeHandler(
"counter",
- scoped_ptr<NativeHandler>(new CounterNatives(v8::Isolate::GetCurrent())));
+ scoped_ptr<NativeHandler>(new CounterNatives(v8::Context::GetCurrent())));
RegisterModule("incrementsWhenEvaled",
"requireNative('counter').Increment();");
« no previous file with comments | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/native_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698