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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/css/resources/referrer-check.php

Issue 1417943005: Fix corrupted LayoutTests/http/tests/resources/Ahem.ttf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make http tests use the fixed file Created 5 years, 1 month 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
OLDNEW
1 <?php 1 <?php
2 2
3 function getReferrerPath() { 3 function getReferrerPath() {
4 if (!isset($_SERVER["HTTP_REFERER"])) 4 if (!isset($_SERVER["HTTP_REFERER"]))
5 return ""; 5 return "";
6 $url = parse_url($_SERVER["HTTP_REFERER"]); 6 $url = parse_url($_SERVER["HTTP_REFERER"]);
7 return $url['path']; 7 return $url['path'];
8 } 8 }
9 9
10 function putImage() { 10 function putImage() {
11 $image = "../../resources/square100.png"; 11 $image = "../../resources/square100.png";
12 header("Content-Type: image/png"); 12 header("Content-Type: image/png");
13 header("Content-Length: " . filesize($image)); 13 header("Content-Length: " . filesize($image));
14 header("Access-Control-Allow-Origin: *"); 14 header("Access-Control-Allow-Origin: *");
15 ob_clean(); 15 ob_clean();
16 flush(); 16 flush();
17 readfile($image); 17 readfile($image);
18 } 18 }
19 19
20 function putFont() { 20 function putFont() {
21 $font = "../../../../resources/Ahem.ttf"; 21 $font = "../../resources/Ahem.ttf";
22 header("Content-Type: font/truetype"); 22 header("Content-Type: font/truetype");
23 header("Content-Length: " . filesize($font)); 23 header("Content-Length: " . filesize($font));
24 header("Access-Control-Allow-Origin: *"); 24 header("Access-Control-Allow-Origin: *");
25 ob_clean(); 25 ob_clean();
26 flush(); 26 flush();
27 readfile($font); 27 readfile($font);
28 } 28 }
29 29
30 $expectedReferrerPaths = array( 30 $expectedReferrerPaths = array(
31 "document" => "/css/css-resources-referrer.html", 31 "document" => "/css/css-resources-referrer.html",
(...skipping 10 matching lines...) Expand all
42 if ($resource === "image" || $resource === "image2") 42 if ($resource === "image" || $resource === "image2")
43 putImage(); 43 putImage();
44 else if ($resource === "font") 44 else if ($resource === "font")
45 putFont(); 45 putFont();
46 else 46 else
47 header("HTTP/1.1 500 Internal Server Error"); 47 header("HTTP/1.1 500 Internal Server Error");
48 } else { 48 } else {
49 header("HTTP/1.1 500 Internal Server Error"); 49 header("HTTP/1.1 500 Internal Server Error");
50 } 50 }
51 51
52 ?> 52 ?>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698