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 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(Audit.loadFileFromUrl(url), | |
| 95 'Loading file within should().beResolved()') | |
|
Raymond Toy
2017/03/21 21:16:33
"Loading file" -> "Loading non-existent file"
hongchan
2017/03/21 23:07:57
Done.
| |
| 96 .beResolved(); | |
| 97 promise.then(() => { task.done() }); | |
| 98 } | |
| 99 ); | |
| 100 | |
| 88 // With no argument, this executes all tasks in the order defined. | 101 // With no argument, this executes all tasks in the order defined. |
| 89 audit.run(); | 102 audit.run(); |
| 90 </script> | 103 </script> |
| 91 </body> | 104 </body> |
| 92 </html> | 105 </html> |
| OLD | NEW |