Index: LayoutTests/fast/js/Future-exception.html |
diff --git a/LayoutTests/fast/js/Future-exception.html b/LayoutTests/fast/js/Future-exception.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d531c439fd9a98d1a3a8b1969cde658df2383a30 |
--- /dev/null |
+++ b/LayoutTests/fast/js/Future-exception.html |
@@ -0,0 +1,40 @@ |
+<!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 Future."); |
+ |
+window.jsTestIsAsync = true; |
+ |
+var firstFuture = new Future( |
+ function(resolver) { |
+ window.thisInInit = this; |
+ resolver.accept("hello"); |
+ }); |
+ |
+var secondFuture = firstFuture.then( |
+ function(value) { |
+ throw "foobar"; |
+ }); |
+ |
+var thirdFuture = secondFuture.then( |
+ function(value) { |
+ fail("Unexpected invocation of acceptCallback"); |
+ }, |
+ function(value) { |
+ window.thisInAcceptCallback = this; |
+ shouldBeTrue("thisInAcceptCallback === thirdFuture"); |
+ window.value = value; |
+ shouldBeEqualToString("value", "foobar"); |
+ finishJSTest(); |
+ }); |
+ |
+</script> |
+<script src="resources/js-test-post.js"></script> |
+</body> |
+</html> |