Make UIScriptController::zoomToScale() work on Mac WK1 and WK2
[WebKit-https.git] / LayoutTests / fast / zooming / uiscript-zooming.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5     <style>
6         body {
7             height: 2000px;
8             width: 2000px;
9         }
10     </style>
11     <script src="../../resources/js-test-pre.js"></script>
12     <script>
13         description("Test that uiController.zoomToScale() works.");
14
15         window.jsTestIsAsync = true;
16
17         function doAfterZooming()
18         {
19             shouldBe('internals.pageScaleFactor()', '2');
20             finishJSTest();
21         }
22         
23         function getUIScript()
24         {
25             return `(function() {
26                 uiController.zoomToScale(2, function() {
27                     uiController.uiScriptComplete(uiController.zoomScale);
28                 });
29             })();`;
30         }
31
32         function doTest()
33         {
34             if (window.testRunner)
35                 testRunner.runUIScript(getUIScript(), function(zoomScale) {
36                     doAfterZooming();
37                 })
38         }
39         
40         window.addEventListener('load', doTest, false);
41     </script>
42 </head>
43 <body>
44     <script src="../../resources/js-test-post.js"></script>
45 </body>
46 </html>