| <!DOCTYPE html> <!-- webkit-test-runner [ shouldIgnoreMetaViewport=true ] --> |
| <html> |
| <head> |
| <meta name="viewport" content="width=1000"> |
| <style> |
| body, html { |
| margin: 0; |
| } |
| |
| #bar { |
| width: 100%; |
| height: 100px; |
| background: linear-gradient(to right, red 0%, green 50%, blue 100%); |
| } |
| |
| #description { |
| width: 300px; |
| overflow: scroll; |
| } |
| </style> |
| <script src="../../../resources/ui-helper.js"></script> |
| <script src="../../../resources/js-test.js"></script> |
| <script> |
| jsTestIsAsync = true; |
| |
| description("This test verifies that a page with a constant width viewport smaller than the actual view width is scaled to fit the view. To test manually, load the page and verify that the bar spans the full width of the page."); |
| |
| addEventListener("load", async () => { |
| if (!window.testRunner) |
| return; |
| |
| await UIHelper.ensurePresentationUpdate(); |
| minScale = (await UIHelper.minimumZoomScale()).toFixed(2); |
| expectedScale = (screen.width / 1000).toFixed(2); |
| shouldBe("minScale", "expectedScale"); |
| shouldBe("innerWidth", "1000"); |
| finishJSTest(); |
| }); |
| </script> |
| </head> |
| <body> |
| <div id="bar"></div> |
| <div id="description"></div> |
| </body> |
| </html> |