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

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

Issue 2804103002: Throw when testharness::done() is called by layout test code (Closed)
Patch Set: Created 3 years, 8 months 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 | « third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html ('k') | no next file » | 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 d2946161efbb1f2cd2f707a8d6487db5145ddee8..256d303461f99f070d2bbb5f46a9cb236169527d 100644
--- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
@@ -15,7 +15,7 @@
'use strict';
- // Selected properties from testharness.js
+ // Selected methods from testharness.js.
let testharnessProperties = [
'test', 'async_test', 'promise_test', 'promise_rejects',
'generate_tests', 'setup', 'done', 'assert_true', 'assert_false'
@@ -55,6 +55,13 @@ window.Audit = (function () {
throw new Error(message);
}
+ // TODO(hongchan): remove this hack after confirming all the tests are
+ // finished correctly. (crbug.com/708817)
+ const _testharnessDone = window.done;
+ window.done = () => {
+ _throwException('Do NOT call done() method from the test code.');
+ };
+
// Generate a descriptive string from a target value in various types.
function _generateDescription (target, options) {
let targetString;
@@ -1137,7 +1144,7 @@ window.Audit = (function () {
// From testharness.js, report back to the test infrastructure that
// the task runner completed all the tasks.
- done();
+ _testharnessDone();
}
// |taskLabel| can be either a string or a dictionary. See Task constructor
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698