https://github.com/web-platform-tests/wpt
Raw File
Tip revision: bf21aa6a53367f9ad69c1f8c78d66c20270bbeaf authored by Andrea Marchesini on 04 April 2018, 17:43:55 UTC
setTimeout/setInterval should silently fail if the worker is shutting down,
Tip revision: bf21aa6
viewport-type.html
<!doctype html>
<html>
    <head>
        <title>Viewport: window.visualViewport type</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <script src="/resources/testharness.js"></script>
        <script src="/resources/testharnessreport.js"></script>
    </head>
    <body>
    <h1>Viewport: window.visualViewport type</h1>
    <h4>Test Description: This test checks that window.visualViewport is an object of type VisualViewport.</h4>
    <script>
        test(function() {
              assert_equals(typeof(window.visualViewport), "object");
            }, "window.visualViewport is an object");

        test(function() {
              assert_equals(window.visualViewport.toString(), "[object VisualViewport]");
            }, "window.visualViewport has type `VisualViewport`");

        addEventListener("load", function() {
            document.getElementById("viewtype-log").innerText = typeof(window.visualViewport);
        });
    </script>
    <div id="complete-notice">
        <p>window.visualViewport is of type: <span id="viewtype-log"></span>.</p>
    </div>
    <div id="log"></div>
    </body>
</html>
back to top