forked from mirrors/gecko-dev
		
	 a54eda04ca
			
		
	
	
		a54eda04ca
		
	
	
	
	
		
			
			Running eslint with --fix didn't fix many of the issues. The majority here had to be fixed by hand but a significant majority of the issues were related to a few files that I was able to use find-and-replace with. I regret not making this in to separate commits of the hand-fixes and the fixes from --fix but I don't recall --fix fixing any of the issues. MozReview-Commit-ID: ANyg2qfo3Qx --HG-- extra : rebase_source : 61d2aa91bf9474af3d72a5dea41b25dca442c1b7
		
			
				
	
	
		
			68 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
	
		
			2.1 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /* eslint-env mozilla/frame-script */
 | |
| /* Any copyright is dedicated to the Public Domain.
 | |
|    http://creativecommons.org/publicdomain/zero/1.0/ */
 | |
| 
 | |
| // Test that the fix for bug 687710 isn't too aggressive -- shentries which are
 | |
| // cousins should be able to share bfcache entries.
 | |
| 
 | |
| var stateBackup = ss.getBrowserState();
 | |
| 
 | |
| var state = {entries: [
 | |
|   {
 | |
|     docIdentifier: 1,
 | |
|     url: "http://example.com?1",
 | |
|     triggeringPrincipal_base64,
 | |
|     children: [{ docIdentifier: 10,
 | |
|                  url: "http://example.com?10",
 | |
|                  triggeringPrincipal_base64 }]
 | |
|   },
 | |
|   {
 | |
|     docIdentifier: 1,
 | |
|     url: "http://example.com?1#a",
 | |
|     triggeringPrincipal_base64,
 | |
|     children: [{ docIdentifier: 10,
 | |
|                  url: "http://example.com?10#aa",
 | |
|                  triggeringPrincipal_base64 }]
 | |
|   }
 | |
| ]};
 | |
| 
 | |
| add_task(function* test() {
 | |
|   let tab = gBrowser.addTab("about:blank");
 | |
|   yield promiseTabState(tab, state);
 | |
|   yield ContentTask.spawn(tab.linkedBrowser, null, function() {
 | |
|     function compareEntries(i, j, history) {
 | |
|       let e1 = history.getEntryAtIndex(i, false)
 | |
|                       .QueryInterface(Ci.nsISHEntry)
 | |
|                       .QueryInterface(Ci.nsISHContainer);
 | |
| 
 | |
|       let e2 = history.getEntryAtIndex(j, false)
 | |
|                       .QueryInterface(Ci.nsISHEntry)
 | |
|                       .QueryInterface(Ci.nsISHContainer);
 | |
| 
 | |
|       ok(e1.sharesDocumentWith(e2),
 | |
|          `${i} should share doc with ${j}`);
 | |
|       is(e1.childCount, e2.childCount,
 | |
|          `Child count mismatch (${i}, ${j})`);
 | |
| 
 | |
|       for (let c = 0; c < e1.childCount; c++) {
 | |
|         let c1 = e1.GetChildAt(c);
 | |
|         let c2 = e2.GetChildAt(c);
 | |
| 
 | |
|         ok(c1.sharesDocumentWith(c2),
 | |
|            `Cousins should share documents. (${i}, ${j}, ${c})`);
 | |
|       }
 | |
|     }
 | |
| 
 | |
|     let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
 | |
|                           .getInterface(Ci.nsISHistory);
 | |
| 
 | |
|     is(history.count, 2, "history.count");
 | |
|     for (let i = 0; i < history.count; i++) {
 | |
|       for (let j = 0; j < history.count; j++) {
 | |
|         compareEntries(i, j, history);
 | |
|       }
 | |
|     }
 | |
|   });
 | |
| 
 | |
|   ss.setBrowserState(stateBackup);
 | |
| });
 |