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

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

Issue 23567043: Promise init callback takes resolve and reject functions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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(resolver) { 8 var firstPromise = new Promise(function(resolve) {
9 resolver.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 shouldBeTrue('thisInFulfillCallback === secondPromise');
15 global.result = result; 15 global.result = result;
16 shouldBeEqualToString('result', 'hello'); 16 shouldBeEqualToString('result', 'hello');
17 finishJSTest(); 17 finishJSTest();
18 }, function() { 18 }, function() {
19 fail('rejected'); 19 fail('rejected');
20 finishJSTest(); 20 finishJSTest();
21 }); 21 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698