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

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

Issue 2693043005: Fix should() to throw with no argument (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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 get state () { 944 get state () {
945 return this._state; 945 return this._state;
946 } 946 }
947 947
948 get result () { 948 get result () {
949 return this._result; 949 return this._result;
950 } 950 }
951 951
952 // Start the assertion chain. 952 // Start the assertion chain.
953 should (actual, actualDescription) { 953 should (actual, actualDescription) {
954 // If no argument is given, we cannot proceed. Halt.
955 if (arguments.length === 0)
956 _throwException('Task.should:: requires at least 1 argument.');
957
954 return new Should(this, actual, actualDescription); 958 return new Should(this, actual, actualDescription);
955 } 959 }
956 960
957 // Run this task. |this| task will be passed into the user-supplied test 961 // Run this task. |this| task will be passed into the user-supplied test
958 // task function. 962 // task function.
959 run () { 963 run () {
960 this._state = TaskState.STARTED; 964 this._state = TaskState.STARTED;
961 this._taskFunction( 965 this._taskFunction(
962 this, 966 this,
963 this.should.bind(this)); 967 this.should.bind(this));
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 _logError('this test requires the explicit comparison with the ' 1127 _logError('this test requires the explicit comparison with the '
1124 + 'expected result when it runs with run-webkit-tests.'); 1128 + 'expected result when it runs with run-webkit-tests.');
1125 } 1129 }
1126 1130
1127 return new TaskRunner(); 1131 return new TaskRunner();
1128 } 1132 }
1129 1133
1130 }; 1134 };
1131 1135
1132 })(); 1136 })();
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