chromium/third_party/blink/web_tests/fast/dom/HTMLImageElement/image-srcset-in-template.html

<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script src="resources/currentSrcHelper.js"></script>
<script>
    jsTestIsAsync = true;

    addEventListener("load", function() {
        shouldBe('document.getElementById("canary").clientWidth', '75');
        shouldBe('currentSrcFileName("canary")', '"blue_rect.jpg?0"');
        shouldNotBe('document.querySelector("#clone img").currentSrc.indexOf("image-set-1x")', '-1');
        shouldBe('document.querySelector("#clone img").currentSrc.indexOf("blue_rect")', '-1');
        shouldNotBe('document.querySelector("#import img").currentSrc.indexOf("image-set-1x")', '-1');
        shouldBe('document.querySelector("#import img").currentSrc.indexOf("blue_rect")', '-1');
        finishJSTest();
    }, false);
</script>
<!-- A canary image to see that the test is actually working -->
<img id="canary" src="resources/blue_rect.jpg?0">
<!-- simple picture construct -->
<template>
    <img src="resources/blue_rect.jpg?1" srcset="../../hidpi/resources/image-set-1x.png 1x, ../../hidpi/resources/image-set-2x.png 2x">
</template>
<div id="clone"></div>
<div id="import"></div>
<script>
    var t = document.querySelector('template');

    document.querySelector('#clone').appendChild(t.content.cloneNode(true));
    document.querySelector('#import').appendChild(document.importNode(t.content, true));
</script>