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

Side by Side Diff: chrome/test/data/referrer_policy/referrer-policy-start.html

Issue 135973009: Don't try to guess the referrer policy, but use the one associated with the request (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script> 4 <script>
5 function run() { 5 function run() {
6 var kPolicy = 1; 6 var kPolicy = 1;
7 var kPort = 2; 7 var kPort = 2;
8 var kSslPort = 3; 8 var kSslPort = 3;
9 var kRedirect = 4; 9 var kRedirect = 4;
10 var kLink = 5; 10 var kLink = 5;
11 var kTarget = 6; 11 var kTarget = 6;
12 var re = new RegExp( 12 var re = new RegExp("policy=(.*)&port=(.*)&ssl_port=(.*)&redirect=(.*)&" +
13 /policy=(.*)&port=(.*)&ssl_port=(.*)&redirect=(.*)&link=(.*)&target=(.*)/) ; 13 "link=(.*)&target=(.*)");
14 var matches = re.exec(document.location.search); 14 var matches = re.exec(document.location.search);
15 15
16 if (matches == null) { 16 if (matches == null) {
17 document.body.innerText = "Could not parse parameters!"; 17 document.body.innerText = "Could not parse parameters!";
18 return; 18 return;
19 } 19 }
20 20
21 var meta = document.createElement("meta"); 21 var meta = document.createElement("meta");
22 meta.name = "referrer"; 22 meta.name = "referrer";
23 meta.content = matches[kPolicy]; 23 meta.content = matches[kPolicy];
24 document.head.appendChild(meta); 24 document.head.appendChild(meta);
25 25
26 var destination; 26 var destination;
27 27
28 if (matches[kRedirect] == "true") { 28 if (matches[kRedirect] == "false") {
29 destination = 29 destination = "http://127.0.0.1:" + matches[kPort] +
30 "https://127.0.0.1:" + matches[kSslPort] + "/server-redirect?" + 30 "/files/referrer-policy-log.html";
31 "http://127.0.0.1:" + matches[kPort] + "/files/referrer-policy-log.html" ; 31 } else if (matches[kRedirect] == "http") {
32 destination = "http://127.0.0.1:" + matches[kPort] +
33 "/server-redirect?http://127.0.0.1:" + matches[kPort] +
34 "/files/referrer-policy-log.html";
32 } else { 35 } else {
33 destination = 36 destination = "https://127.0.0.1:" + matches[kSslPort] +
34 "http://127.0.0.1:" + matches[kPort] + "/files/referrer-policy-log.html" ; 37 "/server-redirect?http://127.0.0.1:" + matches[kPort] +
38 "/files/referrer-policy-log.html";
35 } 39 }
36 40
37 if (matches[kLink] == "true") { 41 if (matches[kLink] == "true") {
38 var link = document.createElement("a"); 42 var link = document.createElement("a");
39 link.innerText = "link"; 43 link.innerText = "link";
40 link.target = matches[kTarget]; 44 link.target = matches[kTarget];
41 link.href = destination; 45 link.href = destination;
42 document.body.appendChild(link); 46 document.body.appendChild(link);
43 } else { 47 } else {
44 document.location = destination; 48 document.location = destination;
45 } 49 }
46 } 50 }
47 </script> 51 </script>
48 </head> 52 </head>
49 <body onload="run()"> 53 <body onload="run()">
50 </body> 54 </body>
51 </html> 55 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/referrer_policy/referrer-policy-iframe.html ('k') | content/child/npapi/plugin_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698