Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / resources / Promise-resolve-in-workers.js
blob517389b41c665795bab4f04a73ab21a41ac3a0c7
1 importScripts('../../../resources/js-test.js');
3 description('Test Promise.');
5 var global = this;
6 global.jsTestIsAsync = true;
8 var firstPromise = new Promise(function(resolve) {
9 resolve('hello');
10 });
12 var secondPromise = firstPromise.then(function(result) {
13 global.thisInFulfillCallback = this;
14 shouldBeFalse('thisInFulfillCallback === secondPromise');
15 shouldBeTrue('thisInFulfillCallback === global');
16 global.result = result;
17 shouldBeEqualToString('result', 'hello');
18 finishJSTest();
19 }, function() {
20 fail('rejected');
21 finishJSTest();
22 });