forked from mirrors/gecko-dev
		
	 8ec70a2c1b
			
		
	
	
		8ec70a2c1b
		
	
	
	
	
		
			
			The goal of this patch is to ensure that: - in default placements, specials have no unique ids - in actual placements as stored by CUI, they do - we reset the counter for those unique ids on reset. - we re-number specials when building an area (like on startup, or when resetting), ensuring that the actual nodes always match the placements for a given area. - we force saves after resetting, to ensure that the gNewElementCount is always persisted correctly. This last part will also fix bug 1393661 MozReview-Commit-ID: HAS5J5ZSgB5 --HG-- extra : rebase_source : df62441169e07fb94e39f68a2b3e43f6ed7f464c
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			954 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			954 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /* Any copyright is dedicated to the Public Domain.
 | |
|  * http://creativecommons.org/publicdomain/zero/1.0/ */
 | |
| 
 | |
| "use strict";
 | |
| 
 | |
| function checkSpacers() {
 | |
|   let navbarWidgets = CustomizableUI.getWidgetIdsInArea("nav-bar");
 | |
|   let currentSetWidgets = document.getElementById("nav-bar").currentSet.split(",");
 | |
|   navbarWidgets = navbarWidgets.filter(w => CustomizableUI.isSpecialWidget(w));
 | |
|   currentSetWidgets = currentSetWidgets.filter(w => CustomizableUI.isSpecialWidget(w));
 | |
|   Assert.deepEqual(navbarWidgets, currentSetWidgets, "Should have the same 'special' widgets in currentset and placements");
 | |
| }
 | |
| 
 | |
| /**
 | |
|  * Check that after a reset, the currentset property correctly deals with flexible spacers.
 | |
|  */
 | |
| add_task(async function() {
 | |
|   await startCustomizing();
 | |
|   checkSpacers();
 | |
| 
 | |
|   CustomizableUI.addWidgetToArea("spring", "nav-bar", 4 /* Insert before the last extant spacer */);
 | |
|   await gCustomizeMode.reset();
 | |
|   checkSpacers();
 | |
|   await endCustomizing();
 | |
| });
 |