fix: don't emit did-fail-load
for MediaDocuments (#37824)
* fix: don't emit did-fail-load for MediaDocuments * spec: add test
This commit is contained in:
parent
6bfef67aae
commit
251e567eff
3 changed files with 20 additions and 0 deletions
|
@ -377,6 +377,15 @@ describe('BrowserWindow module', () => {
|
|||
expect(code).to.equal(-300);
|
||||
expect(isMainFrame).to.equal(true);
|
||||
});
|
||||
it('should not emit did-fail-load for a successfully loaded media file', async () => {
|
||||
w.webContents.on('did-fail-load', () => {
|
||||
expect.fail('did-fail-load should not emit on media file loads');
|
||||
});
|
||||
|
||||
const mediaStarted = once(w.webContents, 'media-started-playing');
|
||||
w.loadFile(path.join(fixtures, 'cat-spin.mp4'));
|
||||
await mediaStarted;
|
||||
});
|
||||
it('should set `mainFrame = false` on did-fail-load events in iframes', async () => {
|
||||
const didFailLoad = once(w.webContents, 'did-fail-load');
|
||||
w.loadFile(path.join(fixtures, 'api', 'did-fail-load-iframe.html'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue