mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:02:45 +00:00 
			
		
		
		
	 09487679eb
			
		
	
	
		09487679eb
		
	
	
	
	
		
			
			This verifies that XHR.response is an instance of Document when XHR.responseType is set to 'document' and the response contains HTML.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			570 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			570 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <script src="../include.js"></script>
 | |
| <script>
 | |
|     asyncTest((done) => {
 | |
|         const xhr = new XMLHttpRequest();
 | |
|         xhr.responseType = "document";
 | |
|         xhr.open("GET", "data:text/html,<!DOCTYPE html><html/>", true);
 | |
|         xhr.onreadystatechange = function() {
 | |
|             if (xhr.readyState === 4 && xhr.status === 200) {
 | |
|                 if (xhr.response instanceof Document)
 | |
|                     println("PASS");
 | |
|                 else
 | |
|                     println("FAIL");
 | |
|                 done();
 | |
|             }
 | |
|         };
 | |
|         xhr.send();
 | |
|     });
 | |
| </script>
 |