1 importScripts('../../../resources/js-test.js');
3 description('Test Promise.');
7 global.jsTestIsAsync = true;
11 var firstPromise = new Promise(function(newResolve) {
12 global.thisInInit = this;
16 var secondPromise = firstPromise.then(function(result) {
17 global.thisInFulfillCallback = this;
18 shouldBeFalse('thisInFulfillCallback === secondPromise');
19 shouldBeTrue('thisInFulfillCallback === global');
20 global.result = result;
21 shouldBeEqualToString('result', 'hello');
25 shouldBeFalse('thisInInit === firstPromise');
26 shouldBeTrue('thisInInit === global');