Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/all/S25.4.4.1_A7.2_T1.js

raw
1 // Copyright 2014 Cubane Canada, Inc. All rights reserved.
2 // See LICENSE for details.
3
4 /*---
5 info: |
6 Promise.all with 1-element array
7 should accept an array with settled promise
8 es6id: S25.4.4.1_A7.2_T1
9 author: Sam Mikes
10 description: Promise.all() accepts a one-element array
11 includes: [promiseHelper.js]
12 flags: [async]
13 ---*/
14
15 var sequence = [];
16
17 var p1 = new Promise(function(resolve) {
18 resolve({});
19 });
20
21 sequence.push(1);
22
23 Promise.all([p1]).then(function(resolved) {
24 sequence.push(4);
25 checkSequence(sequence, "Expected Promise.all().then to queue second");
26 }).catch($DONE);
27
28 p1.then(function() {
29 sequence.push(3);
30 checkSequence(sequence, "Expected p1.then to queue first");
31 }).then(function() {
32 sequence.push(5);
33 checkSequence(sequence, "Expected final then to queue last");
34 }).then($DONE, $DONE);
35
36 sequence.push(2);