blob: f486c750e149d8a1d27ba8454ca0cb4d98d7df7d [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Tests that AudioContext suspend method resolve promises immediately when already suspended.");
function runTest() {
window.jsTestIsAsync = true;
context = new AudioContext();
shouldBeEqualToString("context.state", "suspended");
context.suspend().then(function() {
testPassed('context resolve callback called');
shouldBeEqualToString("context.state", "suspended");
finishJSTest();
}, function() {
testFailed('context reject callback called');
finishJSTest();
});
shouldBeEqualToString("context.state", "suspended");
}
runTest();
</script>
</body>
</html>