| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 // Helper / error handling functions. | 7 // Helper / error handling functions. |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Prints a debug message. | 10 * Prints a debug message. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 /** | 26 /** |
| 27 * Fails the test by generating an exception. If the test automation is calling | 27 * Fails the test by generating an exception. If the test automation is calling |
| 28 * into us, make sure to fail the test as fast as possible. You must use this | 28 * into us, make sure to fail the test as fast as possible. You must use this |
| 29 * function like this: | 29 * function like this: |
| 30 * | 30 * |
| 31 * throw failTest('my reason'); | 31 * throw failTest('my reason'); |
| 32 * | 32 * |
| 33 * @return {!Error} | 33 * @return {!Error} |
| 34 */ | 34 */ |
| 35 function failTest(reason) { | 35 function failTest(reason) { |
| 36 returnToTest('Test failed: ' + reason); | 36 var error = new Error(reason); |
| 37 return new Error(reason); | 37 returnToTest('Test failed: ' + error.stack); |
| 38 return error; |
| 38 } | 39 } |
| OLD | NEW |