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

Side by Side Diff: LayoutTests/fast/js/resources/Promise-resolve-in-workers.js

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
1 importScripts('./js-test-pre.js'); 1 importScripts('./js-test-pre.js');
2 2
3 description('Test Promise.'); 3 description('Test Promise.');
4 4
5 var global = this; 5 var global = this;
6 global.jsTestIsAsync = true; 6 global.jsTestIsAsync = true;
7 7
8 var firstPromise = new Promise(function(resolve) { 8 var firstPromise = new Promise(function(resolve) {
9 resolve('hello'); 9 resolve('hello');
10 }); 10 });
11 11
12 var secondPromise = firstPromise.then(function(result) { 12 var secondPromise = firstPromise.then(function(result) {
13 global.thisInFulfillCallback = this; 13 global.thisInFulfillCallback = this;
14 shouldBeTrue('thisInFulfillCallback === secondPromise'); 14 shouldBeFalse('thisInFulfillCallback === secondPromise');
15 shouldBeTrue('thisInFulfillCallback === global');
15 global.result = result; 16 global.result = result;
16 shouldBeEqualToString('result', 'hello'); 17 shouldBeEqualToString('result', 'hello');
17 finishJSTest(); 18 finishJSTest();
18 }, function() { 19 }, function() {
19 fail('rejected'); 20 fail('rejected');
20 finishJSTest(); 21 finishJSTest();
21 }); 22 });
OLDNEW
« no previous file with comments | « LayoutTests/fast/js/resources/Promise-init-in-workers.js ('k') | LayoutTests/fast/js/resources/Promise-simple-in-workers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698