OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <body> |
| 3 <script src="/js-test-resources/js-test.js"></script> |
| 4 <script> |
| 5 description('Async XHR should not turn sync due to revalidation.'); |
| 6 window.jsTestIsAsync = true; |
| 7 const url = '/cache/resources/etag-200.php?' + |
| 8 Math.floor(100000000 * Math.random()); |
| 9 |
| 10 xhr1 = new XMLHttpRequest(); |
| 11 xhr2SendIsReturned = false; |
| 12 xhr1.open('GET', url, false); |
| 13 xhr1.onload = setTimeout(function() { |
| 14 xhr2 = new XMLHttpRequest(); |
| 15 xhr2.open('GET', url, true); |
| 16 xhr2.onload = function() { |
| 17 shouldBeTrue("xhr2SendIsReturned"); |
| 18 shouldNotBe("xhr1.responseText", "xhr2.responseText"); |
| 19 finishJSTest(); |
| 20 }; |
| 21 xhr2.send(); |
| 22 xhr2SendIsReturned = true; |
| 23 }, 0); |
| 24 xhr1.send(); |
| 25 </script> |
| 26 </body> |
| 27 </html> |
OLD | NEW |