Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit.js

Issue 2595393003: Handle should.throw() assertion with no argument properly (Closed)
Patch Set: Addressing feedback Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cfadbf891974719211d45a59f01893252273ee59 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) {
+ // The expected error type was not given.
didThrowCorrectly = true;
- passDetail = '${actual} threw an exception of ' + error.name + '.';
+ passDetail = '${actual} threw ' + error.name + ': "'
+ + error.message + '".';
} 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}: "'
+ + error.message + '".';
} else {
didThrowCorrectly = false;
failDetail = '${actual} threw "' + error.name
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698