blob: 1910602953956a0e7b8dc12f0bc4bd846e98ab98 [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ ShouldIgnoreMetaViewport=true ] -->
<html>
<head>
<meta name="viewport">
<style>
body, html {
margin: 0;
width: 100%;
height: 100%;
}
#bar {
width: 1000px;
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 large client-set minimum effective device width, no viewport, and content larger than the actual view width is scaled to fit the client-set minimum effective device width. To test manually, load the page and verify that the bar spans half the width of the page.");
addEventListener("load", async () => {
if (!window.testRunner)
return;
await UIHelper.setMinimumEffectiveWidth(1500);
await UIHelper.ensureVisibleContentRectUpdate();
minScale = (await UIHelper.minimumZoomScale()).toFixed(2);
expectedScale = (screen.width / 1500).toFixed(2);
shouldBe("minScale", "expectedScale");
shouldBecomeEqual("innerWidth", "1500", finishJSTest);
});
</script>
</head>
<body>
<div id="bar"></div>
<div id="description"></div>
</body>
</html>