Skip to content

Commit

Permalink
Update audit.js and fix error catching logic in should().throw()
Browse files Browse the repository at this point in the history
Fetch/update audit.js in non-WPT layout tests and also fix the error
in the error catching logic in should().throw() assertion.

The updated code checks if the |error| object passed by try/catch
is "DOMException". This is unnecessarily specific, so this CL changes
the check to look for the "Error" type, which is more generic.

Bug: 865614
Test: All layout tests pass.
Change-Id: I16acacb26c194a0ff950aca05e931195bf55167f
  • Loading branch information
hoch authored and Chrome-bot committed Aug 21, 2018
1 parent ba5c61c commit 1dbd6cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webaudio/resources/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ window.Audit = (function() {
didThrowCorrectly = true;
passDetail = '${actual} threw ' + error.name + errorMessage + '.';
} else if (typeof(this._expected) == "string" &&
error instanceof DOMException &&
error instanceof Error &&
error.name === this._expected) {
// A DOMException was thrown and expected, and the names match
didThrowCorrectly = true;
Expand Down

0 comments on commit 1dbd6cd

Please sign in to comment.