4 <script src=
"../../resources/js-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
10 description('Test Promise native then.');
12 window
.jsTestIsAsync
= true;
15 var promise
= new Promise(function(r
) { resolve
= r
; });
16 var newPromise
= window
.internals
.addOneToPromise(promise
);
18 newPromise
.then(function(result
) {
19 window
.result
= result
;
20 shouldBe('result', '11');
21 return window
.internals
.addOneToPromise(result
);
22 }).then(function(result
) {
23 window
.result
= result
;
24 shouldBe('result', '12');
27 testFailed("rejected");
28 }).then(finishJSTest
, finishJSTest
);
30 resolve(new Promise(function(resolve
) { resolve(10); }));