Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
|
fs
2016/08/10 17:37:08
Could you make this just "<!DOCTYPE html>" while w
sivag
2016/08/16 09:21:16
Done.
| |
| 2 <html> | 2 <title>This tests onerror event is fired if we change image src to a url blocked by content-security-policy.</title> |
| 3 <head> | |
| 4 <meta http-equiv="Content-Security-Policy" content="img-src 'self'"> | 3 <meta http-equiv="Content-Security-Policy" content="img-src 'self'"> |
| 5 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> | |
| 6 <img src="./color-jpeg-with-color-profile-expected.png"></img> | |
|
fs
2016/08/10 17:13:17
It was arguably a bit fishy to use <random-image-i
sivag
2016/08/16 09:21:16
Done.
I created a 1*1 png test image to test this
| |
| 6 <script> | 7 <script> |
| 7 description( | 8 async_test(function(t) { |
| 8 "This tests onerror event is fired if we change image src to a url blocked b y content-security-policy." | 9 var img = document.querySelector("img"); |
| 9 ) | 10 img.onerror = t.step_func_done(); |
| 10 | 11 img.src = "http://www.myfakesiteabc.com/image.png"; |
| 11 jsTestIsAsync = true; | 12 }); |
| 12 | |
| 13 function load() | |
| 14 { | |
| 15 var image = document.getElementById('test'); | |
| 16 image.onerror = function() { | |
| 17 testPassed("error event fired."); | |
| 18 finishJSTest(); | |
| 19 }; | |
| 20 image.src = 'http://www.myfakesiteabc.com/image.png'; | |
|
fs
2016/08/10 17:13:17
This is not great - previously we were relying on
sivag
2016/08/16 09:21:16
Done.
| |
| 21 | |
| 22 setTimeout(function() { | |
| 23 testFailed("error event is not fired.") | |
| 24 finishJSTest(); | |
| 25 }, 200); | |
| 26 } | |
| 27 </script> | 13 </script> |
| 28 | |
| 29 </head> | |
| 30 <body onload='load()'> | |
| 31 | |
| 32 <img src="./color-jpeg-with-color-profile-expected.png" id="test"></img> | |
| 33 | |
| 34 </body> | |
| 35 </html> | |
| OLD | NEW |