blob: 1f336ea3b1b3458de5de38bc40c8be91a9f83a7b [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;
var callback;
var promise = new Promise(function(resolver) {
resolver.resolve({then: function(fulfillCallback, rejectCallback) {
throw 'hello';
}}, true);
});
promise.then(function() {
testFailed('fulfilled');
finishJSTest();
}, function(result) {
testPassed('rejected');
window.result = result
shouldBeEqualToString('result', 'hello');
finishJSTest();
});
debug('The promise is already rejected now.');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>