Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLImageElement / image-sizes-meta-viewport.html
blobf9607e024dfbd43d4b7e7e8bbb28f3de7bfb164f
1 <!DOCTYPE html>
2 <script>
3 if (window.internals) {
4 window.internals.settings.setViewportEnabled(true);
5 window.internals.settings.setViewportMetaEnabled(true);
7 </script>
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>
12 <script>
13 addEventListener("load", function() {
14 test(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");
23 }, false);
24 </script>
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">