| 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 */ |
| 6 |
| 5 /** @type {!{notifyDone: function()}|undefined} */ | 7 /** @type {!{notifyDone: function()}|undefined} */ |
| 6 self.testRunner; | 8 self.testRunner; |
| 7 | 9 |
| 8 TestRunner.executeTestScript = function() { | 10 TestRunner.executeTestScript = function() { |
| 9 fetch(`${Runtime.queryParam('test')}`) | 11 fetch(`${Runtime.queryParam('test')}`) |
| 10 .then((data) => data.text()) | 12 .then((data) => data.text()) |
| 11 .then((testScript) => eval(`(function(){${testScript}})()`)) | 13 .then((testScript) => eval(`(function(){${testScript}})()`)) |
| 12 .catch((error) => { | 14 .catch((error) => { |
| 13 TestRunner.addResult(`Unable to execute test script because of error: ${
error}`); | 15 TestRunner.addResult(`Unable to execute test script because of error: ${
error}`); |
| 14 TestRunner.completeTest(); | 16 TestRunner.completeTest(); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 * @param {number} colno | 144 * @param {number} colno |
| 143 * @param {!Error} error | 145 * @param {!Error} error |
| 144 */ | 146 */ |
| 145 function completeTestOnError(message, source, lineno, colno, error) { | 147 function completeTestOnError(message, source, lineno, colno, error) { |
| 146 TestRunner.addResult('TEST ENDED IN ERROR: ' + error.stack); | 148 TestRunner.addResult('TEST ENDED IN ERROR: ' + error.stack); |
| 147 TestRunner.completeTest(); | 149 TestRunner.completeTest(); |
| 148 } | 150 } |
| 149 | 151 |
| 150 self['onerror'] = completeTestOnError; | 152 self['onerror'] = completeTestOnError; |
| 151 })(); | 153 })(); |
| OLD | NEW |