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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/resources/audit.js

Issue 2656743005: Implement should().message() for in-task message display (Closed)
Patch Set: Initial Commit Created 3 years, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * @fileOverview WebAudio layout test utility library. Built around W3C's 7 * @fileOverview WebAudio layout test utility library. Built around W3C's
8 * testharness.js. Includes asynchronous test task manager, 8 * testharness.js. Includes asynchronous test task manager,
9 * assertion utilities. 9 * assertion utilities.
10 * @dependency testharness.js 10 * @dependency testharness.js
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 failDetail += '\n' 880 failDetail += '\n'
881 + '\tMax AbsError of ' + maxAbsError.toExponential(16) 881 + '\tMax AbsError of ' + maxAbsError.toExponential(16)
882 + ' at index of ' + maxAbsErrorIndex + '.\n' 882 + ' at index of ' + maxAbsErrorIndex + '.\n'
883 + '\tMax RelError of ' + maxRelError.toExponential(16) 883 + '\tMax RelError of ' + maxRelError.toExponential(16)
884 + ' at index of ' + maxRelErrorIndex + '.'; 884 + ' at index of ' + maxRelErrorIndex + '.';
885 } 885 }
886 886
887 return this._assert(passed, passDetail, failDetail); 887 return this._assert(passed, passDetail, failDetail);
888 } 888 }
889 889
890 /**
891 * A temporary escape hat for printing an in-task message. The description
892 * for the |actual| is required to get the message printed properly.
893 *
894 * TODO(hongchan): remove this method when the transition from the old Audit
895 * to the new Audit is completed.
896 * @example
897 * should(true, 'The message is').message('truthful!', 'false!');
898 *
899 * @result
900 * "PASS The message is truthful!"
901 */
902 message(passDetail, failDetail) {
903 return this._assert(this._actual,
904 '${actual} ' + passDetail,
905 '${actual} ' + failDetail);
906 }
890 } 907 }
891 908
892 909
893 // Task Class state enum. 910 // Task Class state enum.
894 const TaskState = { 911 const TaskState = {
895 PENDING: 0, 912 PENDING: 0,
896 STARTED: 1, 913 STARTED: 1,
897 FINISHED: 2 914 FINISHED: 2
898 }; 915 };
899 916
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 _logError('this test requires the explicit comparison with the ' 1123 _logError('this test requires the explicit comparison with the '
1107 + 'expected result when it runs with run-webkit-tests.'); 1124 + 'expected result when it runs with run-webkit-tests.');
1108 } 1125 }
1109 1126
1110 return new TaskRunner(); 1127 return new TaskRunner();
1111 } 1128 }
1112 1129
1113 }; 1130 };
1114 1131
1115 })(); 1132 })();
OLDNEW
« 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