Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>audit.js: handling failures</title> | 4 <title>audit.js: handling failures</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 21 matching lines...) Expand all Loading... | |
| 32 should(typeof 3.141592, 'typeof 3.141592').beEqualTo('string'); | 32 should(typeof 3.141592, 'typeof 3.141592').beEqualTo('string'); |
| 33 should(1).beGreaterThan(2); | 33 should(1).beGreaterThan(2); |
| 34 should(1).beGreaterThanOrEqualTo(2); | 34 should(1).beGreaterThanOrEqualTo(2); |
| 35 should(2).beLessThan(1); | 35 should(2).beLessThan(1); |
| 36 should(2).beLessThanOrEqualTo(1); | 36 should(2).beLessThanOrEqualTo(1); |
| 37 | 37 |
| 38 let oac = new OfflineAudioContext(1, 128, 44100); | 38 let oac = new OfflineAudioContext(1, 128, 44100); |
| 39 Promise.all([ | 39 Promise.all([ |
| 40 should(oac.decodeAudioData(), 'Decoding audio data with no argument') | 40 should(oac.decodeAudioData(), 'Decoding audio data with no argument') |
| 41 .beResolved(), | 41 .beResolved(), |
| 42 should(oac.startRendering()).beRejected() | 42 should(oac.startRendering(), 'Start OAC rendering').beRejected(), |
| 43 should(oac.suspend(), 'Suspending OAC with no argument') | |
| 44 .beRejectedWith('IndexSizedError') | |
|
Raymond Toy
2017/01/23 23:11:57
You mean 'IndexSizeError'? (No "d")
hongchan
2017/01/23 23:14:50
Done.
| |
| 43 ]).then(task.done.bind(task)); | 45 ]).then(task.done.bind(task)); |
| 44 }); | 46 }); |
| 45 | 47 |
| 46 | 48 |
| 47 // Numerical assertions. | 49 // Numerical assertions. |
| 48 audit.define('numerical-failures', function (task, should) { | 50 audit.define('numerical-failures', function (task, should) { |
| 49 task.describe('Testing numerical assertion failures.'); | 51 task.describe('Testing numerical assertion failures.'); |
| 50 | 52 |
| 51 should(0).beCloseTo(0.1, { threshold: 0 }); | 53 should(0).beCloseTo(0.1, { threshold: 0 }); |
| 52 should(59, 'The measured decibel').beCloseTo(62, { threshold: 0.01 }); | 54 should(59, 'The measured decibel').beCloseTo(62, { threshold: 0.01 }); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 72 | 74 |
| 73 task.done(); | 75 task.done(); |
| 74 }); | 76 }); |
| 75 | 77 |
| 76 | 78 |
| 77 // With no argument, this executes all tasks in the order defined. | 79 // With no argument, this executes all tasks in the order defined. |
| 78 audit.run(); | 80 audit.run(); |
| 79 </script> | 81 </script> |
| 80 </body> | 82 </body> |
| 81 </html> | 83 </html> |
| OLD | NEW |