forked from mirrors/gecko-dev
		
	 ae7f88b657
			
		
	
	
		ae7f88b657
		
	
	
	
	
		
			
			Differential Revision: https://phabricator.services.mozilla.com/D6375 --HG-- extra : moz-landing-system : lando
		
			
				
	
	
		
			16 lines
		
	
	
	
		
			514 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
	
		
			514 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| add_task(async function testTabCloseShortcut() {
 | |
|   let win = await BrowserTestUtils.openNewBrowserWindow();
 | |
|   await SimpleTest.promiseFocus(win);
 | |
| 
 | |
|   function onTabClose() {
 | |
|     ok(false, "shouldn't have gotten the TabClose event for the last tab");
 | |
|   }
 | |
|   var tab = win.gBrowser.selectedTab;
 | |
|   tab.addEventListener("TabClose", onTabClose);
 | |
| 
 | |
|   EventUtils.synthesizeKey("w", { accelKey: true }, win);
 | |
| 
 | |
|   ok(win.closed, "accel+w closed the window immediately");
 | |
| 
 | |
|   tab.removeEventListener("TabClose", onTabClose);
 | |
| });
 |