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

Side by Side Diff: content/test/data/simple_links.html

Issue 2080653002: SameSite: Correctly set requests' initiator for new tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 <html> 1 <html>
2 2
3 <head><title>Simple links</title> 3 <head><title>Simple links</title>
4 <script> 4 <script>
5 function simulateClick(target) { 5 function simulateClick(target) {
6 var evt = document.createEvent("MouseEvents"); 6 var evt = document.createEvent("MouseEvents");
7 evt.initMouseEvent("click", true, true, window, 7 evt.initMouseEvent("click", true, true, window,
8 0, 0, 0, 0, 0, false, false, 8 0, 0, 0, 0, 0, false, false,
9 false, false, 0, null); 9 false, false, 0, null);
10 10
11 return target.dispatchEvent(evt); 11 return target.dispatchEvent(evt);
12 } 12 }
13 13
14 function setPortNumber(portNumber) { 14 function setPortNumber(portNumber) {
15 var link = document.getElementById("cross_site_link"); 15 var link = document.getElementById("cross_site_link");
16 link.setAttribute("href", "http://foo.com:" + portNumber + "/title2.html"); 16 link.setAttribute("href", "http://foo.com:" + portNumber + "/title2.html");
17
18 link = document.getElementById("cross_site_new_window_link");
19 link.setAttribute("href", "http://foo.com:" + portNumber + "/title2.html");
17 return true; 20 return true;
18 } 21 }
19 22
20 function clickSameSiteLink() { 23 function clickSameSiteLink() {
21 return simulateClick(document.getElementById("same_site_link")); 24 return simulateClick(document.getElementById("same_site_link"));
22 } 25 }
23 26
27 function clickSameSiteNewWindowLink() {
28 return simulateClick(document.getElementById("same_site_new_window_link"));
29 }
30
24 function clickCrossSiteLink() { 31 function clickCrossSiteLink() {
25 return simulateClick(document.getElementById("cross_site_link")); 32 return simulateClick(document.getElementById("cross_site_link"));
26 } 33 }
27 34
35 function clickCrossSiteNewWindowLink() {
36 return simulateClick(document.getElementById("cross_site_new_window_link"));
37 }
38
28 function clickViewSourceLink() { 39 function clickViewSourceLink() {
29 return simulateClick(document.getElementById("view_source_link")); 40 return simulateClick(document.getElementById("view_source_link"));
30 } 41 }
31 </script> 42 </script>
32 </head> 43 </head>
33 44
34 <a href="title2.html" id="same_site_link">same-site</a><br> 45 <a href="title2.html" id="same_site_link">same-site</a><br>
35 <a href="http://foo.com/title2.html" id="cross_site_link">cross-site</a><br> 46 <a href="http://foo.com/title2.html" id="cross_site_link">cross-site</a><br>
36 <a href="view-source:about:blank" id="view_source_link">view-source:</a><br> 47 <a href="view-source:about:blank" id="view_source_link">view-source:</a><br>
48 <a href="title2.html" id="same_site_new_window_link" target="_blank">same-site n ew window</a>
49 <a href="http://foo.com/title2.html" id="cross_site_new_window_link" target="_bl ank">cross-site new window</a>
37 50
38 </html> 51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698