Fix lint
This commit is contained in:
parent
c0c1f0cfe0
commit
64639d91c4
|
|
@ -435,28 +435,29 @@ it('should not auto play audio', {
|
||||||
description: 'https://github.com/microsoft/playwright/issues/33590'
|
description: 'https://github.com/microsoft/playwright/issues/33590'
|
||||||
}
|
}
|
||||||
}, async ({ page }) => {
|
}, async ({ page }) => {
|
||||||
await page.route('**/*', async (route) => {
|
await page.route('**/*', async route => {
|
||||||
route.fulfill({
|
await route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
contentType: 'text/html',
|
contentType: 'text/html',
|
||||||
body: `<script>
|
body: `
|
||||||
async function onLoad() {
|
<script>
|
||||||
const log = document.getElementById('log');
|
async function onLoad() {
|
||||||
const audioContext = new AudioContext();
|
const log = document.getElementById('log');
|
||||||
const gainNode = new GainNode(audioContext);
|
const audioContext = new AudioContext();
|
||||||
gainNode.connect(audioContext.destination);
|
const gainNode = new GainNode(audioContext);
|
||||||
gainNode.gain.value = 0.025;
|
gainNode.connect(audioContext.destination);
|
||||||
const sineNode = new OscillatorNode(audioContext);
|
gainNode.gain.value = 0.025;
|
||||||
sineNode.connect(gainNode);
|
const sineNode = new OscillatorNode(audioContext);
|
||||||
sineNode.start();
|
sineNode.connect(gainNode);
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
sineNode.start();
|
||||||
log.innerHTML = 'State: ' + audioContext.state;
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
}
|
log.innerHTML = 'State: ' + audioContext.state;
|
||||||
</script>
|
}
|
||||||
<body onload="onLoad()">
|
</script>
|
||||||
<div id="log"></div>
|
<body onload="onLoad()">
|
||||||
</body>`,
|
<div id="log"></div>
|
||||||
});
|
</body>`,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
await page.goto('http://127.0.0.1/audio.html');
|
await page.goto('http://127.0.0.1/audio.html');
|
||||||
await expect(page.locator('#log')).toHaveText('State: suspended');
|
await expect(page.locator('#log')).toHaveText('State: suspended');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue