From deaa78a29f6fe54196687416c3c2516ffbb72343 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 4 Sep 2015 17:18:11 -0700 Subject: [PATCH] Add a test case for bug 1193557, r=kats. --- gfx/layers/apz/test/mochitest.ini | 2 + .../test_scroll_inactive_flattened_frame.html | 50 +++++++++++++++++++ .../mochitest/tests/SimpleTest/EventUtils.js | 16 ++++-- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 gfx/layers/apz/test/test_scroll_inactive_flattened_frame.html diff --git a/gfx/layers/apz/test/mochitest.ini b/gfx/layers/apz/test/mochitest.ini index e9ac901f2e5..6af4a619b3c 100644 --- a/gfx/layers/apz/test/mochitest.ini +++ b/gfx/layers/apz/test/mochitest.ini @@ -25,3 +25,5 @@ skip-if = (os == 'android') || (os == 'b2g') # wheel events not supported on mob skip-if = (os == 'android') || (os == 'b2g') # uses wheel events which are not supported on mobile [test_basic_pan.html] 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 diff --git a/gfx/layers/apz/test/test_scroll_inactive_flattened_frame.html b/gfx/layers/apz/test/test_scroll_inactive_flattened_frame.html new file mode 100644 index 00000000000..464e92bd677 --- /dev/null +++ b/gfx/layers/apz/test/test_scroll_inactive_flattened_frame.html @@ -0,0 +1,50 @@ + + + + Test scrolling flattened inactive frames + + + + + + +
+
+
+
+
+
+ + + diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js index 206af6a57f3..b8b2bd98de7 100644 --- a/testing/mochitest/tests/SimpleTest/EventUtils.js +++ b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -523,10 +523,18 @@ function sendWheelAndPaint(aTarget, aOffsetX, aOffsetY, aEvent, aCallback, aWind if (!aCallback) return; - aWindow.waitForAllPaintsFlushed(function() { - utils.restoreNormalRefresh(); - aCallback(); - }); + var waitForPaints = function () { + SpecialPowers.Services.obs.removeObserver(waitForPaints, "apz-repaints-flushed", false); + aWindow.waitForAllPaintsFlushed(function() { + utils.restoreNormalRefresh(); + aCallback(); + }); + } + + SpecialPowers.Services.obs.addObserver(waitForPaints, "apz-repaints-flushed", false); + if (!utils.flushApzRepaints(aWindow)) { + waitForPaints(); + } }, 0); };