Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / Promise-native-reject.html
blob59860e6f52a1e7d8a974d68383f6ebe8d8bab14c
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 reject inside Blink.');
12 window.jsTestIsAsync = true;
14 var reject;
15 var promise = new Promise(function(res, rej) { reject = rej; });
16 var blinkPromise = internals.createRejectedPromise(42);
18 promise.then(function() {
19 testFailed('fulfilled');
20 }, function(value) {
21 return blinkPromise;
22 }).then(function() {
23 testFailed('fulfilled');
24 }, function(value) {
25 result = value;
26 shouldBe('result', '42');
27 }).then(finishJSTest, finishJSTest);
29 reject(118);
31 </script>
32 </body>
33 </html>