File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
spec-main/fixtures/api/test-menu-visibility Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -207,10 +207,9 @@ const { setDefaultApplicationMenu } = require('@electron/internal/browser/defaul
207
207
208
208
// Create default menu.
209
209
//
210
- // Note that the task must be added before loading any app, so we can make sure
211
- // the call is maded before any user window is created, otherwise the default
212
- // menu may show even when user explicitly hides the menu.
213
- app . whenReady ( ) . then ( setDefaultApplicationMenu ) ;
210
+ // The |will-finish-launching| event is emitted before |ready| event, so default
211
+ // menu is set before any user window is created.
212
+ app . once ( 'will-finish-launching' , setDefaultApplicationMenu ) ;
214
213
215
214
if ( packagePath ) {
216
215
// Finally load app's main.js and transfer control to C++.
Original file line number Diff line number Diff line change 1
1
const { app, BrowserWindow } = require ( 'electron' ) ;
2
2
3
3
let win ;
4
- app . whenReady ( ) . then ( function ( ) {
4
+ // This test uses "app.once('ready')" while the |test-menu-null| test uses
5
+ // "app.whenReady()", the 2 APIs have slight difference on timing to cover
6
+ // more cases.
7
+ app . once ( 'ready' , function ( ) {
5
8
win = new BrowserWindow ( { } ) ;
6
9
win . setMenuBarVisibility ( false ) ;
7
10
You can’t perform that action at this time.
0 commit comments