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

Side by Side Diff: chrome/browser/ui/webui/options/options_browsertest.js

Issue 2598353002: The second argument of add/removeEventListener should be an object, null, or undefined
Patch Set: Fix tests Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/test/data/webui/print_preview.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 (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 GEN_INCLUDE(['options_browsertest_base.js']); 5 GEN_INCLUDE(['options_browsertest_base.js']);
6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"'); 6 GEN('#include "chrome/browser/ui/webui/options/options_browsertest.h"');
7 7
8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users'; 8 /** @const */ var SUPERVISED_USERS_PREF = 'profile.managed_users';
9 9
10 /** 10 /**
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 /** 121 /**
122 * Wait for all targets to be hidden. 122 * Wait for all targets to be hidden.
123 * @param {Array<Element>} targets 123 * @param {Array<Element>} targets
124 */ 124 */
125 function waitUntilHidden(targets) { 125 function waitUntilHidden(targets) {
126 function isHidden(el) { return el.hidden; } 126 function isHidden(el) { return el.hidden; }
127 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); } 127 function ensureTransition(el) { ensureTransitionEndEvent(el, 500); }
128 128
129 document.addEventListener('webkitTransitionEnd', function f(e) { 129 document.addEventListener('webkitTransitionEnd', function f(e) {
130 if (targets.indexOf(e.target) >= 0 && targets.every(isHidden)) { 130 if (targets.indexOf(e.target) >= 0 && targets.every(isHidden)) {
131 document.removeEventListener(f, 'webkitTransitionEnd'); 131 document.removeEventListener('webkitTransitionEnd', f);
132 testDone(); 132 testDone();
133 } 133 }
134 }); 134 });
135 135
136 targets.forEach(ensureTransition); 136 targets.forEach(ensureTransition);
137 } 137 }
138 138
139 // Crashes on Mac only. See http://crbug.com/79181 139 // Crashes on Mac only. See http://crbug.com/79181
140 GEN('#if defined(OS_MACOSX)'); 140 GEN('#if defined(OS_MACOSX)');
141 GEN('#define MAYBE_testSetBooleanPrefTriggers ' + 141 GEN('#define MAYBE_testSetBooleanPrefTriggers ' +
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 __proto__: OptionsWebUIExtendedTest.prototype, 959 __proto__: OptionsWebUIExtendedTest.prototype,
960 960
961 /** @override */ 961 /** @override */
962 browsePreload: 'chrome://settings-frame/nonexistantPage', 962 browsePreload: 'chrome://settings-frame/nonexistantPage',
963 }; 963 };
964 964
965 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() { 965 TEST_F('OptionsWebUIRedirectTest', 'TestURL', function() {
966 assertEquals('chrome://settings-frame/', document.location.href); 966 assertEquals('chrome://settings-frame/', document.location.href);
967 this.verifyHistory_([''], testDone); 967 this.verifyHistory_([''], testDone);
968 }); 968 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698