| var firstReq = new XMLHttpRequest(); |
| firstReq.open("GET", "/resources/download-json-with-delay.php?iteration=100&delay=1"); |
| firstReq.onreadystatechange = function() { |
| if (firstReq.readyState == firstReq.HEADERS_RECEIVED) { |
| var secondReq = new XMLHttpRequest(); |
| secondReq.open("GET", "/resources/download-json-with-delay.php?iteration=10&delay=0"); |
| secondReq.onload = function() { |
| document.getElementById('result').innerText = "PASS"; |
| secondReq.onerror = function() { |
| document.getElementById('result').innerText = "FAIL"; |
| testRunner.waitUntilDone(); |
| <body onload="runTest()"> |
| <p>This is a test for https://bugs.webkit.org/show_bug.cgi?id=191650.</p> |
| <p>In case that several requests are closed and created pretty fast, a result of old request sometimes goes to a wrong request.</p> |
| <p id="result">RUNNING</p> |