Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /css/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html - WPT Dashboard Interop Dashboard
 
 
<!DOCTYPE html>
<html>
<head>
    <title>CSSOM View Module test:Screen-pixelDepth,Screen-colorDepth</title>
    <link rel="author" title="unbug" href="mailto:tidelgl@gmail.com" />
    <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>