feat: add 'resized' event to BrowserWindow (#26216)
Also adds 'moved' event to BrowserWindow on Windows.
This commit is contained in:
parent
bb3fb548d8
commit
83d30c5c2a
10 changed files with 59 additions and 3 deletions
|
@ -855,6 +855,15 @@ describe('BrowserWindow module', () => {
|
|||
const expectedBounds = Object.assign(fullBounds, boundsUpdate);
|
||||
expectBoundsEqual(w.getBounds(), expectedBounds);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'darwin')('on macOS', () => {
|
||||
it('emits \'resized\' event after animating', async () => {
|
||||
const fullBounds = { x: 440, y: 225, width: 500, height: 400 };
|
||||
w.setBounds(fullBounds, true);
|
||||
|
||||
await expect(emittedOnce(w, 'resized')).to.eventually.be.fulfilled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('BrowserWindow.setSize(width, height)', () => {
|
||||
|
@ -867,6 +876,15 @@ describe('BrowserWindow module', () => {
|
|||
|
||||
expectBoundsEqual(w.getSize(), size);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'darwin')('on macOS', () => {
|
||||
it('emits \'resized\' event after animating', async () => {
|
||||
const size = [300, 400];
|
||||
w.setSize(size[0], size[1], true);
|
||||
|
||||
await expect(emittedOnce(w, 'resized')).to.eventually.be.fulfilled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('BrowserWindow.setMinimum/MaximumSize(width, height)', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue