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

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

Issue 12226045: Linux/ChromeOS Chromium style checker cleanup, chrome/ edition part 1. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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 using extensions::ModuleSystem; 9 using extensions::ModuleSystem;
10 using extensions::NativeHandler; 10 using extensions::NativeHandler;
(...skipping 20 matching lines...) Expand all
31 private: 31 private:
32 int counter_; 32 int counter_;
33 }; 33 };
34 34
35 class TestExceptionHandler : public ModuleSystem::ExceptionHandler { 35 class TestExceptionHandler : public ModuleSystem::ExceptionHandler {
36 public: 36 public:
37 TestExceptionHandler() 37 TestExceptionHandler()
38 : handled_exception_(false) { 38 : handled_exception_(false) {
39 } 39 }
40 40
41 virtual void HandleUncaughtException() { 41 virtual void HandleUncaughtException() OVERRIDE {
42 handled_exception_ = true; 42 handled_exception_ = true;
43 } 43 }
44 44
45 bool handled_exception() const { return handled_exception_; } 45 bool handled_exception() const { return handled_exception_; }
46 46
47 private: 47 private:
48 bool handled_exception_; 48 bool handled_exception_;
49 }; 49 };
50 50
51 TEST_F(ModuleSystemTest, TestExceptionHandling) { 51 TEST_F(ModuleSystemTest, TestExceptionHandling) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) { 254 TEST_F(ModuleSystemTest, TestOverrideNonExistentNativeHandler) {
255 ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get()); 255 ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
256 OverrideNativeHandler("thing", "exports.x = 5;"); 256 OverrideNativeHandler("thing", "exports.x = 5;");
257 RegisterModule("test", 257 RegisterModule("test",
258 "var assert = requireNative('assert');" 258 "var assert = requireNative('assert');"
259 "assert.AssertTrue(requireNative('thing').x == 5);"); 259 "assert.AssertTrue(requireNative('thing').x == 5);");
260 module_system_->Require("test"); 260 module_system_->Require("test");
261 } 261 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/miscellaneous_bindings.cc ('k') | chrome/renderer/external_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698