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

Side by Side Diff: LayoutTests/fast/js/Promise-resolve-with-then-reject.html

Issue 209443009: Delete Promises Layout Tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description('Test Promise.');
11
12 window.jsTestIsAsync = true;
13 var value = {
14 then: function(fulfillCallback, rejectCallback) {
15 testPassed('value.then is called.');
16 window.thisValue = this;
17 shouldBe('thisValue', 'value');
18 rejectCallback('hello');
19 }
20 };
21 var promise = new Promise(function(resolve) { resolve(value); });
22
23 promise.then(function(result) {
24 testFailed('fulfilled');
25 finishJSTest();
26 }, function(result) {
27 testPassed('rejected');
28 window.result = result;
29 shouldBeEqualToString('result', 'hello');
30 finishJSTest();
31 });
32
33 debug('The promise is not rejected now.');
34
35 </script>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698