| Index: third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html b/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b318f222dea61d0136b60b46c1e6174bac983c02
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html
|
| @@ -0,0 +1,39 @@
|
| +<!DOCTYPE html>
|
| +<style>
|
| + body {
|
| + height: 2000px;
|
| + width: 2000px;
|
| + }
|
| +</style>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +<script>
|
| + var browserZoomFactor = 1.25;
|
| + var pageScaleFactor = 2;
|
| + var scrollbarWidth = 15;
|
| + var scrollbarHeight = 15;
|
| +
|
| + function viewport() {
|
| + return document.visualViewport;
|
| + }
|
| +
|
| + async_test(function(t) {
|
| + window.onload = t.step_func(function() {
|
| + // TODO(ymalik): Remove hook to internals to pinch-zoom here and browser
|
| + // zoom below. This will be required to upstream to w3c repo.
|
| + internals.setPageScaleFactor(pageScaleFactor);
|
| +
|
| + // Verify viewport dimensions exclude scrollbar.
|
| + assert_equals(viewport().clientWidth, 800 / pageScaleFactor - scrollbarWidth);
|
| + assert_equals(viewport().clientHeight, 600 / pageScaleFactor - scrollbarHeight);
|
| +
|
| + // Apply browser zoom.
|
| + window.internals.setZoomFactor(browserZoomFactor);
|
| +
|
| + // Verify scrollbar exclusion with browser zoom.
|
| + assert_equals(viewport().clientWidth, 800 / pageScaleFactor / browserZoomFactor - scrollbarWidth);
|
| + assert_equals(viewport().clientHeight, 600 / pageScaleFactor / browserZoomFactor - scrollbarHeight);
|
| + t.done();
|
| + });
|
| + }, 'Verify viewport dimensions exclude scrollbars.');
|
| +</script>
|
|
|