Bug 1219980 - Ensure that long-press gestures don't get detected during test_basic_pan.html r?botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 01 Mar 2016 16:45:08 -0500
changeset 335888 d886b48be9d534d97fb7037f6a32d3a4133ef130
parent 335409 9da51cb4974e03cdd8fa45a34086fe1033abfeaf
child 515251 5f8a1c3a39537b358252275353186221e62b2f39
push id11915
push userkgupta@mozilla.com
push dateTue, 01 Mar 2016 21:45:34 +0000
reviewersbotond
bugs1219980
milestone47.0a1
Bug 1219980 - Ensure that long-press gestures don't get detected during test_basic_pan.html r?botond Chaos mode can cause the the long-press timer to fire too early, so we have to disable that. Also the pref to extend the timer is an int pref, not a char pref, so drop the quotes (otherwise specialpowersAPI.js guesses the wrong type). MozReview-Commit-ID: 4NefSNwwcht
gfx/layers/apz/test/mochitest/test_basic_pan.html
--- a/gfx/layers/apz/test/mochitest/test_basic_pan.html
+++ b/gfx/layers/apz/test/mochitest/test_basic_pan.html
@@ -3,17 +3,16 @@
 <head>
   <meta charset="utf-8">
   <title>Sanity panning test</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
 
 SimpleTest.waitForExplicitFinish();
-SimpleTest.testInChaosMode();
 
 // this page just serially loads each one of the following test helper pages in
 // a new window and waits for it to call testDone()
 var tests = [
   'helper_basic_pan.html',
   'helper_div_pan.html',
   'helper_iframe_pan.html',
 ];
@@ -48,18 +47,20 @@ window.onload = function() {
     { "set":
       [
         // Dropping the touch slop to 0 makes the tests easier to write because
         // we can just do a one-pixel drag to get over the pan threshold rather
         // than having to hard-code some larger value.
         ["apz.touch_start_tolerance", "0.0"],
         // The touchstart from the drag can turn into a long-tap if the touch-move
         // events get held up. Try to prevent that by making long-taps require
-        // a 10 second hold.
-        ["ui.click_hold_context_menus.delay", "10000"],
+        // a 10 second hold. Note that we also cannot enable chaos mode on this
+        // test for this reason, since chaos mode can cause the long-press timer
+        // to fire sooner than the pref dictates.
+        ["ui.click_hold_context_menus.delay", 10000],
         // The subtests in this test do touch-drags to pan the page, but we don't
         // want those pans to turn into fling animations, so we increase the
         // fling-stop threshold velocity to absurdly high.
         ["apz.fling_stopped_threshold", "10000"],
       ]
     }, testDone);
 };