forked from mirrors/gecko-dev
		
	_captureRemoteThumbnail was already checking that the provided browser hadn't been removed at the beginning, but due to using "await" this could also happen in the middle, causing an exception. That was the reason for flakyness in browser_adoptTab_failure.js This patch adds extra checks, and replaces "aBrowser.parentNode" with the more meaningful "aBrowser.isConnected", since there is no need to use "parentNode" to get the "ownerDocument". Differential Revision: https://phabricator.services.mozilla.com/D166264
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			447 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			447 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/* Any copyright is dedicated to the Public Domain.
 | 
						|
   http://creativecommons.org/publicdomain/zero/1.0/ */
 | 
						|
 | 
						|
add_task(async function thumbnails_bug1775638() {
 | 
						|
  const tab = await BrowserTestUtils.openNewForegroundTab(
 | 
						|
    gBrowser,
 | 
						|
    "https://example.com"
 | 
						|
  );
 | 
						|
  const canvas = document.createElement("canvas");
 | 
						|
  const promise = PageThumbs.captureToCanvas(tab.linkedBrowser, canvas);
 | 
						|
  gBrowser.removeTab(tab);
 | 
						|
  is(await promise, canvas);
 | 
						|
});
 |