test: call "expect()" on a correct call stack (#23675)
This commit is contained in:
parent
9d851b8791
commit
33d6a99d40
3 changed files with 36 additions and 49 deletions
|
@ -866,19 +866,18 @@ describe('BrowserWindow module', () => {
|
|||
});
|
||||
|
||||
describe('BrowserWindow.setContentSize(width, height)', () => {
|
||||
it('sets the content size', (done) => {
|
||||
it('sets the content size', async () => {
|
||||
// NB. The CI server has a very small screen. Attempting to size the window
|
||||
// larger than the screen will limit the window's size to the screen and
|
||||
// cause the test to fail.
|
||||
const size = [456, 567];
|
||||
w.setContentSize(size[0], size[1]);
|
||||
setImmediate(() => {
|
||||
const after = w.getContentSize();
|
||||
expect(after).to.deep.equal(size);
|
||||
done();
|
||||
});
|
||||
await new Promise(setImmediate);
|
||||
const after = w.getContentSize();
|
||||
expect(after).to.deep.equal(size);
|
||||
});
|
||||
it('works for a frameless window', (done) => {
|
||||
|
||||
it('works for a frameless window', async () => {
|
||||
w.destroy();
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
|
@ -888,11 +887,9 @@ describe('BrowserWindow module', () => {
|
|||
});
|
||||
const size = [456, 567];
|
||||
w.setContentSize(size[0], size[1]);
|
||||
setImmediate(() => {
|
||||
const after = w.getContentSize();
|
||||
expect(after).to.deep.equal(size);
|
||||
done();
|
||||
});
|
||||
await new Promise(setImmediate);
|
||||
const after = w.getContentSize();
|
||||
expect(after).to.deep.equal(size);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue