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

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

Issue 23861003: Enable srcset support in HTMLImageElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a flaky test Created 7 years, 3 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
(Empty)
1 <html>
2 <head>
3 <script>
4 window.targetScaleFactor = 1;
5 </script>
6 <script src="resources/srcset-helper.js"></script>
7 <script src="../js/resources/js-test-pre.js"></script>
8 <script>
9 if (window.testRunner) {
10 testRunner.dumpAsText();
11 }
12
13 function updateSrc() {
14 var img = document.getElementById("foo");
15 // srcset must be set first, otherwise 'src' is loaded as well
16 img.src = "";
17 }
18
19 addEventListener("DOMContentLoaded", function() {
20 updateSrc();
21 }, false);
22 addEventListener("load", function() {
23 shouldBeTrue('document.getElementById("foo").clientWidth==200');
24 }, false);
25 </script>
26 </head>
27 <body id="body">
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 -200-px-square.png 2x">
30 </body>
31 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698