| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>audit.js: basic tests</title> | 4 <title>audit.js: basic tests</title> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit.js"></script> | 7 <script src="../resources/audit.js"></script> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <script> | 10 <script> |
| 11 var audit = Audit.createTaskRunner({ requireResultFile: true }); | 11 var audit = Audit.createTaskRunner({ requireResultFile: true }); |
| 12 | 12 |
| 13 | 13 |
| 14 // Basic assertion testing. | 14 // Basic assertion testing. |
| 15 audit.define('basic', function (task, should) { | 15 audit.define('basic', function (task, should) { |
| 16 task.describe('Simple unit tests for basic assertions.'); | 16 task.describe('Simple unit tests for basic assertions.'); |
| 17 | 17 |
| 18 should(OfflineAudioContext, 'OfflineAudioContext').exist(); | 18 should(OfflineAudioContext, 'OfflineAudioContext').exist(); |
| 19 should(function () { var foo = 0; }, 'Setting foo to 0').notThrow(); | 19 should(function () { var foo1 = 0; }, 'Setting foo1 to 0').notThrow(); |
| 20 should(function () { var foo = bar; }).throw('ReferenceError'); | 20 should(function () { var foo2 = bar; }).throw(); |
| 21 should(function () { var foo3 = bar; }).throw('ReferenceError'); |
| 21 should(3 < 5, '3 < 5').beTrue(); | 22 should(3 < 5, '3 < 5').beTrue(); |
| 22 should(false).beFalse(); | 23 should(false).beFalse(); |
| 23 should(1).beEqualTo(1) | 24 should(1).beEqualTo(1) |
| 24 should(1).notBeEqualTo(2) | 25 should(1).notBeEqualTo(2) |
| 25 should(typeof AudioContext.prototype).beEqualTo('object'); | 26 should(typeof AudioContext.prototype).beEqualTo('object'); |
| 26 should(2).beGreaterThan(1); | 27 should(2).beGreaterThan(1); |
| 27 should(2).beGreaterThanOrEqualTo(2); | 28 should(2).beGreaterThanOrEqualTo(2); |
| 28 should(1).beLessThan(2); | 29 should(1).beLessThan(2); |
| 29 should(1).beLessThanOrEqualTo(1); | 30 should(1).beLessThanOrEqualTo(1); |
| 30 | 31 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 task.done(); | 64 task.done(); |
| 64 }); | 65 }); |
| 65 | 66 |
| 66 | 67 |
| 67 // You can enumerate tasks you want to execute in the order, or simply pass | 68 // You can enumerate tasks you want to execute in the order, or simply pass |
| 68 // no argument to run all the defined tasks. | 69 // no argument to run all the defined tasks. |
| 69 audit.run('numerical', 'basic'); | 70 audit.run('numerical', 'basic'); |
| 70 </script> | 71 </script> |
| 71 </body> | 72 </body> |
| 72 </html> | 73 </html> |
| OLD | NEW |