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

Side by Side Diff: LayoutTests/platform/chromium/permissionclient/image-permissions.html

Issue 14120003: Move LayoutTests from platform/chromium/... to generic location (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 // Blocked images can be reloaded, so neither onload nor onerror is called.
5 // Only check here that onload is never called when image is blocked.
6
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.dumpPermissionClientCallbacks();
10 }
11
12 function log(a)
13 {
14 document.getElementById("results").innerHTML += a + "<br>";
15 }
16
17 function loaded()
18 {
19 log("PASS: first image loaded");
20 if (window.testRunner && testRunner.setImagesAllowed)
21 testRunner.setImagesAllowed(false);
22 else
23 log("This test requires testRunner.setImagesAllowed, so it be can't run in a browser.");
24
25 // Load an image not in cache.
26 var img = document.createElement('img');
27 img.onload = function () { log("FAIL: not cached image loaded"); }
28 img.src = "resources/boston.gif?nocache";
29 document.getElementById("img").appendChild(img);
30
31 // Load an image from cache.
32 var imgFromCache = document.createElement('img');
33 imgFromCache.onload = function () { log("FAIL: image from cache loaded"); }
34 imgFromCache.src = "resources/boston.gif";
35 document.getElementById("img").appendChild(imgFromCache);
36
37 // Add an iframe with an image.
38 var iframe = document.createElement('iframe');
39 iframe.src = "resources/image.html";
40 document.getElementById("img").appendChild(iframe);
41 }
42 </script>
43 </head>
44 <body>
45 <img src="resources/boston.gif" onload="loaded()">
46 <div id="img"></div>
47 <div id="results"></div>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698