Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/sync-xhr-revalidate-after-async-xhr.html

Issue 2391523002: Do not revalidate when ResourceLoaderOptions.synchronousPolicy is different (Closed)
Patch Set: git cl format Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698