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

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

Issue 10879107: Move ModuleSystem and NativeHandler to extensions/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 "chrome/test/base/module_system_test.h" 5 #include "chrome/test/base/module_system_test.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "chrome/renderer/module_system.h" 7 #include "chrome/renderer/extensions/module_system.h"
8
9 using extensions::ModuleSystem;
10 using extensions::NativeHandler;
8 11
9 class CounterNatives : public NativeHandler { 12 class CounterNatives : public NativeHandler {
10 public: 13 public:
11 CounterNatives() : counter_(0) { 14 CounterNatives() : counter_(0) {
12 RouteFunction("Get", base::Bind(&CounterNatives::Get, 15 RouteFunction("Get", base::Bind(&CounterNatives::Get,
13 base::Unretained(this))); 16 base::Unretained(this)));
14 RouteFunction("Increment", base::Bind(&CounterNatives::Increment, 17 RouteFunction("Increment", base::Bind(&CounterNatives::Increment,
15 base::Unretained(this))); 18 base::Unretained(this)));
16 } 19 }
17 20
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 221 }
219 222
220 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) { 223 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) {
221 ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get()); 224 ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
222 OverrideNativeHandler("thing", "exports.x = 5;"); 225 OverrideNativeHandler("thing", "exports.x = 5;");
223 RegisterModule("test", 226 RegisterModule("test",
224 "var assert = requireNative('assert');" 227 "var assert = requireNative('assert');"
225 "assert.AssertTrue(requireNative('thing').x == 5);"); 228 "assert.AssertTrue(requireNative('thing').x == 5);");
226 module_system_->Require("test"); 229 module_system_->Require("test");
227 } 230 }
OLDNEW
« 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