Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / policy / blacklist-subresources.html
blobc02f39d281468ad02d93adfe5e55f83b93ae7e0b
1 <html>
2 <script>
4 var imageLoadResult = 'N/A';
5 var iframeLoadResult = 'N/A';
7 function imageLoaded() {
8 var image = document.getElementById('blacklisted_image');
9 // Additional sanity check to make sure the image is indeed loaded.
10 // Not strictly needed.
11 if (image.height == 1 && image.width == 1) {
12 imageLoadResult = "success";
13 } else {
14 imageLoadResult = "error";
18 function imageError() {
19 imageLoadResult = "error";
22 function iframeLoaded() {
23 // Unfortunately, iframe load errors generally don't result in onerror
24 // actually being called, so also check that the title is accessible.
25 // Since this is a same-site iframe, it generally should be, unless there's
26 // an error page showing in the iframe, in which case it's treated as a
27 // cross-domain iframe.
28 try {
29 document.getElementById('blacklisted_iframe').contentDocument.title;
30 iframeLoadResult = "success";
31 } catch (err) {
32 iframeLoadResult = "error";
36 function iframeError() {
37 iframeLoadResult = "error";
40 </script>
41 <img id="blacklisted_image" src="pixel.png" onload="imageLoaded()" onerror="imageError()"></img>
42 <iframe id="blacklisted_iframe" src="blank.html" onload="iframeLoaded()" onerror="iframeError()"></iframe>
43 </html>