| 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> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 should(typeof AudioContext.prototype).beEqualTo('object'); | 26 should(typeof AudioContext.prototype).beEqualTo('object'); |
| 27 should(2).beGreaterThan(1); | 27 should(2).beGreaterThan(1); |
| 28 should(2).beGreaterThanOrEqualTo(2); | 28 should(2).beGreaterThanOrEqualTo(2); |
| 29 should(1).beLessThan(2); | 29 should(1).beLessThan(2); |
| 30 should(1).beLessThanOrEqualTo(1); | 30 should(1).beLessThanOrEqualTo(1); |
| 31 | 31 |
| 32 let oac = new OfflineAudioContext(1, 128, 44100); | 32 let oac = new OfflineAudioContext(1, 128, 44100); |
| 33 Promise.all([ | 33 Promise.all([ |
| 34 should(oac.startRendering(), 'Start OAC rendering').beResolved(), | 34 should(oac.startRendering(), 'Start OAC rendering').beResolved(), |
| 35 should(oac.decodeAudioData(), 'Decoding audio data with no argument') | 35 should(oac.decodeAudioData(), 'Decoding audio data with no argument') |
| 36 .beRejected() | 36 .beRejected(), |
| 37 should(oac.suspend(), 'Suspending OAC with no argument') |
| 38 .beRejectedWith('TypeError') |
| 37 ]).then(task.done.bind(task)); | 39 ]).then(task.done.bind(task)); |
| 38 }); | 40 }); |
| 39 | 41 |
| 40 | 42 |
| 41 // Advanced, mostly array-based numerical testing. Note that some codes | 43 // Advanced, mostly array-based numerical testing. Note that some codes |
| 42 // are commented out to avoid the trybot failure. These failures are | 44 // are commented out to avoid the trybot failure. These failures are |
| 43 // intentional, to demonstrate how the detailed failure report works. | 45 // intentional, to demonstrate how the detailed failure report works. |
| 44 audit.define('numerical', function (task, should) { | 46 audit.define('numerical', function (task, should) { |
| 45 task.describe('Numerical assertion unit test.'); | 47 task.describe('Numerical assertion unit test.'); |
| 46 | 48 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 66 task.done(); | 68 task.done(); |
| 67 }); | 69 }); |
| 68 | 70 |
| 69 | 71 |
| 70 // You can enumerate tasks you want to execute in the order, or simply pass | 72 // You can enumerate tasks you want to execute in the order, or simply pass |
| 71 // no argument to run all the defined tasks. | 73 // no argument to run all the defined tasks. |
| 72 audit.run('numerical', 'basic'); | 74 audit.run('numerical', 'basic'); |
| 73 </script> | 75 </script> |
| 74 </body> | 76 </body> |
| 75 </html> | 77 </html> |
| OLD | NEW |