Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / Promise-native-resolve.html
blob8697898c75361ac57266ca60dccb15cbad1bf873
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description('Test Promise resolve inside Blink.');
12 window.jsTestIsAsync = true;
14 var result;
15 var resolve;
16 var promise = new Promise(function(res) { resolve = res; });
17 var blinkPromise = internals.createResolvedPromise(promise);
19 promise.then(function(value) {
20 return blinkPromise;
21 }).then(function(value) {
22 result = value;
23 shouldBe('result', '42');
24 }).then(finishJSTest, finishJSTest);
26 resolve(42);
28 </script>
29 </body>
30 </html>