blob: b343c58bd2e023fac4ef4cbc236812dd84659300 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description('Test Promise.');
window.jsTestIsAsync = true;
result = undefined;
var resolver;
var promise = Promise.resolve(new Promise(function (r) { resolver = r;} ));
promise.then(function(result) {
window.result = result;
shouldBeEqualToString('result', 'hello');
finishJSTest();
}, function() {
testFailed('rejected');
finishJSTest();
});
resolver.resolve('hello');
shouldBe('result', 'undefined');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>