3 if (window
.internals
) {
4 window
.internals
.settings
.setViewportEnabled(true);
5 window
.internals
.settings
.setViewportMetaEnabled(true);
8 <meta name=
"viewport" content=
"width=160">
9 <script src=
"../../../resources/testharness.js"></script>
10 <script src=
"../../../resources/testharnessreport.js"></script>
11 <script src=
"resources/currentSrcHelper.js"></script>
13 addEventListener("load", function() {
15 assert_equals(document
.getElementById("simple").currentSrc
.indexOf("file://"), 0);
16 assert_equals(document
.getElementById("simple").clientWidth
, 160);
17 assert_equals(currentSrcFileNameNoParams("simple"), "image-set-1x.png");
18 if (window
.internals
) {
19 assert_true(internals
.isLoadingFromMemoryCache("../../hidpi/resources/image-set-1x.png?3453459"));
20 assert_false(internals
.isLoadingFromMemoryCache("../../hidpi/resources/image-set-2x.png?3453459"));
22 }, "Test srcset and sizes with a meta viewport");
25 <img id=
"simple" src=
"" sizes=
"(max-width: 300px) 100vw, 800px" srcset=
"../../hidpi/resources/image-set-1x.png?3453459 400w, ../../hidpi/resources/image-set-2x.png?3453459 800w">