mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
19 lines
412 B
JavaScript
19 lines
412 B
JavaScript
async function sleep(delay) {
|
|
return new Promise(resolve => setTimeout(resolve, delay));
|
|
}
|
|
|
|
async function main() {
|
|
window.ws = new WebSocket('ws://localhost:' + window.location.port + '/ws');
|
|
window.ws.addEventListener('message', message => {});
|
|
|
|
const roundOne = Promise.all([
|
|
fetch('fetch-request-a.js'),
|
|
]);
|
|
|
|
await roundOne;
|
|
await sleep(50);
|
|
await fetch('fetch-request-d.js');
|
|
}
|
|
|
|
main();
|