blob: 575c7f7b1957abaedf7a14f6f3a677b9a8774fd1 [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(resolve, reject) {
var anotherResolve;
resolve(new Promise(function(r) { anotherResolve = r; }));
resolve('resolve');
reject('reject');
anotherResolve('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>