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

Unified Diff: LayoutTests/http/tests/misc/resources/prefetch-purpose.php

Issue 850753002: Fix prefetch-purpose layout test to support caching (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 10 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
« no previous file with comments | « LayoutTests/http/tests/misc/prefetch-purpose-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/misc/resources/prefetch-purpose.php
diff --git a/LayoutTests/http/tests/misc/resources/prefetch-purpose.php b/LayoutTests/http/tests/misc/resources/prefetch-purpose.php
index ac60f9a1ca7856cbe9a075006df385d0d839cd43..ce080df9a2a72f615c7a2327b2d9431203157e13 100644
--- a/LayoutTests/http/tests/misc/resources/prefetch-purpose.php
+++ b/LayoutTests/http/tests/misc/resources/prefetch-purpose.php
@@ -1,24 +1,15 @@
-<?php setcookie("Purpose", $_SERVER["HTTP_PURPOSE"]);
-
-if (isset($_COOKIE['Purpose'])) {
- setcookie("Purpose", "", time() - 3600);
- echo "<h1>The cookie was set!</h1>";
- echo "<p>Purpose: ";
- echo $_COOKIE['Purpose'];
-} else {
- echo "<h1>BAD BROWSER NO COOKIE</h1>";
-}
+<?php
+echo "Purpose: " . $_SERVER["HTTP_PURPOSE"];
?>
<script>
testRunner.notifyDone();
</script>
-<p>This test verifies that prefetches are sent with the HTTP request header
-<b>Purpose: prefetch</b>. To do this, the root page has a prefetch
-link targetting this subresource which contains a PHP script
-(resources/prefetch-purpose.php). That initial prefetch of this
-resource sets a cookie. Later, the root page sets window.location to
-target this script, which verifies the presence of the cookie, and
-generates the happy test output that you hopefully see right now.
-
+<p>This test verifies that prefetches are sent with the HTTP request
+header <b>Purpose: prefetch</b>. To do this, the root page has a
+prefetch link targetting this subresource which contains a PHP script
+(resources/prefetch-purpose.php). The PHP prints the value of the
+Purpose header into the document. Later, the root page sets
+window.location to target this script, which should have "Purpose:
+prefetch" in its output if it's served from cache.
« no previous file with comments | « LayoutTests/http/tests/misc/prefetch-purpose-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698