Chromium Code Reviews| 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 img.src = "http://127.0.0.1:8000/security/resources/green-if-no-refe rrer.php"; | 15 img.src = "http://127.0.0.1:8000/security/resources/green-if-no-refe rrer.php"; |
| 16 img.referrerpolicy = "no-referrer-when-downgrade"; | 16 img.referrerpolicy = "no-referrer-when-downgrade"; |
| 17 document.body.appendChild(img); | 17 document.body.appendChild(img); |
| 18 testRunner.notifyDone(); | 18 |
| 19 // Before calling testRunner.notifyDone (and taking a screenshot of | |
| 20 // actual.png), we need to make sure the image appended above got a | |
| 21 // chance to paint itself. | |
| 22 testRunner.layoutAndPaintAsyncThen(function() { | |
|
dcheng
2016/04/25 23:15:03
Should this just use the image's load event?
Łukasz Anforowicz
2016/04/25 23:33:50
Done. You're right, the layoutAndPaintAsyncThen i
| |
| 23 testRunner.notifyDone(); | |
| 24 }); | |
| 19 } | 25 } |
| 20 </script> | 26 </script> |
| 21 </body> | 27 </body> |
| 22 </html | 28 </html> |
| OLD | NEW |