feat: add 'resized' event to BrowserWindow (#26216)

Also adds 'moved' event to BrowserWindow on Windows.
This commit is contained in:
Samuel Maddock 2020-11-11 19:27:24 -05:00 committed by GitHub
parent bb3fb548d8
commit 83d30c5c2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 59 additions and 3 deletions

View file

@ -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)', () => {