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

Unified Diff: LayoutTests/http/tests/cache/subresource-revalidation-referrer.html

Issue 201973002: Re-set referrer on issuing a validation request for a cached resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Emit header()s first Created 6 years, 9 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: LayoutTests/http/tests/cache/subresource-revalidation-referrer.html
diff --git a/LayoutTests/http/tests/cache/subresource-revalidation-referrer.html b/LayoutTests/http/tests/cache/subresource-revalidation-referrer.html
new file mode 100644
index 0000000000000000000000000000000000000000..8b8391190425aa12b49c8fb3f56e031dd2cbea8a
--- /dev/null
+++ b/LayoutTests/http/tests/cache/subresource-revalidation-referrer.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<script src="/js-test-resources/js-test.js"></script>
+<script src="resources/referrer-echo.php" type="text/javascript"></script>
+<script>
+description("Check that Referrer: for validation requests are correctly set.");
+window.jsTestIsAsync = true;
+
+// The above script adds the 'referrer' global.
+shouldBeTrue('referrer.indexOf("subresource-revalidation-referrer.html") >= 0');
+
+var first = true;
+function iframeLoaded(ref) {
+ if (first) {
+ // Navigating the iframe-embedded anchor will use the iframe's
+ // URL as referrer.
+ first = false;
+ window.frames[0].document.getElementsByTagName("a")[0].click();
+ } else {
+ referrer = ref;
+ shouldBeTrue('referrer.indexOf("subresource-revalidation-referrer-iframe.html") >= 0');
+ finishJSTest();
+ }
+}
+</script>
+<iframe src="resources/subresource-revalidation-referrer-iframe.html"></iframe>

Powered by Google App Engine
This is Rietveld 408576698