mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:52:45 +00:00 
			
		
		
		
	 36fddab68e
			
		
	
	
		36fddab68e
		
	
	
	
	
		
			
			This verifies that XHR.response is an instance of Blob when XHR.responseType is set to 'blob'.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			561 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			561 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <script src="../include.js"></script>
 | |
| <script>
 | |
|     asyncTest((done) => {
 | |
|         const xhr = new XMLHttpRequest();
 | |
|         xhr.responseType = "blob";
 | |
|         xhr.onreadystatechange = async function() {
 | |
|             if (xhr.readyState === 4 && xhr.status === 200) {
 | |
|                 if (xhr.response instanceof Blob)
 | |
|                     println("PASS");
 | |
|                 else
 | |
|                     println("FAIL");
 | |
|                 done();
 | |
|             }
 | |
|         };
 | |
|         xhr.open("GET", "data:text/plain,Hello%20World!", true);
 | |
|         xhr.send();
 | |
|     });
 | |
| </script>
 |