OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /* eslint-disable no-console */ | 5 /* eslint-disable no-console */ |
6 | 6 |
7 /** @type {!{notifyDone: function()}|undefined} */ | 7 /** @type {!{notifyDone: function()}|undefined} */ |
8 self.testRunner; | 8 self.testRunner; |
9 | 9 |
10 TestRunner.executeTestScript = function() { | 10 TestRunner.executeTestScript = function() { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 /** | 111 /** |
112 * @param {!Array<string>} lazyModules | 112 * @param {!Array<string>} lazyModules |
113 * @return {!Promise<!Array<undefined>>} | 113 * @return {!Promise<!Array<undefined>>} |
114 */ | 114 */ |
115 TestRunner.loadLazyModules = function(lazyModules) { | 115 TestRunner.loadLazyModules = function(lazyModules) { |
116 return Promise.all(lazyModules.map(lazyModule => self.runtime.loadModulePromis
e(lazyModule))); | 116 return Promise.all(lazyModules.map(lazyModule => self.runtime.loadModulePromis
e(lazyModule))); |
117 }; | 117 }; |
118 | 118 |
119 /** | 119 /** |
120 * @param {string} key | 120 * @param {string} key |
121 * @param {boolean} ctrlKey | 121 * @param {boolean=} ctrlKey |
122 * @param {boolean} altKey | 122 * @param {boolean=} altKey |
123 * @param {boolean} shiftKey | 123 * @param {boolean=} shiftKey |
124 * @param {boolean} metaKey | 124 * @param {boolean=} metaKey |
125 * @return {!KeyboardEvent} | 125 * @return {!KeyboardEvent} |
126 */ | 126 */ |
127 TestRunner.createKeyEvent = function(key, ctrlKey, altKey, shiftKey, metaKey) { | 127 TestRunner.createKeyEvent = function(key, ctrlKey, altKey, shiftKey, metaKey) { |
128 return new KeyboardEvent('keydown', { | 128 return new KeyboardEvent('keydown', { |
129 key: key, | 129 key: key, |
130 bubbles: true, | 130 bubbles: true, |
131 cancelable: true, | 131 cancelable: true, |
132 ctrlKey: ctrlKey, | 132 ctrlKey: !!ctrlKey, |
133 altKey: altKey, | 133 altKey: !!altKey, |
134 shiftKey: shiftKey, | 134 shiftKey: !!shiftKey, |
135 metaKey: metaKey | 135 metaKey: !!metaKey |
136 }); | 136 }); |
137 }; | 137 }; |
138 | 138 |
139 (function() { | 139 (function() { |
140 /** | 140 /** |
141 * @param {string|!Event} message | 141 * @param {string|!Event} message |
142 * @param {string} source | 142 * @param {string} source |
143 * @param {number} lineno | 143 * @param {number} lineno |
144 * @param {number} colno | 144 * @param {number} colno |
145 * @param {!Error} error | 145 * @param {!Error} error |
146 */ | 146 */ |
147 function completeTestOnError(message, source, lineno, colno, error) { | 147 function completeTestOnError(message, source, lineno, colno, error) { |
148 TestRunner.addResult('TEST ENDED IN ERROR: ' + error.stack); | 148 TestRunner.addResult('TEST ENDED IN ERROR: ' + error.stack); |
149 TestRunner.completeTest(); | 149 TestRunner.completeTest(); |
150 } | 150 } |
151 | 151 |
152 self['onerror'] = completeTestOnError; | 152 self['onerror'] = completeTestOnError; |
153 })(); | 153 })(); |
OLD | NEW |