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