chromium/third_party/blink/web_tests/fast/overflow/scrollbar-restored-and-then-locked.html

<body>
    <p>
        Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=29431">bug 29431</a>
        [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
    </p>
    <p> This test ensures the correctness of two scrollbar behaviour:</p>
    <ul>
        <li> This tests that after setting 'overflow' on the document element to
            'hidden' and back to 'visible', scrollbars appear as necessary.
        </li>
        <li>
            After explicitly setting a scrollbar policy different than 'auto', WebCore
            honors that until it is unset.
        </li>
    </ul>
    <div id="dynamic"></div>
    <p id="result">FAIL: Test did not run to completion</p>
    <script>
        if (window.testRunner)
            testRunner.dumpAsText();

        document.documentElement.style.overflow = "hidden";
        document.body.offsetTop;
        document.documentElement.style.removeProperty("overflow");
        document.body.style.height = "200%";
        var result = (innerWidth === document.documentElement.offsetWidth)
            ? "FAIL: Scrollbar did not appear after resetting 'overflow'"
            : "PASS";

        if (window.testRunner) {
            testRunner.setScrollbarPolicy('vertical', 'off');
            testRunner.setScrollbarPolicy('horizontal', 'off');

            result += (innerWidth === document.documentElement.offsetWidth)
                ? "\nPASS"
                : "\nFAIL: Scrollbar did appear after turning it off";
        }

        document.getElementById("result").innerText = result;
    </script>
</body>