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

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

Issue 10535030: Allow updateArgumentsPostValidate to support callbacks and added / removed arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Proper syntax Created 8 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
« no previous file with comments | « no previous file | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6
7 #include "grit/renderer_resources.h" 7 #include "grit/renderer_resources.h"
8 8
9 namespace { 9 namespace {
10 10
11 class EventUnittest : public ModuleSystemTest { 11 class EventUnittest : public ModuleSystemTest {
12 virtual void SetUp() OVERRIDE { 12 virtual void SetUp() OVERRIDE {
13 ModuleSystemTest::SetUp(); 13 ModuleSystemTest::SetUp();
14 module_system_->RunString("chrome = {};", "setup-chrome"); 14 module_system_->RunString("chrome = {};", "setup-chrome");
15 15
16 RegisterModule("event", IDR_EVENT_BINDINGS_JS); 16 RegisterModule("event", IDR_EVENT_BINDINGS_JS);
17 RegisterModule("schemaUtils", IDR_SCHEMA_UTILS_JS);
17 RegisterModule("utils", IDR_UTILS_JS); 18 RegisterModule("utils", IDR_UTILS_JS);
18 19
19 // Mock out the native handler for event_bindings. These mocks will fail if 20 // Mock out the native handler for event_bindings. These mocks will fail if
20 // any invariants maintained by the real event_bindings are broken. 21 // any invariants maintained by the real event_bindings are broken.
21 OverrideNativeHandler("event_bindings", 22 OverrideNativeHandler("event_bindings",
22 "var assert = requireNative('assert');" 23 "var assert = requireNative('assert');"
23 "var attachedListeners = exports.attachedListeners = {};" 24 "var attachedListeners = exports.attachedListeners = {};"
24 "exports.AttachEvent = function(eventName) {" 25 "exports.AttachEvent = function(eventName) {"
25 " assert.AssertFalse(!!attachedListeners[eventName]);" 26 " assert.AssertFalse(!!attachedListeners[eventName]);"
26 " attachedListeners[eventName] = 1;" 27 " attachedListeners[eventName] = 1;"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 "var assert = requireNative('assert');" 86 "var assert = requireNative('assert');"
86 "var e = new event.Event('myevent');" 87 "var e = new event.Event('myevent');"
87 "var called = false;" 88 "var called = false;"
88 "e.addListener(function() { called = true; });" 89 "e.addListener(function() { called = true; });"
89 "chromeHidden.Event.dispatch('myevent', []);" 90 "chromeHidden.Event.dispatch('myevent', []);"
90 "assert.AssertTrue(called);"); 91 "assert.AssertTrue(called);");
91 module_system_->Require("test"); 92 module_system_->Require("test");
92 } 93 }
93 94
94 } // namespace 95 } // namespace
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698