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

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

Issue 15855010: Make ExtensionMsg_MessageInvoke run a module system function rather than a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test compile Created 7 years, 6 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/extensions/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;
(...skipping 22 matching lines...) Expand all
33 private: 33 private:
34 int counter_; 34 int counter_;
35 }; 35 };
36 36
37 class TestExceptionHandler : public ModuleSystem::ExceptionHandler { 37 class TestExceptionHandler : public ModuleSystem::ExceptionHandler {
38 public: 38 public:
39 TestExceptionHandler() 39 TestExceptionHandler()
40 : handled_exception_(false) { 40 : handled_exception_(false) {
41 } 41 }
42 42
43 virtual void HandleUncaughtException() OVERRIDE { 43 virtual void HandleUncaughtException(const v8::TryCatch& try_catch) OVERRIDE {
44 handled_exception_ = true; 44 handled_exception_ = true;
45 } 45 }
46 46
47 bool handled_exception() const { return handled_exception_; } 47 bool handled_exception() const { return handled_exception_; }
48 48
49 private: 49 private:
50 bool handled_exception_; 50 bool handled_exception_;
51 }; 51 };
52 52
53 TEST_F(ModuleSystemTest, TestExceptionHandling) { 53 TEST_F(ModuleSystemTest, TestExceptionHandling) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 255
256 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) { 256 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) {
257 ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get()); 257 ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
258 OverrideNativeHandler("thing", "exports.x = 5;"); 258 OverrideNativeHandler("thing", "exports.x = 5;");
259 RegisterModule("test", 259 RegisterModule("test",
260 "var assert = requireNative('assert');" 260 "var assert = requireNative('assert');"
261 "assert.AssertTrue(requireNative('thing').x == 5);"); 261 "assert.AssertTrue(requireNative('thing').x == 5);");
262 module_system_->Require("test"); 262 module_system_->Require("test");
263 } 263 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/webstore_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698