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

Side by Side Diff: chrome/renderer/extensions/module_system_unittest.cc

Issue 234413005: Move most of ChromeV8Context to a base ScriptContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: factor feature_channel out of module_system Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h"
5 #include "chrome/test/base/module_system_test.h" 6 #include "chrome/test/base/module_system_test.h"
6 #include "base/memory/scoped_ptr.h" 7 #include "extensions/renderer/module_system.h"
7 #include "chrome/renderer/extensions/module_system.h"
8 8
9 // TODO(cduvall/kalman): Put this file in extensions namespace. 9 // TODO(cduvall/kalman): Put this file in extensions namespace.
10 using extensions::ModuleSystem; 10 using extensions::ModuleSystem;
11 using extensions::NativeHandler; 11 using extensions::NativeHandler;
12 using extensions::ObjectBackedNativeHandler; 12 using extensions::ObjectBackedNativeHandler;
13 13
14 class CounterNatives : public ObjectBackedNativeHandler { 14 class CounterNatives : public ObjectBackedNativeHandler {
15 public: 15 public:
16 explicit CounterNatives(extensions::ChromeV8Context* context) 16 explicit CounterNatives(extensions::ChromeV8Context* context)
17 : ObjectBackedNativeHandler(context), counter_(0) { 17 : ObjectBackedNativeHandler(context), counter_(0) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) { 267 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) {
268 ModuleSystem::NativesEnabledScope natives_enabled_scope( 268 ModuleSystem::NativesEnabledScope natives_enabled_scope(
269 context_->module_system()); 269 context_->module_system());
270 OverrideNativeHandler("thing", "exports.x = 5;"); 270 OverrideNativeHandler("thing", "exports.x = 5;");
271 RegisterModule("test", 271 RegisterModule("test",
272 "var assert = requireNative('assert');" 272 "var assert = requireNative('assert');"
273 "assert.AssertTrue(requireNative('thing').x == 5);"); 273 "assert.AssertTrue(requireNative('thing').x == 5);");
274 context_->module_system()->Require("test"); 274 context_->module_system()->Require("test");
275 } 275 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/object_backed_native_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698