1 importScripts('../../../resources/js-test.js');
3 description('Test Promise.');
8 var promise = new Promise(function(_, r) { reject = r; });
9 var promiseState = 'pending';
10 var promiseResult = undefined;
11 promise.then(function(result) {
12 promiseState = 'fulfilled';
13 promiseResult = result;
15 promiseState = 'rejected';
16 promiseResult = result;
19 shouldBeEqualToString('promiseState', 'pending');
23 shouldBeEqualToString('promiseState', 'pending');
25 promise.then(function() {
26 testFailed('promise is fulfilled.');
29 shouldBeEqualToString('promiseState', 'rejected');
30 shouldBeEqualToString('promiseResult', 'hello');