| 
									
										
										
										
											2020-03-20 13:28:31 -07:00
										 |  |  | const { app, BrowserWindow } = require('electron'); | 
					
						
							| 
									
										
										
										
											2019-12-10 04:17:36 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-20 13:28:31 -07:00
										 |  |  | let win; | 
					
						
							| 
									
										
										
										
											2020-04-24 02:51:31 +09: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 13:28:31 -07:00
										 |  |  |   win = new BrowserWindow({}); | 
					
						
							|  |  |  |   win.setMenuBarVisibility(false); | 
					
						
							| 
									
										
										
										
											2019-12-10 04:17:36 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  |   setTimeout(() => { | 
					
						
							|  |  |  |     if (win.isMenuBarVisible()) { | 
					
						
							| 
									
										
										
										
											2020-03-20 13:28:31 -07:00
										 |  |  |       console.log('Window has a menu'); | 
					
						
							| 
									
										
										
										
											2019-12-10 04:17:36 +09:00
										 |  |  |     } else { | 
					
						
							| 
									
										
										
										
											2020-03-20 13:28:31 -07:00
										 |  |  |       console.log('Window has no menu'); | 
					
						
							| 
									
										
										
										
											2019-12-10 04:17:36 +09:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-03-20 13:28:31 -07:00
										 |  |  |     app.quit(); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |