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

Side by Side Diff: LayoutTests/fast/hidpi/image-srcset-change-dynamically-from-js-2x.html

Issue 136693020: Add image loading spec related tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed expectation for origin header test Created 6 years, 10 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>
4 if (window.testRunner)
5 testRunner.dumpResourceRequestCallbacks();
6 </script>
7 <script src="resources/srcset-helper.js"></script> 3 <script src="resources/srcset-helper.js"></script>
8 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
9 <script> 5 <script>
10 function updateSrc() { 6 function updateSrc() {
11 var img = document.getElementById("foo"); 7 var img = document.getElementById("foo");
12 // srcset must be set first, otherwise 'src' is loaded as well 8 // srcset must be set first, otherwise 'src' is loaded as well
13 img.srcset = "resources/blue-100-px-square.png 1x, resources/green-400-p x-square.png 2x"; 9 img.srcset = "resources/blue-100-px-square.png 1x, resources/green-400-p x-square.png 2x";
14 img.src = "resources/blue-100-px-square.png" 10 img.src = "resources/blue-100-px-square.png"
15 } 11 }
16 12
17 addEventListener("DOMContentLoaded", function() { 13 addEventListener("DOMContentLoaded", function() {
14 if (window.testRunner && sessionStorage.pageReloaded)
15 testRunner.dumpResourceRequestCallbacks();
18 updateSrc(); 16 updateSrc();
19 }, false); 17 }, false);
20 addEventListener("load", function() { 18 addEventListener("load", function() {
21 shouldBeTrue('document.getElementById("foo").clientWidth==200'); 19 shouldBeTrue('document.getElementById("foo").clientWidth==200');
22 }, false); 20 }, false);
23 </script> 21 </script>
24 </head> 22 </head>
25 23
26 <body id="body"> 24 <body id="body">
27 <div>This test passes if this img tag below is a green square when the scale factor is 2. 25 <div>This test passes if this img tag below is a green square when the scale factor is 2.
28 It ensures that attributes can be changed dynamically from javascript, and that only the correct resource is loaded.</div> 26 It ensures that attributes can be changed dynamically from javascript, and that only the correct resource is loaded.</div>
29 <img id="foo"> 27 <img id="foo">
30 </body> 28 </body>
31 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698