tor-browser

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

test_group_zoom-2.html (3687B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Various zoom-related tests that spawn in new windows</title>
      6  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      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  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10  <script type="application/javascript">
     11 
     12 var prefs = [
     13  // We need the APZ paint logging information
     14  ["apz.test.logging_enabled", true],
     15  // Dropping the touch slop to 0 makes the tests easier to write because
     16  // we can just do a one-pixel drag to get over the pan threshold rather
     17  // than having to hard-code some larger value.
     18  ["apz.touch_start_tolerance", "0.0"],
     19  // The subtests in this test do touch-drags to pan the page, but we don't
     20  // want those pans to turn into fling animations, so we increase the
     21  // fling-min threshold velocity to an arbitrarily large value.
     22  ["apz.fling_min_velocity_threshold", "10000"],
     23  // The helper_bug1280013's div gets a displayport on scroll, but if the
     24  // test takes too long the displayport can expire before we read the value
     25  // out of the test. So we disable displayport expiry for these tests.
     26  ["apz.displayport_expiry_ms", 0],
     27  // Increase the content response timeout because some tests do preventDefault
     28  // and we want to make sure APZ actually waits for them.
     29  ["apz.content_response_timeout", 60000],
     30  // Force consistent scroll-to-click behaviour across all platforms.
     31  ["ui.scrollToClick", 0],
     32  // Disable touch resampling so that touch events are processed without delay
     33  // and we don't zoom more than expected due to overprediction.
     34  ["android.touch_resampling.enabled", false],
     35 ];
     36 
     37 var instant_repaint_prefs = [
     38  // When zooming, trigger repaint requests for each scale event rather than
     39  // delaying the repaints
     40  ["apz.scale_repaint_delay_ms", 0],
     41  ... prefs
     42 ];
     43 
     44 var subtests = [
     45  {"file": "helper_bug1280013.html", "prefs": prefs},
     46  {"file": "helper_zoom_restore_position_tabswitch.html", "prefs": prefs},
     47  {"file": "helper_zoom_with_dynamic_toolbar.html", "prefs": prefs},
     48  {"file": "helper_visual_scrollbars_pagescroll.html", "prefs": prefs},
     49  {"file": "helper_click_interrupt_animation.html",
     50   "prefs": [...prefs, ["layout.disable-pixel-alignment", true]]},
     51  {"file": "helper_overflowhidden_zoom.html", "prefs": prefs},
     52  {"file": "helper_zoom_keyboardscroll.html", "prefs": prefs},
     53  {"file": "helper_zoom_out_clamped_scrollpos.html", "prefs": instant_repaint_prefs},
     54  {"file": "helper_zoom_out_with_mainthread_clamping.html", "prefs": instant_repaint_prefs},
     55  {"file": "helper_fixed_html_hittest.html", "prefs": prefs},
     56  // {"file": "helper_zoom_oopif.html", "prefs": prefs}, // disabled, see bug 1716127
     57  {"file": "helper_zoom_after_gpu_process_restart.html", "prefs": prefs},
     58  {"file": "helper_zoom_when_disabled_by_touch_action.html", "prefs": [...prefs, ["browser.ui.zoom.force-user-scalable", true]]}
     59 ];
     60 
     61 if (isApzEnabled()) {
     62  // This has a lot of subtests, and Android emulators are slow.
     63  SimpleTest.requestLongerTimeout(2);
     64  SimpleTest.waitForExplicitFinish();
     65 
     66  if (getPlatform() == "linux") {
     67        subtests.push(
     68          {"file": "helper_zoom_with_touchpad.html", "prefs": prefs},
     69          {"file": "helper_touchpad_pinch_and_pan.html", "prefs": prefs},
     70          {"file": "helper_zoom_oopif.html?touchpad", "prefs": prefs},
     71        );
     72  }
     73  window.onload = function() {
     74    runSubtestsSeriallyInFreshWindows(subtests)
     75    .then(SimpleTest.finish, SimpleTest.finishWithFailure);
     76  };
     77 }
     78 
     79  </script>
     80 </head>
     81 <body>
     82 </body>
     83 </html>