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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js

Issue 1463763002: Add event name to bare removeEventListener(listener) calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_browsertest.js » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 test fixture. 5 // Include test fixture.
6 GEN_INCLUDE(['chromevox_e2e_test_base.js']); 6 GEN_INCLUDE(['chromevox_e2e_test_base.js']);
7 7
8 /** 8 /**
9 * Base test fixture for ChromeVox Next end to end tests. 9 * Base test fixture for ChromeVox Next end to end tests.
10 * 10 *
(...skipping 21 matching lines...) Expand all
32 * Called once the document is ready. 32 * Called once the document is ready.
33 */ 33 */
34 runWithLoadedTree: function(doc, callback) { 34 runWithLoadedTree: function(doc, callback) {
35 callback = this.newCallback(callback); 35 callback = this.newCallback(callback);
36 chrome.automation.getDesktop(function(r) { 36 chrome.automation.getDesktop(function(r) {
37 var listener = function(evt) { 37 var listener = function(evt) {
38 if (!evt.target.docUrl || 38 if (!evt.target.docUrl ||
39 evt.target.docUrl.indexOf('test') == -1) 39 evt.target.docUrl.indexOf('test') == -1)
40 return; 40 return;
41 41
42 r.removeEventListener(listener); 42 r.removeEventListener('loadComplete', listener, true);
43 callback && callback(evt.target); 43 callback && callback(evt.target);
44 callback = null; 44 callback = null;
45 }; 45 };
46 r.addEventListener('loadComplete', listener, true); 46 r.addEventListener('loadComplete', listener, true);
47 this.runWithTab(doc); 47 this.runWithTab(doc);
48 }.bind(this)); 48 }.bind(this));
49 }, 49 },
50 50
51 listenOnce: function(node, eventType, callback, capture) { 51 listenOnce: function(node, eventType, callback, capture) {
52 var innerCallback = this.newCallback(function() { 52 var innerCallback = this.newCallback(function() {
53 node.removeEventListener(eventType, innerCallback, capture); 53 node.removeEventListener(eventType, innerCallback, capture);
54 callback.apply(this, arguments); 54 callback.apply(this, arguments);
55 }); 55 });
56 node.addEventListener(eventType, innerCallback, capture); 56 node.addEventListener(eventType, innerCallback, capture);
57 } 57 }
58 }; 58 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/options_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698