fix: webContents return type incorrect (#38026)
* fix: webContents type incorrect * fix: ci failed * fix: ci failed 2
This commit is contained in:
parent
b626be5e33
commit
141f65b291
3 changed files with 8 additions and 8 deletions
|
@ -492,16 +492,16 @@ describe('webContents module', () => {
|
|||
ifit(!(process.platform === 'win32' && process.arch === 'arm64'))('returns the focused web contents', async () => {
|
||||
const w = new BrowserWindow({ show: true });
|
||||
await w.loadFile(path.join(__dirname, 'fixtures', 'blank.html'));
|
||||
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.id);
|
||||
expect(webContents.getFocusedWebContents()?.id).to.equal(w.webContents.id);
|
||||
|
||||
const devToolsOpened = once(w.webContents, 'devtools-opened');
|
||||
w.webContents.openDevTools();
|
||||
await devToolsOpened;
|
||||
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.devToolsWebContents!.id);
|
||||
expect(webContents.getFocusedWebContents()?.id).to.equal(w.webContents.devToolsWebContents!.id);
|
||||
const devToolsClosed = once(w.webContents, 'devtools-closed');
|
||||
w.webContents.closeDevTools();
|
||||
await devToolsClosed;
|
||||
expect(webContents.getFocusedWebContents().id).to.equal(w.webContents.id);
|
||||
expect(webContents.getFocusedWebContents()?.id).to.equal(w.webContents.id);
|
||||
});
|
||||
|
||||
it('does not crash when called on a detached dev tools window', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue