Back out changeset 027c6cc12078 (bug 1249943) for making test_basic_pan.html permafail (timeout) on Linux, on a CLOSED TREE.
authorL. David Baron <dbaron@dbaron.org>
Wed, 24 Feb 2016 15:57:29 -0800
changeset 321810 611823f79eb548fd9d14c7c73483c030561c98f5
parent 321809 1f9dc51c14938a3df662e80506cf80210e3422c0
child 321811 4f03658208cc64bc1c1195804933c0ada4e4aec5
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1249943
milestone47.0a1
backs out027c6cc120785f7235a1c62050aa98a0b304f2c3
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
Back out changeset 027c6cc12078 (bug 1249943) for making test_basic_pan.html permafail (timeout) on Linux, on a CLOSED TREE.
dom/ipc/TabChild.cpp
gfx/layers/apz/test/mochitest/helper_basic_pan.html
gfx/layers/apz/test/mochitest/helper_div_pan.html
gfx/layers/apz/test/mochitest/helper_iframe_pan.html
gfx/layers/apz/test/mochitest/mochitest.ini
gfx/layers/apz/test/mochitest/test_basic_pan.html
widget/android/AndroidContentController.cpp
widget/android/AndroidContentController.h
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1747,18 +1747,19 @@ bool
 TabChild::NotifyAPZStateChange(const ViewID& aViewId,
                                const layers::GeckoContentController::APZStateChange& aChange,
                                const int& aArg)
 {
   mAPZEventState->ProcessAPZStateChange(GetDocument(), aViewId, aChange, aArg);
   if (aChange == layers::GeckoContentController::APZStateChange::TransformEnd) {
     // This is used by tests to determine when the APZ is done doing whatever
     // it's doing. XXX generify this as needed when writing additional tests.
-    nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
-    observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
+    DispatchMessageManagerMessage(
+      NS_LITERAL_STRING("APZ:TransformEnd"),
+      NS_LITERAL_STRING("{}"));
   }
   return true;
 }
 
 void
 TabChild::StartScrollbarDrag(const layers::AsyncDragMetrics& aDragMetrics)
 {
   if (mAPZChild) {
--- a/gfx/layers/apz/test/mochitest/helper_basic_pan.html
+++ b/gfx/layers/apz/test/mochitest/helper_basic_pan.html
@@ -5,22 +5,20 @@
   <meta name="viewport" content="width=device-width; initial-scale=1.0">
   <title>Sanity panning test</title>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
   <script type="application/javascript">
 
 function scrollPage() {
-  var transformEnd = function() {
-    SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd", false);
+  SpecialPowers._addMessageListener("APZ:TransformEnd", function() {
     dump("Transform complete; flushing repaints...\n");
     flushApzRepaints(checkScroll);
-  };
-  SpecialPowers.Services.obs.addObserver(transformEnd, "APZ:TransformEnd", false);
+  });
 
   const TOUCH_SLOP = 1;
   synthesizeNativeDrag(document.body, 10, 100, 0, -(50 + TOUCH_SLOP));
   dump("Finished native drag, waiting for transform-end observer...\n");
 }
 
 function checkScroll() {
   window.opener.is(window.scrollY, 50, "check that the window scrolled");
--- a/gfx/layers/apz/test/mochitest/helper_div_pan.html
+++ b/gfx/layers/apz/test/mochitest/helper_div_pan.html
@@ -5,22 +5,20 @@
   <meta name="viewport" content="width=device-width; initial-scale=1.0">
   <title>Sanity panning test for scrollable div</title>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
   <script type="application/javascript">
 
 function scrollOuter() {
-  var transformEnd = function() {
-    SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd", false);
+  SpecialPowers._addMessageListener("APZ:TransformEnd", function() {
     dump("Transform complete; flushing repaints...\n");
     flushApzRepaints(checkScroll);
-  };
-  SpecialPowers.Services.obs.addObserver(transformEnd, "APZ:TransformEnd", false);
+  });
 
   const TOUCH_SLOP = 1;
   synthesizeNativeDrag(document.getElementById('outer'), 10, 100, 0, -(50 + TOUCH_SLOP));
   dump("Finished native drag, waiting for transform-end observer...\n");
 }
 
 function checkScroll() {
   var outerScroll = document.getElementById('outer').scrollTop;
--- a/gfx/layers/apz/test/mochitest/helper_iframe_pan.html
+++ b/gfx/layers/apz/test/mochitest/helper_iframe_pan.html
@@ -6,22 +6,20 @@
   <title>Sanity panning test for scrollable div</title>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
   <script type="application/javascript">
 
 function scrollOuter() {
   var outer = document.getElementById('outer');
-  var transformEnd = function() {
-    SpecialPowers.Services.obs.removeObserver(transformEnd, "APZ:TransformEnd", false);
+  SpecialPowers._addMessageListener("APZ:TransformEnd", function() {
     dump("Transform complete; flushing repaints...\n");
     flushApzRepaints(checkScroll, outer.contentWindow);
-  };
-  SpecialPowers.Services.obs.addObserver(transformEnd, "APZ:TransformEnd", false);
+  });
 
   const TOUCH_SLOP = 1;
   synthesizeNativeDrag(outer.contentDocument.body, 10, 100, 0, -(50 + TOUCH_SLOP));
   dump("Finished native drag, waiting for transform-end observer...\n");
 }
 
 function checkScroll() {
   var outerScroll = document.getElementById('outer').contentWindow.scrollY;
--- a/gfx/layers/apz/test/mochitest/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest/mochitest.ini
@@ -20,19 +20,17 @@ skip-if = toolkit != 'gonk'  # bug 99119
 skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet
 [test_wheel_transactions.html]
 skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet
 [test_bug1151667.html]
 skip-if = (os == 'android') || (os == 'b2g') # wheel events not supported on mobile
 [test_layerization.html]
 skip-if = (os == 'android') || (os == 'b2g') # uses wheel events which are not supported on mobile
 [test_basic_pan.html]
-# Windows touch injection doesn't work in automation, but this test can be run locally on a windows touch device.
-# On OS X we don't support touch events at all.
-skip-if = (toolkit == 'windows') || (toolkit == 'cocoa')
+skip-if = toolkit != 'gonk'
 [test_scroll_inactive_flattened_frame.html]
 skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet
 [test_scroll_inactive_bug1190112.html]
 skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet
 [test_scroll_subframe_scrollbar.html]
 skip-if = (os == 'android') || (os == 'b2g') || (buildapp == 'mulet') # wheel events not supported on mobile; see bug 1164274 for mulet
 [test_frame_reconstruction.html]
 [test_tap.html]
--- a/gfx/layers/apz/test/mochitest/test_basic_pan.html
+++ b/gfx/layers/apz/test/mochitest/test_basic_pan.html
@@ -40,20 +40,16 @@ window.onload = function() {
         // 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"],
-        // 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);
 };
 
   </script>
 </head>
 <body>
 </body>
--- a/widget/android/AndroidContentController.cpp
+++ b/widget/android/AndroidContentController.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AndroidContentController.h"
 
 #include "AndroidBridge.h"
 #include "base/message_loop.h"
 #include "mozilla/layers/APZCCallbackHelper.h"
 #include "mozilla/layers/APZCTreeManager.h"
-#include "nsIObserverService.h"
 #include "nsLayoutUtils.h"
 #include "nsWindow.h"
 
 using mozilla::layers::APZCTreeManager;
 
 namespace mozilla {
 namespace widget {
 
@@ -94,28 +93,10 @@ AndroidContentController::UpdateOverscro
 void
 AndroidContentController::UpdateOverscrollOffset(const float aX,const  float aY)
 {
   if (mAndroidWindow) {
     mAndroidWindow->UpdateOverscrollOffset(aX, aY);
   }
 }
 
-void
-AndroidContentController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
-                                               APZStateChange aChange,
-                                               int aArg)
-{
-  // This function may get invoked twice, if the first invocation is not on
-  // the main thread then the ChromeProcessController version of this function
-  // will redispatch to the main thread. We want to make sure that our handling
-  // only happens on the main thread.
-  ChromeProcessController::NotifyAPZStateChange(aGuid, aChange, aArg);
-  if (NS_IsMainThread() && aChange == layers::GeckoContentController::APZStateChange::TransformEnd) {
-    // This is used by tests to determine when the APZ is done doing whatever
-    // it's doing. XXX generify this as needed when writing additional tests.
-    nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
-    observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
-  }
-}
-
 } // namespace widget
 } // namespace mozilla
--- a/widget/android/AndroidContentController.h
+++ b/widget/android/AndroidContentController.h
@@ -35,19 +35,16 @@ public:
     // ChromeProcessController methods
     virtual void Destroy() override;
     void HandleSingleTap(const CSSPoint& aPoint,
                          Modifiers aModifiers,
                          const ScrollableLayerGuid& aGuid) override;
     void PostDelayedTask(Task* aTask, int aDelayMs) override;
     void UpdateOverscrollVelocity(const float aX, const float aY) override;
     void UpdateOverscrollOffset(const float aX,const  float aY) override;
-    void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
-                              APZStateChange aChange,
-                              int aArg) override;
 
     static void NotifyDefaultPrevented(mozilla::layers::APZCTreeManager* aManager,
                                        uint64_t aInputBlockId, bool aDefaultPrevented);
 private:
     nsWindow* mAndroidWindow;
 };
 
 } // namespace widget