|
@@ -6,7 +6,7 @@ import * as os from 'os';
|
|
|
import * as qs from 'querystring';
|
|
|
import * as http from 'http';
|
|
|
import { AddressInfo } from 'net';
|
|
|
-import { app, BrowserWindow, BrowserView, ipcMain, OnBeforeSendHeadersListenerDetails, protocol, screen, webContents, session, WebContents, BrowserWindowConstructorOptions } from 'electron/main';
|
|
|
+import { app, BrowserWindow, BrowserView, dialog, ipcMain, OnBeforeSendHeadersListenerDetails, protocol, screen, webContents, session, WebContents, BrowserWindowConstructorOptions } from 'electron/main';
|
|
|
|
|
|
import { emittedOnce, emittedUntil, emittedNTimes } from './events-helpers';
|
|
|
import { ifit, ifdescribe, defer, delay } from './spec-helpers';
|
|
@@ -102,6 +102,13 @@ describe('BrowserWindow module', () => {
|
|
|
w = null as unknown as BrowserWindow;
|
|
|
});
|
|
|
|
|
|
+ it('should work if called when a messageBox is showing', async () => {
|
|
|
+ const closed = emittedOnce(w, 'closed');
|
|
|
+ dialog.showMessageBox(w, { message: 'Hello Error' });
|
|
|
+ w.close();
|
|
|
+ await closed;
|
|
|
+ });
|
|
|
+
|
|
|
it('should emit unload handler', async () => {
|
|
|
await w.loadFile(path.join(fixtures, 'api', 'unload.html'));
|
|
|
const closed = emittedOnce(w, 'closed');
|