| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 }); | 78 }); |
| 79 | 79 |
| 80 // Tests extra info | 80 // Tests extra info |
| 81 should([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) | 81 should([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) |
| 82 .beCloseToArray([2, 3, 4, 5, 6, 7, 800, 900, 1000, 1100, 1200], { | 82 .beCloseToArray([2, 3, 4, 5, 6, 7, 800, 900, 1000, 1100, 1200], { |
| 83 absoluteThreshold: 0 | 83 absoluteThreshold: 0 |
| 84 }); | 84 }); |
| 85 task.done(); | 85 task.done(); |
| 86 }); | 86 }); |
| 87 | 87 |
| 88 // Testing the failure handling of Audit.loadFileFromUrl(). |
| 89 audit.define({ |
| 90 label: 'load-file-in-should', |
| 91 description: 'Testing the failure handling of Audit.loadFileFromUrl().' |
| 92 }, (task, should) => { |
| 93 let url = 'non-existent-audio-file.wav'; |
| 94 let promise = should( |
| 95 Audit.loadFileFromUrl(url), |
| 96 'Loading non-existent file within should().beResolved()') |
| 97 .beResolved(); |
| 98 promise.then(() => { task.done() }); |
| 99 } |
| 100 ); |
| 101 |
| 88 // With no argument, this executes all tasks in the order defined. | 102 // With no argument, this executes all tasks in the order defined. |
| 89 audit.run(); | 103 audit.run(); |
| 90 </script> | 104 </script> |
| 91 </body> | 105 </body> |
| 92 </html> | 106 </html> |
| OLD | NEW |