| <script src="../resources/js-test.js"></script> |
| <div id="description"></div> |
| description("Tests that AudioContext suspend method resolve promises immediately when already suspended."); |
| window.jsTestIsAsync = true; |
| context = new webkitAudioContext(); |
| context.suspend().then(function() { |
| testPassed('context resolve callback called'); |
| testFailed('context reject callback called'); |
| testFailed('context resolve callback called synchronously'); |
| var promise = new Promise(function(resolve, reject) { |
| resolvePromise = resolve; |
| promise.then(function() { |
| testPassed('JS promise callback called after context callback'); |
| testFailed('JS promise callback called before context callback'); |