| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 })(); |
| OLD | NEW |