blob: a1287729d902e58b8c44f99f45ccbb617252a651 [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#square {
position: absolute;
width: 10vw;
height: 10vh;
border: 2px solid black;
}
#output {
width: 100%;
height: 100%;
overflow: scroll;
}
body {
margin: 0;
width: 100%;
height: 100%;
}
</style>
<script src="../../../resources/ui-helper.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
async function runTest() {
const appendOutput = message => {
output.appendChild(document.createTextNode(message));
output.appendChild(document.createElement("br"));
};
for (let targetScale of [0.5, 0.75, 1, 1.25, 1.5, 1.25, 1, 0.75, 0.5]) {
appendOutput(`setViewScale(${targetScale.toFixed(2)})`);
await UIHelper.setViewScale(targetScale);
await UIHelper.ensurePresentationUpdate();
appendOutput(`window size: [${innerWidth}, ${innerHeight}]`);
appendOutput(`square size: [${square.clientWidth}, ${square.clientHeight}]`);
appendOutput(`zoom scale: ${(await UIHelper.zoomScale()).toFixed(2)}`);
appendOutput("");
}
testRunner.notifyDone();
}
</script>
</head>
<body onload="runTest()">
<div id="square"></div>
<pre id="output"></pre>
</body>
</html>