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

Unified Diff: chrome/test/base/module_system_test.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/test/base/module_system_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/module_system_test.cc
diff --git a/chrome/test/base/module_system_test.cc b/chrome/test/base/module_system_test.cc
index 9eef4dae9b05c3522e3f264a1f5494f6a2657bae..c1f6517eb9a68da03c11dbbb3465f6c863124425 100644
--- a/chrome/test/base/module_system_test.cc
+++ b/chrome/test/base/module_system_test.cc
@@ -7,7 +7,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_piece.h"
-#include "chrome/renderer/extensions/native_handler.h"
+#include "chrome/renderer/extensions/object_backed_native_handler.h"
#include "ui/base/resource/resource_bundle.h"
#include <map>
@@ -15,12 +15,13 @@
using extensions::ModuleSystem;
using extensions::NativeHandler;
+using extensions::ObjectBackedNativeHandler;
// Native JS functions for doing asserts.
-class AssertNatives : public NativeHandler {
+class AssertNatives : public ObjectBackedNativeHandler {
public:
- explicit AssertNatives(v8::Isolate* isolate)
- : NativeHandler(isolate),
+ explicit AssertNatives(v8::Handle<v8::Context> context)
+ : ObjectBackedNativeHandler(context),
assertion_made_(false),
failed_(false) {
RouteFunction("AssertTrue", base::Bind(&AssertNatives::AssertTrue,
@@ -88,8 +89,8 @@ ModuleSystemTest::ModuleSystemTest()
source_map_(new StringSourceMap()),
should_assertions_be_made_(true) {
context_->Enter();
- assert_natives_ = new AssertNatives(context_->GetIsolate());
- module_system_.reset(new ModuleSystem(context_, source_map_.get()));
+ assert_natives_ = new AssertNatives(context_.get());
+ module_system_.reset(new ModuleSystem(context_.get(), source_map_.get()));
module_system_->RegisterNativeHandler("assert", scoped_ptr<NativeHandler>(
assert_natives_));
module_system_->set_exception_handler(
@@ -99,7 +100,6 @@ ModuleSystemTest::ModuleSystemTest()
ModuleSystemTest::~ModuleSystemTest() {
module_system_.reset();
context_->Exit();
- context_.Dispose(context_->GetIsolate());
}
void ModuleSystemTest::RegisterModule(const std::string& name,
« no previous file with comments | « chrome/test/base/module_system_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698