diff options
Diffstat (limited to 'dom/promise/tests/file_promise_and_timeout_ordering.js')
-rw-r--r-- | dom/promise/tests/file_promise_and_timeout_ordering.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dom/promise/tests/file_promise_and_timeout_ordering.js b/dom/promise/tests/file_promise_and_timeout_ordering.js new file mode 100644 index 0000000000..734621eae0 --- /dev/null +++ b/dom/promise/tests/file_promise_and_timeout_ordering.js @@ -0,0 +1,18 @@ +var log = []; +var resolvedPromise = Promise.resolve(null); +function schedulePromiseTask(f) { + resolvedPromise.then(f); +} + +setTimeout(function () { + log.push("t1start"); + schedulePromiseTask(function () { + log.push("promise"); + }); + log.push("t1end"); +}, 10); + +setTimeout(function () { + log.push("t2"); + postMessage(log.join(", ")); +}, 10); |