| <!DOCTYPE html> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <script> |
| function runTest() { |
| var t = async_test("duplicate density candidate elimination"); |
| var img = document.body.appendChild(new Image()); |
| img.onload = t.step_func(function() { |
| var dynamicImageSrc = document.getElementById("dynimg").currentSrc; |
| var isBlue = (dynamicImageSrc.indexOf("blue_rect.jpg") != -1); |
| var is4x = (dynamicImageSrc.indexOf("image-set-4x.png") != -1); |
| assert_false(isBlue); |
| assert_true(is4x); |
| t.done(); |
| }); |
| img.id = "dynimg"; |
| img.srcset = "resources/image-set-4x.png 1x, resources/blue_rect.jpg 1x"; |
| }; |
| </script> |
| <img src="resources/blue_rect.jpg" onload="runTest()"> |