mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
fix: crash when calling BrowserWindow.moveTop() on modal children (#39499)
fix: crash when calling moveTop() on modal children
This commit is contained in:
@@ -1283,6 +1283,8 @@ describe('BrowserWindow module', () => {
|
||||
});
|
||||
|
||||
describe('BrowserWindow.moveTop()', () => {
|
||||
afterEach(closeAllWindows);
|
||||
|
||||
it('should not steal focus', async () => {
|
||||
const posDelta = 50;
|
||||
const wShownInactive = once(w, 'show');
|
||||
@@ -1324,6 +1326,15 @@ describe('BrowserWindow module', () => {
|
||||
await closeWindow(otherWindow, { assertNotWindows: false });
|
||||
expect(BrowserWindow.getAllWindows()).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('should not crash when called on a modal child window', async () => {
|
||||
const shown = once(w, 'show');
|
||||
w.show();
|
||||
await shown;
|
||||
|
||||
const child = new BrowserWindow({ modal: true, parent: w });
|
||||
expect(() => { child.moveTop(); }).to.not.throw();
|
||||
});
|
||||
});
|
||||
|
||||
describe('BrowserWindow.moveAbove(mediaSourceId)', () => {
|
||||
|
||||
Reference in New Issue
Block a user