Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: LayoutTests/fast/js/Promise-then-callback-receiver.html

Issue 24980002: Implement AP2 Promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 window.jsTestIsAsync = true;
11
12 description('Test Promise.');
13
14 var thisInOnFulfilledSloppy;
15 var thisInOnRejectedSloppy;
16
17 var thisInOnFulfilledStrict;
18 var thisInOnRejectedStrict;
19
20 Promise.resolve().then(function () {
21 return Promise.resolve(42).then(function () {
22 testPassed('fulfilled');
23 window.thisInOnFulfilledSloppy = this;
24 shouldBe('thisInOnFulfilledSloppy', 'window');
25 }, function () {
26 testFailed('rejected');
27 });
28 }).then(function () {
29 return Promise.reject(42).then(function () {
30 testFailed('fulfilled');
31 }, function () {
32 testPassed('rejected');
33 window.thisInOnRejectedSloppy = this;
34 shouldBe('thisInOnRejectedSloppy', 'window');
35 });
36 }).then(function () {
37 return Promise.resolve(42).then(function () {
38 'use strict';
39 testPassed('fulfilled');
40 window.thisInOnFulfilledStrict = this;
41 shouldBe('thisInOnFulfilledStrict', 'undefined');
42 }, function () {
43 'use strict';
44 testFailed('rejected');
45 });
46 }).then(function () {
47 return Promise.reject(42).then(function () {
48 'use strict';
49 testFailed('fulfilled');
50 }, function () {
51 'use strict';
52 testPassed('rejected');
53 window.thisInOnRejectedStrict = this;
54 shouldBe('thisInOnRejectedStrict', 'undefined');
55 });
56 }).then(finishJSTest, finishJSTest);
57
58 </script>
59 <script src="resources/js-test-post.js"></script>
60 </body>
61 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/js/Promise-then.html ('k') | LayoutTests/fast/js/Promise-then-callback-receiver-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698