Fix the media events test
Playing a media now requires a user gesture. See https://goo.gl/xX8pDD.
This commit is contained in:
parent
a7d2f7531c
commit
417fe29dc0
2 changed files with 10 additions and 4 deletions
2
spec/fixtures/pages/audio.html
vendored
2
spec/fixtures/pages/audio.html
vendored
|
@ -1 +1 @@
|
||||||
<audio autoplay muted src="../assets/tone.wav"></audio>
|
<audio muted src="../assets/tone.wav"></audio>
|
||||||
|
|
|
@ -963,11 +963,17 @@ describe('<webview> tag', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO(alexeykuzmin): Enable the tests.
|
describe('media-started-playing media-paused events', () => {
|
||||||
xdescribe('media-started-playing media-paused events', () => {
|
|
||||||
it('emits when audio starts and stops playing', async () => {
|
it('emits when audio starts and stops playing', async () => {
|
||||||
loadWebView(webview, {src: `file://${fixtures}/pages/audio.html`})
|
await loadWebView(webview, {src: `file://${fixtures}/pages/audio.html`})
|
||||||
|
|
||||||
|
// XXX(alexeykuzmin): Starting from Ch66 playing an audio requires
|
||||||
|
// a user interaction. See https://goo.gl/xX8pDD.
|
||||||
|
|
||||||
|
webview.executeJavaScript('document.querySelector("audio").play()', true)
|
||||||
await waitForEvent(webview, 'media-started-playing')
|
await waitForEvent(webview, 'media-started-playing')
|
||||||
|
|
||||||
|
webview.executeJavaScript('document.querySelector("audio").pause()', true)
|
||||||
await waitForEvent(webview, 'media-paused')
|
await waitForEvent(webview, 'media-paused')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue