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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/image-blocked-src-change.html

Issue 2395313002: Revert of Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 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 <head> 2 <head>
3 <script type="text/ecmascript"> 3 <script type="text/ecmascript">
4 function logSuccessOrFailure() 4 function logSuccessOrFailure()
5 { 5 {
6 var console = document.getElementById('console'); 6 var console = document.getElementById('console');
7 var image = document.getElementById('image'); 7 var image = document.getElementById('image');
8 8
9 if (image.naturalHeight && image.naturalWidth) 9 if (image.height && image.width)
10 console.innerHTML = "PASSED"; 10 console.innerHTML = "PASSED";
11 else 11 else
12 console.innerHTML = "FAILED"; 12 console.innerHTML = "FAILED";
13 13
14 if (window.testRunner) 14 if (window.testRunner)
15 testRunner.notifyDone(); 15 testRunner.notifyDone();
16 } 16 }
17 17
18 function changeSrc() 18 function changeSrc()
19 { 19 {
20 if (window.testRunner) { 20 if (window.testRunner) {
21 testRunner.dumpAsText(); 21 testRunner.dumpAsText();
22 testRunner.waitUntilDone(); 22 testRunner.waitUntilDone();
23 } 23 }
24 var image = document.getElementById('image'); 24 var image = document.getElementById('image');
25 25
26 if (image.naturalHeight || image.naturalWidth) { 26 if (image.height || image.width) {
27 console.innerHTML = "FAILED"; 27 console.innerHTML = "FAILED";
28 return; 28 return;
29 } 29 }
30 30
31 image.src = "../security/resources/green250x50.png"; 31 image.src = "../security/resources/green250x50.png";
32 32
33 // The image may not be loaded, so just wait a little 33 // The image may not be loaded, so just wait a little
34 // before checking if it was loaded. 34 // before checking if it was loaded.
35 window.setTimeout("logSuccessOrFailure()", 100); 35 window.setTimeout("logSuccessOrFailure()", 100);
36 } 36 }
37 </script> 37 </script>
38 </head> 38 </head>
39 <body onload="changeSrc()"> 39 <body onload="changeSrc()">
40 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=17897 "> bug 17897 </a>: Not Rendering Images Imported from XHTML Document </p> 40 <p> Test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=17897 "> bug 17897 </a>: Not Rendering Images Imported from XHTML Document </p>
41 <p> You should see PASSED once and 250 x 50 green box. The console shoul d also show a blocked attempt to load a local resource.</p> 41 <p> You should see PASSED once and 250 x 50 green box. The console shoul d also show a blocked attempt to load a local resource.</p>
42 <p id='console'> </p> 42 <p id='console'> </p>
43 <!-- This image should be blocked (see security/local-image-from-remote. html) --> 43 <!-- This image should be blocked (see security/local-image-from-remote. html) -->
44 <img id='image' src="file:///tmp/LayoutTests/http/tests/security/resourc es/compass.jpg"/> 44 <img id='image' src="file:///tmp/LayoutTests/http/tests/security/resourc es/compass.jpg"/>
45 </body> 45 </body>
46 </html> 46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698