| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>A simple unit testing for audio-testing.js and testharness.js</title> | 4 <title>A simple unit testing for audio-testing.js and testharness.js</title> |
| 5 | 5 |
| 6 <!-- This is the required dependency for testharness + audio-testing. Note | 6 <!-- This is the required dependency for testharness + audio-testing. Note |
| 7 that the including order matters because audio-testing.js depends on | 7 that the including order matters because audio-testing.js depends on |
| 8 testharness.js --> | 8 testharness.js --> |
| 9 <script src="../../resources/testharness.js"></script> | 9 <script src="../../resources/testharness.js"></script> |
| 10 <script src="../../resources/testharnessreport.js"></script> | 10 <script src="../../resources/testharnessreport.js"></script> |
| 11 <script src="../resources/audit-util.js"></script> |
| 11 <script src="../resources/audio-testing.js"></script> | 12 <script src="../resources/audio-testing.js"></script> |
| 12 | 13 |
| 13 </head> | 14 </head> |
| 14 <body> | 15 <body> |
| 15 <script> | 16 <script> |
| 16 var audit = Audit.createTaskRunner(); | 17 var audit = Audit.createTaskRunner(); |
| 17 | 18 |
| 18 audit.defineTask('foo', function (taskDone) { | 19 audit.defineTask('foo', function (taskDone) { |
| 19 Should('Zero', 0).beEqualTo(0); | 20 Should('Zero', 0).beEqualTo(0); |
| 20 Should('One', 1).notBeEqualTo(0); | 21 Should('One', 1).notBeEqualTo(0); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 Should('[1, 2, 3]', [1, 2, 3]).beEqualToArray([1, 2, 3]); | 35 Should('[1, 2, 3]', [1, 2, 3]).beEqualToArray([1, 2, 3]); |
| 35 Should('My array', [0.11, 0.19]).beCloseToArray([0.1, 0.2], 0.02); | 36 Should('My array', [0.11, 0.19]).beCloseToArray([0.1, 0.2], 0.02); |
| 36 Should('My random array', [1, 1, 3, 3, 2]).containValues([1, 3, 2]); | 37 Should('My random array', [1, 1, 3, 3, 2]).containValues([1, 3, 2]); |
| 37 taskDone(); | 38 taskDone(); |
| 38 }); | 39 }); |
| 39 | 40 |
| 40 audit.runTasks(); | 41 audit.runTasks(); |
| 41 </script> | 42 </script> |
| 42 </body> | 43 </body> |
| 43 </html> | 44 </html> |
| OLD | NEW |