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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/hidpi/image-srcset-dpr-zoom.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 if (!window.eventSender) 3 if (!window.eventSender)
5 document.write("Automatic zoom-in does not work in manual mode. Try zoom ing in manually and refresh."); 4 document.write("Automatic zoom-in does not work in manual mode. Try zoom ing in manually and refresh.");
6 else 5 else
7 while(!matchMedia("screen and (min-resolution: 2dppx)").matches) 6 while(!matchMedia("screen and (min-resolution: 2dppx)").matches)
8 eventSender.zoomPageIn(); 7 eventSender.zoomPageIn();
9 </script> 8 </script>
10 <script src="../../resources/js-test.js"></script> 9 <script src="../../resources/js-test.js"></script>
11 <script> 10 <script>
12 function updateSrc() { 11 function updateSrc() {
13 var img = document.getElementById("foo"); 12 var img = document.getElementById("foo");
14 img.srcset = "resources/blue-100-px-square.png 1x, resources/green-400-p x-square.png 2x"; 13 img.srcset = "resources/blue-100-px-square.png 1x, resources/green-400-p x-square.png 2x";
15 } 14 }
16
17 addEventListener("DOMContentLoaded", function() { 15 addEventListener("DOMContentLoaded", function() {
18 updateSrc(); 16 updateSrc();
19 }, false); 17 }, false);
20
21 addEventListener("load", function() { 18 addEventListener("load", function() {
22 shouldBeTrue('Math.abs(document.getElementById("foo").clientWidth - 200) < 0.1'); 19 shouldBeTrue('Math.abs(document.getElementById("foo").clientWidth - 200) < 0.1');
23 }, false); 20 }, false);
24 </script> 21 </script>
25 </head> 22 <div>This test passes if the image below is a 200px wide green square when the d eviceScaleFactor is 1, since the user has zoomed in.</div>
26 23 <img id="foo">
27 <body id="body">
28 <div>This test passes if the image below is a 200px wide green square when t he deviceScaleFactor is 1, since the user has zoomed in.</div>
29 <img id="foo">
30 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698