forked from mirrors/gecko-dev
		
	 f9f5914039
			
		
	
	
		f9f5914039
		
	
	
	
	
		
			
			# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36041 --HG-- extra : source : 96b3895a3b2aa2fcb064c85ec5857b7216884556
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			766 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			766 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| add_task(async function() {
 | |
|   is(gBrowser.tabs.length, 1, "one tab is open");
 | |
| 
 | |
|   gBrowser.selectedBrowser.focus();
 | |
|   isnot(
 | |
|     document.activeElement,
 | |
|     gURLBar.inputField,
 | |
|     "location bar is not focused"
 | |
|   );
 | |
| 
 | |
|   var tab = gBrowser.selectedTab;
 | |
|   Services.prefs.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
 | |
| 
 | |
|   EventUtils.synthesizeKey("w", { accelKey: true });
 | |
| 
 | |
|   is(tab.parentNode, null, "ctrl+w removes the tab");
 | |
|   is(gBrowser.tabs.length, 1, "a new tab has been opened");
 | |
|   is(
 | |
|     document.activeElement,
 | |
|     gURLBar.inputField,
 | |
|     "location bar is focused for the new tab"
 | |
|   );
 | |
| 
 | |
|   if (Services.prefs.prefHasUserValue("browser.tabs.closeWindowWithLastTab")) {
 | |
|     Services.prefs.clearUserPref("browser.tabs.closeWindowWithLastTab");
 | |
|   }
 | |
| });
 |