Index: LayoutTests/fast/js/Promise-resolve-with-then-exception.html |
diff --git a/LayoutTests/fast/js/Promise-resolve-with-then-exception.html b/LayoutTests/fast/js/Promise-resolve-with-then-exception.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f52408b093b135bdc16cb712059118cd9578c8b5 |
--- /dev/null |
+++ b/LayoutTests/fast/js/Promise-resolve-with-then-exception.html |
@@ -0,0 +1,34 @@ |
+<!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 () { |
+ debug('FAIL fulfilled'); |
+ finishJSTest(); |
+}, function (value) { |
+ debug('PASS rejected'); |
+ window.result = value |
+ shouldBeEqualToString('result', 'hello'); |
+ finishJSTest(); |
+}); |
+ |
+debug('The promise is already rejected now.'); |
+</script> |
+<script src="resources/js-test-post.js"></script> |
+</body> |
+</html> |