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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/http/tests/misc/prefetch-purpose-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?php setcookie("Purpose", $_SERVER["HTTP_PURPOSE"]); 1 <?php
2 2 echo "Purpose: " . $_SERVER["HTTP_PURPOSE"];
3 if (isset($_COOKIE['Purpose'])) {
4 setcookie("Purpose", "", time() - 3600);
5 echo "<h1>The cookie was set!</h1>";
6 echo "<p>Purpose: ";
7 echo $_COOKIE['Purpose'];
8 } else {
9 echo "<h1>BAD BROWSER NO COOKIE</h1>";
10 }
11 ?> 3 ?>
12 4
13 <script> 5 <script>
14 testRunner.notifyDone(); 6 testRunner.notifyDone();
15 </script> 7 </script>
16 8
17 <p>This test verifies that prefetches are sent with the HTTP request header 9 <p>This test verifies that prefetches are sent with the HTTP request
18 <b>Purpose: prefetch</b>. To do this, the root page has a prefetch 10 header <b>Purpose: prefetch</b>. To do this, the root page has a
19 link targetting this subresource which contains a PHP script 11 prefetch link targetting this subresource which contains a PHP script
20 (resources/prefetch-purpose.php). That initial prefetch of this 12 (resources/prefetch-purpose.php). The PHP prints the value of the
21 resource sets a cookie. Later, the root page sets window.location to 13 Purpose header into the document. Later, the root page sets
22 target this script, which verifies the presence of the cookie, and 14 window.location to target this script, which should have "Purpose:
23 generates the happy test output that you hopefully see right now. 15 prefetch" in its output if it's served from cache.
24
OLDNEW
« 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