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 resolver; |
| 15 |
| 16 var firstFuture = new Future( |
| 17 function(newResolver) { |
| 18 window.thisInInit = this; |
| 19 resolver = newResolver; |
| 20 }); |
| 21 |
| 22 var secondFuture = firstFuture |
| 23 .then( |
| 24 function(value) { |
| 25 window.thisInAcceptCallback = this; |
| 26 shouldBeTrue("thisInAcceptCallback === secondFuture"); |
| 27 window.value = value; |
| 28 shouldBeEqualToString("value", "hello"); |
| 29 finishJSTest(); |
| 30 }); |
| 31 |
| 32 shouldBeTrue("thisInInit === firstFuture"); |
| 33 |
| 34 resolver.accept("hello"); |
| 35 |
| 36 </script> |
| 37 <script src="resources/js-test-post.js"></script> |
| 38 </body> |
| 39 </html> |
OLD | NEW |