2020-03-20 20:28:31 +00:00
|
|
|
const { app, BrowserWindow } = require('electron');
|
2019-12-09 19:17:36 +00:00
|
|
|
|
2020-03-20 20:28:31 +00:00
|
|
|
let win;
|
2020-04-23 17:51:31 +00:00
|
|
|
// This test uses "app.once('ready')" while the |test-menu-null| test uses
|
|
|
|
// "app.whenReady()", the 2 APIs have slight difference on timing to cover
|
|
|
|
// more cases.
|
|
|
|
app.once('ready', function () {
|
2020-03-20 20:28:31 +00:00
|
|
|
win = new BrowserWindow({});
|
|
|
|
win.setMenuBarVisibility(false);
|
2019-12-09 19:17:36 +00:00
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
if (win.isMenuBarVisible()) {
|
2020-03-20 20:28:31 +00:00
|
|
|
console.log('Window has a menu');
|
2019-12-09 19:17:36 +00:00
|
|
|
} else {
|
2020-03-20 20:28:31 +00:00
|
|
|
console.log('Window has no menu');
|
2019-12-09 19:17:36 +00:00
|
|
|
}
|
2020-03-20 20:28:31 +00:00
|
|
|
app.quit();
|
|
|
|
});
|
|
|
|
});
|