| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| (function() { |
| "use strict"; |
| |
| let fakeXHRCreated = false; |
| |
| function createXHR() { |
| let xhr = new window.XMLHttpRequest(); |
| } |
| |
| for (let i = 0; i < 1000; i++) { |
| createXHR(); |
| } |
| |
| // Overwrite XMLHttpRequest |
| window.XMLHttpRequest = function() { |
| fakeXHRCreated = true; |
| } |
| |
| createXHR(); |
| |
| if (fakeXHRCreated) |
| testPassed("Overrode XMLHttpRequest"); |
| else |
| testFailed("Did not override XMLHttpRequest"); |
| })(); |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |