blob: e8dd0906d0500df9a2dbe0ae1d9decc0ad87ac2f [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;
new Promise(function(resolver) {
var anotherResolver;
resolver.resolve(new Promise(function(r) { anotherResolver = r; }));
resolver.fulfill('fulfill');
resolver.resolve('resolve');
resolver.reject('reject');
anotherResolver.fulfill('foo');
}).then(function(result) {
window.result = result;
shouldBeEqualToString('result', 'foo');
finishJSTest();
}, function() {
testFailed('rejected');
finishJSTest();
});
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>