Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLImageElement / image-srcset-duplicate-elimination.html
blobd162b571c724585d04cc727bda777ffd4c4ad8c2
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <script>
5 function runTest() {
6 var t = async_test("duplicate density candidate elimination");
7 var img = document.body.appendChild(new Image());
8 img.onload = t.step_func(function() {
9 var dynamicImageSrc = document.getElementById("dynimg").currentSrc;
10 var isBlue = (dynamicImageSrc.indexOf("blue_rect.jpg") != -1);
11 var is4x = (dynamicImageSrc.indexOf("image-set-4x.png") != -1);
12 assert_false(isBlue);
13 assert_true(is4x);
14 t.done();
15 });
16 img.id = "dynimg";
17 img.srcset = "resources/image-set-4x.png 1x, resources/blue_rect.jpg 1x";
19 </script>
20 <img src="resources/blue_rect.jpg" onload="runTest()">