tor-browser

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

test_group_touchevents-2.html (2962B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Various touch tests that spawn in new windows (2)</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 isWindows = getPlatform() == "windows";
     13 
     14 const shared_prefs = [
     15  ["apz.test.fails_with_native_injection", isWindows],
     16  ["dom.w3c_touch_events.legacy_apis.enabled", true],
     17 ];
     18 
     19 var subtests = [
     20  // Taps on media elements to make sure the touchend event is delivered
     21  // properly. We increase the long-tap timeout to ensure it doesn't get trip
     22  // during the tap.
     23  // Also this test (on Windows) cannot satisfy the OS requirement of providing
     24  // an injected touch event every 100ms, because it waits for a paint between
     25  // the touchstart and the touchend, so we have to use the "fake injection"
     26  // code instead.
     27  {"file": "helper_bug1162771.html", "prefs": [...shared_prefs,
     28                                               ["ui.click_hold_context_menus.delay", 10000]]},
     29 
     30  // As with the previous test, this test cannot inject touch events every 100ms
     31  // because it waits for a long-tap, so we have to use the "fake injection" code
     32  // instead.
     33  // This test also disables synthesized mousemoves from reflow so it can make
     34  // more precise assertions about the order in which events arrive.
     35  {"file": "helper_long_tap.html", "prefs": [...shared_prefs,
     36                                             ["layout.reflow.synthMouseMove", false]]},
     37 
     38  // For the following tests, we want to make sure APZ doesn't wait for a content
     39  // response that is never going to arrive. To detect this we set the content response
     40  // timeout to a day, so that the entire test times out and fails if APZ does
     41  // end up waiting.
     42  {"file": "helper_tap_passive.html", "prefs": [...shared_prefs,
     43                                                ["apz.content_response_timeout", 24 * 60 * 60 * 1000]]},
     44 
     45  {"file": "helper_tap_default_passive.html", "prefs": [...shared_prefs,
     46                                                        ["apz.content_response_timeout", 24 * 60 * 60 * 1000]]},
     47 
     48  // Add new subtests to test_group_touch_events-N.html (for largest N),
     49  // not this file.
     50 ];
     51 
     52 if (isApzEnabled()) {
     53  ok(window.TouchEvent, "Check if TouchEvent is supported (it should be, the test harness forces it on everywhere)");
     54  if (getPlatform() == "android") {
     55    // This has a lot of subtests, and Android emulators are slow.
     56    SimpleTest.requestLongerTimeout(2);
     57  }
     58 
     59  SimpleTest.waitForExplicitFinish();
     60  window.onload = function() {
     61    runSubtestsSeriallyInFreshWindows(subtests)
     62    .then(SimpleTest.finish, SimpleTest.finishWithFailure);
     63  };
     64 }
     65 
     66  </script>
     67 </head>
     68 <body>
     69 </body>
     70 </html>