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 7d337e6f087c41ed0cc55c907a9c55bf30119376..5177c596049b0cb0cc3f97eed71d125696aeeb8c 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js |
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js |
| @@ -270,12 +270,16 @@ window.Audit = (function () { |
| // Catch did not happen, so the test is failed. |
| failDetail = '${actual} did not throw an exception.'; |
| } catch (error) { |
| - if (this._expected === undefined) { |
| + if (this._expected === null) { |
|
Raymond Toy
2016/12/22 17:55:00
What if someone did
should(...).throw(undefined)
hongchan
2016/12/22 18:10:31
Giving |undefined| as an argument will do nothing.
|
| + // The expected error type was not given. |
| didThrowCorrectly = true; |
| - passDetail = '${actual} threw an exception of ' + error.name + '.'; |
| + passDetail = '${actual} threw an exception of ' + error.name + ': "' |
| + + error.message + '".'; |
|
Raymond Toy
2016/12/22 17:55:00
Nit: Can we actually throw anything other than an
hongchan
2016/12/22 18:10:31
Good call. Done.
|
| } 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} as expected: "' |
| + + error.message + '".'; |
|
Raymond Toy
2016/12/22 17:55:00
Nit: Similarly, can we just say "threw expected $
hongchan
2016/12/22 18:10:31
Sure. Done.
|
| } else { |
| didThrowCorrectly = false; |
| failDetail = '${actual} threw "' + error.name |