blob: e2249c7628ca4c8ab9ed0b7cf87debd35ea8ce70 [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ ShouldIgnoreMetaViewport=true ] -->
<html>
<head>
<meta name="viewport" content="width=300">
<style>
body, html {
margin: 0;
}
#bar {
width: 100%;
height: 100px;
background: linear-gradient(to right, red 0%, green 50%, blue 100%);
}
#description {
width: 300px;
overflow: scroll;
}
</style>
<script src="../../../resources/ui-helper.js"></script>
<script src="../../../resources/js-test.js"></script>
<script>
jsTestIsAsync = true;
description("This test verifies that a page with a constant width viewport smaller than the actual view width is scaled to fit the view. To test manually, load the page and verify that the bar spans the full width of the page.");
addEventListener("load", async () => {
if (!window.testRunner)
return;
await UIHelper.ensurePresentationUpdate();
minScale = (await UIHelper.minimumZoomScale()).toFixed(2);
expectedScale = (screen.width / 300).toFixed(2);
shouldBe("minScale", "expectedScale");
shouldBe("innerWidth", "300");
finishJSTest();
});
</script>
</head>
<body>
<div id="bar"></div>
<div id="description"></div>
</body>
</html>