summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/test/assets/networkidle.html
blob: cbe0e153d0d91792ee4d2f583845c4a092c77262 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<script>
  async function sleep(delay) {
    return new Promise(resolve => setTimeout(resolve, delay));
  }

  async function main() {
    const roundOne = Promise.all([
      fetch('fetch-request-a.js'),
      fetch('fetch-request-b.js'),
      fetch('fetch-request-c.js'),
    ]);

    await roundOne;
    await sleep(50);
    await fetch('fetch-request-d.js');
  }

  main();
</script>