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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/hidpi/image-srcset-remove-dynamically-from-js.html

Issue 1908463002: Modernize fast/hidpi layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NeedsManualRebaseline Created 4 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
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head>
3 <script> 2 <script>
4 window.targetScaleFactor = 1; 3 window.targetScaleFactor = 1;
5 </script> 4 </script>
6 <script src="resources/srcset-helper.js"></script> 5 <script src="resources/srcset-helper.js"></script>
7 <script src="../../resources/js-test.js"></script> 6 <script src="../../resources/js-test.js"></script>
8 <script> 7 <script>
9 if (window.testRunner) { 8 if (window.testRunner) {
10 testRunner.dumpAsText(); 9 testRunner.dumpAsText();
11 } 10 }
12
13 function updateSrc() { 11 function updateSrc() {
14 var img = document.getElementById("foo"); 12 var img = document.getElementById("foo");
15 // srcset must be set first, otherwise 'src' is loaded as well 13 // srcset must be set first, otherwise 'src' is loaded as well
16 img.src = ""; 14 img.src = "";
17 } 15 }
18
19 addEventListener("DOMContentLoaded", function() { 16 addEventListener("DOMContentLoaded", function() {
20 updateSrc(); 17 updateSrc();
21 }, false); 18 }, false);
22 addEventListener("load", function() { 19 addEventListener("load", function() {
23 shouldBeTrue('document.getElementById("foo").clientWidth==200'); 20 shouldBeTrue('document.getElementById("foo").clientWidth==200');
24 }, false); 21 }, false);
25 </script> 22 </script>
26 </head> 23 <div>This test passes if this img tag below is a green square. It ensures that a ttributes can be removed dynamically from javascript</div>
27 <body id="body"> 24 <img id="foo" src="resources/blue-100-px-square.png" srcset="resources/green-400 -px-square.png 2x">
28 <div>This test passes if this img tag below is a green square. It ensures th at attributes can be removed dynamically from javascript</div>
29 <img id="foo" src="resources/blue-100-px-square.png" srcset="resources/green -400-px-square.png 2x">
30 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698