2 <script src="../../hidpi/resources/srcset-helper.js"></script>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/currentSrcHelper.js"></script>
7 testRunner.dumpAsText();
10 internals.evictAllResources();
12 function updateSrc() {
13 var img = document.getElementById("foo");
14 // sizes must be set first, then srcset must be set, the 'src'
15 // This will be fixed when image loading is done is "stable-state"
17 img.srcset = "../../hidpi/resources/image-set-1x.png 200w, ../../hidpi/resources/image-set-2x.png 400w, resources/image-set-4x.png 800w";
18 img.src = "resources/blue-100-px-square.png"
21 addEventListener("DOMContentLoaded", function() {
24 addEventListener("load", function() {
25 shouldBe('currentSrcFileName("foo")', '"image-set-4x.png"');
27 shouldBeTrue('internals.isLoadingFromMemoryCache("resources/image-set-4x.png")');
28 shouldBeFalse('internals.isLoadingFromMemoryCache("../../hidpi/resources/image-set-2x.png")');
29 shouldBeFalse('internals.isLoadingFromMemoryCache("../../hidpi/resources/image-set-1x.png")');
30 shouldBeFalse('internals.isLoadingFromMemoryCache("resources/blue-100-px-square.png")');