fix: assign session to remote webContents (#23989)
* fix: assign session to remote webContents * fix: test name
This commit is contained in:
parent
a33c10c3ed
commit
04be1ac4a1
4 changed files with 24 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { expect } from 'chai';
|
||||
import { session, BrowserWindow, ipcMain, WebContents, Extension } from 'electron/main';
|
||||
import { app, session, BrowserWindow, ipcMain, WebContents, Extension } from 'electron/main';
|
||||
import { closeAllWindows, closeWindow } from './window-helpers';
|
||||
import * as http from 'http';
|
||||
import { AddressInfo } from 'net';
|
||||
|
|
@ -269,6 +269,16 @@ describe('chrome extensions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('has session in background page', async () => {
|
||||
const customSession = session.fromPartition(`persist:${require('uuid').v4()}`);
|
||||
await customSession.loadExtension(path.join(fixtures, 'extensions', 'persistent-background-page'));
|
||||
const w = new BrowserWindow({ show: false, webPreferences: { session: customSession } });
|
||||
const promise = emittedOnce(app, 'web-contents-created');
|
||||
await w.loadURL(`about:blank`);
|
||||
const [, bgPageContents] = await promise;
|
||||
expect(bgPageContents.session).to.not.equal(undefined);
|
||||
});
|
||||
|
||||
describe('devtools extensions', () => {
|
||||
let showPanelTimeoutId: any = null;
|
||||
afterEach(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue