forked from mirrors/gecko-dev
		
	
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			543 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			543 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| function waitForPdfJS(browser, url) {
 | |
|   // Runs tests after all "load" event handlers have fired off
 | |
|   return ContentTask.spawn(browser, url, async function(contentUrl) {
 | |
|     await new Promise((resolve) => {
 | |
|       // NB: Add the listener to the global object so that we receive the
 | |
|       // event fired from the new window.
 | |
|       addEventListener("documentload", function listener() {
 | |
|         removeEventListener("documentload", listener, false);
 | |
|         resolve();
 | |
|       }, false, true);
 | |
| 
 | |
|       content.location = contentUrl;
 | |
|     });
 | |
|   });
 | |
| }
 | 
