feat: expose audio-state-changed on webContents (#37366)

feat: expose audio-state-changed on webContents
This commit is contained in:
Shelley Vohr 2023-03-06 17:00:24 +01:00 committed by GitHub
parent c8f715f9a1
commit 512e56baf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View file

@ -565,11 +565,11 @@ describe('webContents module', () => {
oscillator.connect(context.destination)
oscillator.start()
`);
let p = once(w.webContents, '-audio-state-changed');
let p = once(w.webContents, 'audio-state-changed');
w.webContents.executeJavaScript('context.resume()');
await p;
expect(w.webContents.isCurrentlyAudible()).to.be.true();
p = once(w.webContents, '-audio-state-changed');
p = once(w.webContents, 'audio-state-changed');
w.webContents.executeJavaScript('oscillator.stop()');
await p;
expect(w.webContents.isCurrentlyAudible()).to.be.false();