| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test statechange event</title> | 4 <title>Test statechange event</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 23 matching lines...) Expand all Loading... |
| 34 should(stateChangeCount, "Number of state changes") | 34 should(stateChangeCount, "Number of state changes") |
| 35 .beLessThanOrEqualTo(2) | 35 .beLessThanOrEqualTo(2) |
| 36 } | 36 } |
| 37 ++stateChangeCount; | 37 ++stateChangeCount; |
| 38 } | 38 } |
| 39 | 39 |
| 40 function finalCheck(should) { | 40 function finalCheck(should) { |
| 41 // Final check that we got the right number of state changes and the cor
rect final state. | 41 // Final check that we got the right number of state changes and the cor
rect final state. |
| 42 should(stateChangeCount, "stateChangeCount") | 42 should(stateChangeCount, "stateChangeCount") |
| 43 .beEqualTo(2); | 43 .beEqualTo(2); |
| 44 should(context.state, "context.state") | 44 should(context.state, "After rendering context.state") |
| 45 .beEqualTo("closed"); | 45 .beEqualTo("closed"); |
| 46 } | 46 } |
| 47 | 47 |
| 48 audit.define({ | 48 audit.define({ |
| 49 label: 'test', | 49 label: 'test', |
| 50 description: 'Signaling of statechange event' | 50 description: 'Signaling of statechange event' |
| 51 }, (task, should) => { | 51 }, (task, should) => { |
| 52 // Create an offline context with a source passing through a convolver.
The convolver is | 52 // Create an offline context with a source passing through a convolver.
The convolver is |
| 53 // just to waste some time. | 53 // just to waste some time. |
| 54 context = new OfflineAudioContext(1, secondsToRender * sampleRate, sampl
eRate); | 54 context = new OfflineAudioContext(1, secondsToRender * sampleRate, sampl
eRate); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 77 setTimeout(() => { | 77 setTimeout(() => { |
| 78 finalCheck(should); | 78 finalCheck(should); |
| 79 task.done(); | 79 task.done(); |
| 80 }, secondsToRender * 1000); | 80 }, secondsToRender * 1000); |
| 81 }); | 81 }); |
| 82 | 82 |
| 83 audit.run(); | 83 audit.run(); |
| 84 </script> | 84 </script> |
| 85 </body> | 85 </body> |
| 86 </html> | 86 </html> |
| OLD | NEW |