OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="resources/js-test-pre.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <div id="description"></div> |
| 8 <div id="console"></div> |
| 9 <script> |
| 10 description("Test Future."); |
| 11 |
| 12 window.jsTestIsAsync = true; |
| 13 |
| 14 var firstFuture = new Future( |
| 15 function(resolver) { |
| 16 resolver.accept("hello"); |
| 17 }); |
| 18 |
| 19 debug(firstFuture['then']); |
| 20 |
| 21 var secondFuture = new Future( |
| 22 function(resolver) { |
| 23 resolver.resolve(firstFuture); |
| 24 }) |
| 25 .then( |
| 26 function(value) { |
| 27 window.thisInAcceptCallback = this; |
| 28 shouldBeTrue("thisInAcceptCallback === secondFuture"); |
| 29 window.value = value; |
| 30 shouldBeEqualToString("value", "hello"); |
| 31 finishJSTest(); |
| 32 }); |
| 33 |
| 34 </script> |
| 35 <script src="resources/js-test-post.js"></script> |
| 36 </body> |
| 37 </html> |
OLD | NEW |