2 <title>Test that does not load a low quality resource when viewport is downsized
</title>
3 <script src=
"../../../resources/testharness.js"></script>
4 <script src=
"../../../resources/testharnessreport.js"></script>
5 <iframe style=
"width: 120px;"></iframe>
7 async_test(function(t
) {
8 var iframe
= document
.querySelector('iframe');
9 var iframeDoc
= iframe
.contentWindow
.document
;
11 document
.body
.offsetTop
;
12 iframeDoc
.body
.innerHTML
= '<img id="srcset" srcset="resources/blue_rect.jpg 90w, resources/image-set-4x.png 120w">';
14 img
= iframeDoc
.getElementById('srcset');
17 img
.onload
= t
.step_func(function() {
20 assert_equals(img
.currentSrc
.indexOf("blue_rect.jpg"), -1);
22 iframe
.style
.width
= '90px';
23 requestAnimationFrame(function() {
24 requestAnimationFrame(function() {
25 setTimeout(t
.step_func(function() {
26 assert_equals(img
.currentSrc
.indexOf("blue_rect.jpg"), -1);