Bug 1161634 - Enable the test_wheel_scroll on Linux as well. r=mstange
☠☠ backed out by 5eb58823f834 ☠ ☠
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 06 May 2015 08:36:54 -0400
changeset 272444 7141b7088a8933bfaaefd9e46318ed4ebb2dd021
parent 272443 18474e89292a4305c99ad9f8665d43db014306fe
child 272445 61bd6e2c6e723fa9eb5fc5a6f1b4fe6a0de88032
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1161634
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1161634 - Enable the test_wheel_scroll on Linux as well. r=mstange
gfx/layers/apz/test/apz_test_native_event_utils.js
gfx/layers/apz/test/mochitest.ini
gfx/layers/apz/test/test_wheel_scroll.html
--- a/gfx/layers/apz/test/apz_test_native_event_utils.js
+++ b/gfx/layers/apz/test/apz_test_native_event_utils.js
@@ -12,24 +12,26 @@ function getPlatform() {
   }
   return "unknown";
 }
 
 function nativeVerticalWheelEventMsg() {
   switch (getPlatform()) {
     case "windows": return 0x020A; // WM_MOUSEWHEEL
     case "mac": return 0; // value is unused, can be anything
+    case "linux": return 4; // value is unused, pass GDK_SCROLL_SMOOTH anyway
   }
   throw "Native wheel events not supported on platform " + getPlatform();
 }
 
 function nativeHorizontalWheelEventMsg() {
   switch (getPlatform()) {
     case "windows": return 0x020E; // WM_MOUSEHWHEEL
     case "mac": return 0; // value is unused, can be anything
+    case "linux": return 4; // value is unused, pass GDK_SCROLL_SMOOTH anyway
   }
   throw "Native wheel events not supported on platform " + getPlatform();
 }
 
 // Synthesizes a native mousewheel event and returns immediately. This does not
 // guarantee anything; you probably want to use one of the other functions below
 // which actually wait for results.
 // aX and aY are relative to |window|'s top-left. aDeltaX and aDeltaY
--- a/gfx/layers/apz/test/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest.ini
@@ -5,9 +5,9 @@ support-files =
   helper_bug982141.html
   helper_bug1151663.html
 tags = apz
 [test_bug982141.html]
 skip-if = toolkit != 'gonk'  # bug 991198
 [test_bug1151663.html]
 skip-if = toolkit != 'gonk'  # bug 991198
 [test_wheel_scroll.html]
-skip-if = toolkit != 'windows' && toolkit != 'cocoa'
+skip-if = (os == 'android') || (os == 'b2g') # wheel events not supported
--- a/gfx/layers/apz/test/test_wheel_scroll.html
+++ b/gfx/layers/apz/test/test_wheel_scroll.html
@@ -94,16 +94,23 @@ function continueTest() {
   var ret = gTestContinuation.next();
   if (ret.done) {
     SimpleTest.finish();
   } else {
     is(ret.value, true, "Wheel event successfully synthesized");
   }
 }
 
+function startTest() {
+  // If we allow smooth scrolling the "smooth" scrolling may cause the page to
+  // glide past the scrollbox (which is supposed to stop the scrolling) and so
+  // we might end up at the bottom of the page.
+  SpecialPowers.pushPrefEnv({"set": [["general.smoothScroll", false]]}, continueTest);
+}
+
 SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(continueTest, window);
+SimpleTest.waitForFocus(startTest, window);
 
 </script>
 </pre>
 
 </body>
 </html>