OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="/resources/get-host-info.js"></script> | 4 <script src="/resources/get-host-info.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 if (window.testRunner) | 8 if (window.testRunner) |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 | 10 |
11 if (window.location.origin != get_host_info().HTTPS_ORIGIN) { | 11 if (window.location.origin != get_host_info().HTTPS_ORIGIN) { |
12 window.location = get_host_info().HTTPS_ORIGIN + window.location.pat
hname; | 12 window.location = get_host_info().HTTPS_ORIGIN + window.location.pat
hname; |
13 } else { | 13 } else { |
14 var img = document.createElement("img"); | 14 var img = document.createElement("img"); |
| 15 |
| 16 // Before calling testRunner.notifyDone (and taking a screenshot of |
| 17 // the page), we need to make sure the image got actually loaded. |
| 18 img.addEventListener("load", function() { |
| 19 testRunner.notifyDone(); |
| 20 }); |
| 21 |
15 img.src = "http://127.0.0.1:8000/security/resources/green-if-no-refe
rrer.php"; | 22 img.src = "http://127.0.0.1:8000/security/resources/green-if-no-refe
rrer.php"; |
16 img.referrerpolicy = "no-referrer-when-downgrade"; | 23 img.referrerpolicy = "no-referrer-when-downgrade"; |
17 document.body.appendChild(img); | 24 document.body.appendChild(img); |
18 testRunner.notifyDone(); | |
19 } | 25 } |
20 </script> | 26 </script> |
21 </body> | 27 </body> |
22 </html | 28 </html> |
OLD | NEW |