Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/resources/audit.js |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js |
| index d2946161efbb1f2cd2f707a8d6487db5145ddee8..6bd7cef23eed3f8388d1a9e376401ff136f9e2e2 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js |
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js |
| @@ -269,10 +269,14 @@ window.Audit = (function () { |
| * should(() => { let a = b; }, 'A bad code').throw(); |
| * should(() => { let c = d; }, 'Assigning d to c.') |
| * .throw('ReferenceError'); |
| + * should(() => { let e = f; }, 'Assigning e to f.') |
| + * .throw('ReferenceError', { omitErrorMessage: true }); |
| * |
| * @result |
| - * "PASS A bad code threw an exception of ReferenceError." |
| - * "PASS Assigning d to c threw ReferenceError." |
| + * "PASS A bad code threw an exception of ReferenceError: b is not |
| + * defined." |
| + * "PASS Assigning d to c threw ReferenceError: d is not defined." |
| + * "PASS Assigning e to f threw ReferenceError." |
| */ |
| throw () { |
| this._processArguments(arguments); |
| @@ -287,16 +291,17 @@ window.Audit = (function () { |
| // Catch did not happen, so the test is failed. |
| failDetail = '${actual} did not throw an exception.'; |
| } catch (error) { |
| + let errorMessage = this._options.omitErrorMessage |
| + ? '' |
|
Raymond Toy
2017/04/06 20:06:59
If omitErrorMessage is true, perhaps we want to ou
hongchan
2017/04/06 20:38:17
Done.
|
| + : ': "' + error.message + '"'; |
| if (this._expected === null || this._expected === undefined) { |
| // The expected error type was not given. |
| didThrowCorrectly = true; |
| - passDetail = '${actual} threw ' + error.name + ': "' |
| - + error.message + '".'; |
| + passDetail = '${actual} threw ' + error.name + errorMessage + '.'; |
| } else if (error.name === this._expected) { |
| // The expected error type match the actual one. |
| didThrowCorrectly = true; |
| - passDetail = '${actual} threw ${expected}: "' |
| - + error.message + '".'; |
| + passDetail = '${actual} threw ${expected}' + errorMessage + '.'; |
| } else { |
| didThrowCorrectly = false; |
| failDetail = '${actual} threw "' + error.name |