chromium/third_party/blink/web_tests/external/wpt/css/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html

<!DOCTYPE html>
<html>
<head>
    <title>CSSOM View Module test:Screen-pixelDepth,Screen-colorDepth</title>
    <link rel="author" title="unbug" href="mailto:[email protected]" />
    <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <style type="text/css">
    </style>
</head>
<body>
    <p>This case tests the Screen pixelDepth and colorDepth</p>
    <p>The test passes if the value is either 24 or 30</p>
    <div id="log"></div>
    <script>
        test(function(){
            let colorDepth = testColorDepth();
            assert_true(colorDepth == 24 || colorDepth == 30, "Expected value for colorDepth is either 24 or 30");
        },'testColorDepth');
        test(function(){
            let pixelDepth = testPixelDepth();
            assert_true(pixelDepth == 24 || pixelDepth == 30, "Expected value for pixelDepth is either 24 or 30");
        },'testPixelDepth');
        function testColorDepth(){
            var  colorDepth = window.screen.colorDepth;
            return colorDepth;
        }
        function testPixelDepth(){
            var  pixelDepth = window.screen.pixelDepth;
            return pixelDepth;
        }
    </script>
</body>
</html>