Index: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/sync-xhr-revalidate-after-async-xhr.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/sync-xhr-revalidate-after-async-xhr.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/sync-xhr-revalidate-after-async-xhr.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3a9e96bc3f9ba48d173b5e90cc26449efd6a20ad |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/sync-xhr-revalidate-after-async-xhr.html |
@@ -0,0 +1,27 @@ |
+<html> |
+<body> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script> |
+description('Sync XHR should not turn async due to revalidation.'); |
+window.jsTestIsAsync = true; |
+const url = '/cache/resources/etag-200.php?' + |
+ Math.floor(100000000 * Math.random()); |
+ |
+xhr1 = new XMLHttpRequest(); |
+xhr2SendIsReturned = false; |
+xhr1.open('GET', url, true); |
+xhr1.onload = setTimeout(function() { |
+ xhr2 = new XMLHttpRequest(); |
+ xhr2.open('GET', url, false); |
+ xhr2.onload = function() { |
+ shouldBeFalse("xhr2SendIsReturned"); |
+ shouldNotBe("xhr1.responseText", "xhr2.responseText"); |
+ finishJSTest(); |
+ }; |
+ xhr2.send(); |
+ xhr2SendIsReturned = true; |
+}, 0); |
+xhr1.send(); |
+</script> |
+</body> |
+</html> |