tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

helper_zoom_with_dynamic_toolbar.html (1207B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=device-width">
      6  <title>Zooming out to the initial scale with the dynamic toolbar</title>
      7  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
      8  <script type="application/javascript" src="apz_test_utils.js"></script>
      9  <script src="/tests/SimpleTest/paint_listener.js"></script>
     10  <script src="/tests/SimpleTest/EventUtils.js"></script>
     11 
     12  <style>
     13    html,body {
     14      height: 100%;
     15      margin: 0;
     16      padding: 0;
     17    }
     18  </style>
     19 
     20  <script type="application/javascript">
     21 
     22 async function test() {
     23  ok(window.visualViewport.scale > 1.0,
     24     "The scale value should be greater than 1.0");
     25 
     26  // Do a pinch-zoom out to restore the initial scale.
     27  await pinchZoomOutWithTouchAtCenter();
     28  await promiseApzFlushedRepaints();
     29 
     30  is(visualViewport.scale, 1.0,
     31     "The initial scale value should be restored to 1.0");
     32 }
     33 
     34 SpecialPowers.getDOMWindowUtils(window).setDynamicToolbarMaxHeight(100);
     35 SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(1.1)
     36 
     37 waitUntilApzStable()
     38 .then(test)
     39 .then(subtestDone, subtestFailed);
     40 
     41  </script>
     42 </head>
     43 <body>
     44 </body>
     45 </html>