| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test AudioContext.suspend() and AudioContext.resume()</title> | 4 <title>Test AudioContext.suspend() and AudioContext.resume()</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-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audit.js"></script> | 8 <script src="../resources/audit.js"></script> |
| 9 </head> | 9 </head> |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 .then(() => { | 110 .then(() => { |
| 111 // resume() should be rejected on closed context. | 111 // resume() should be rejected on closed context. |
| 112 should(offlineContext.resume(), | 112 should(offlineContext.resume(), |
| 113 "offlineContext.resume()") | 113 "offlineContext.resume()") |
| 114 .beRejected() | 114 .beRejected() |
| 115 .then(task.done.bind(task)); | 115 .then(task.done.bind(task)); |
| 116 }) | 116 }) |
| 117 }); | 117 }); |
| 118 }); | 118 }); |
| 119 | 119 |
| 120 audit.define({ |
| 121 label: 'resume-running-context', |
| 122 description: 'Test resuming a running context' |
| 123 }, (task, should) => { |
| 124 let context; |
| 125 should(() => context = new AudioContext(), |
| 126 'Create online context') |
| 127 .notThrow(); |
| 128 |
| 129 should(context.state, 'context.state') |
| 130 .beEqualTo('running'); |
| 131 should(context.resume(), 'context.resume') |
| 132 .beResolved() |
| 133 .then(() => { |
| 134 should(context.state, 'context.state after resume') |
| 135 .beEqualTo('running'); |
| 136 }) |
| 137 .then(() => task.done()); |
| 138 }); |
| 139 |
| 120 audit.run(); | 140 audit.run(); |
| 121 </script> | 141 </script> |
| 122 </body> | 142 </body> |
| 123 </html> | 143 </html> |
| OLD | NEW |