chromium/third_party/blink/web_tests/fast/dom/inner-width-height.html

<html>
<head>
    <script>
        function debug(str) {
            pre = document.getElementById('console');
            pre.appendChild(document.createTextNode(str + '\n'));
        }
    
        function runTests() {
            if (window.testRunner)
                testRunner.dumpAsText();

            var width = window.innerWidth;
            var height = window.innerHeight;
            
            // Now force scroll bars. innerWidth and innerHeight should not take the scroll bar into account
            document.body.style.overflow = 'scroll';
            document.body.offsetTop;
            
            if (width != window.innerWidth || height != window.innerHeight) {
                debug("FAILURE!")
                return;
            }
                
            debug("SUCCESS!");
        }
    </script>
</head>
<body onload="runTests()">
    This tests that window.innerWidth/innerHeight does not include the size of the scrollbars.
    <pre id="console"></pre>
</body>
</html>