| <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> |
| |
| <html> |
| <head> |
| <meta name="viewport" content="initial-scale=1, viewport-fit=auto"> |
| <script src="resources/viewport-test-utils.js"></script> |
| <script> |
| function getSafeAreaUIScript() |
| { |
| return ` |
| (function() { |
| uiController.setSafeAreaInsets(10, 20, 30, 40); |
| uiController.doAfterVisibleContentRectUpdate(function () { |
| uiController.uiScriptComplete(); |
| }) |
| })();` |
| } |
| |
| function doTest() |
| { |
| testRunner.runUIScript(getSafeAreaUIScript(), function(result) { |
| document.getElementById('windowSize').textContent = window.innerWidth + " x " + window.innerHeight; |
| runTest(); |
| }); |
| } |
| window.addEventListener('load', doTest, false); |
| </script> |
| </head> |
| |
| <body> |
| <p>Viewport: <span id="viewport"></span></p> |
| <p>Window Size: <span id="windowSize"></span></p> |
| <div id="result"></div> |
| </body> |
| </html> |