Bug 1251608 - Fix and enable test_bug1151663 for all platforms. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Sat, 05 Mar 2016 19:22:28 -0500
changeset 286963 954f09e238ca46720842b522272213b9b58998b5
parent 286962 b592bfa4541d1a1ca9b2121d863d7a6263cf1332
child 286964 8fd2d0f7ce4939c2119e6168e6203f87dfc8ef32
push id18025
push userryanvm@gmail.com
push dateSun, 06 Mar 2016 20:04:05 +0000
treeherderfx-team@b6acf4d4fc20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1251608, 1151663
milestone47.0a1
Bug 1251608 - Fix and enable test_bug1151663 for all platforms. r=botond MozReview-Commit-ID: 4fr5XIor6mJ
gfx/layers/apz/test/mochitest/helper_bug1151663.html
gfx/layers/apz/test/mochitest/mochitest.ini
gfx/layers/apz/test/mochitest/test_bug1151663.html
--- a/gfx/layers/apz/test/mochitest/helper_bug1151663.html
+++ b/gfx/layers/apz/test/mochitest/helper_bug1151663.html
@@ -50,25 +50,27 @@ https://bugzilla.mozilla.org/show_bug.cg
       SimpleTest.ok(compositorTestData.paints.length > 0,
                     "expected at least one paint in compositor test data");
       var lastCompositorPaint = compositorTestData.paints[compositorTestData.paints.length - 1];
       var lastCompositorPaintSeqNo = lastCompositorPaint.sequenceNumber;
 
       // Convert the test data into a representation that's easier to navigate.
       contentTestData = convertTestData(contentTestData);
       compositorTestData = convertTestData(compositorTestData);
+      var paint = compositorTestData.paints[lastCompositorPaintSeqNo];
 
       // Reconstruct the APZC tree structure in the last paint.
-      var apzcTree = buildApzcTree(compositorTestData.paints[lastCompositorPaintSeqNo]);
+      var apzcTree = buildApzcTree(paint);
 
       // The apzc tree for this page should consist of a single root APZC,
-      // and no child APZCs.
-      SimpleTest.is(apzcTree.children.length, 1, "expected a single root APZC");
-      var rootApzc = apzcTree.children[0];
-      SimpleTest.is(rootApzc.children.length, 0, "expected no child APZCs");
+      // which either is the RCD with no child APZCs (e10s/B2G case) or has a
+      // single child APZC which is for the RCD (fennec case).
+      var rcd = findRcdNode(apzcTree);
+      SimpleTest.ok(rcd != null, "found the RCD node");
+      SimpleTest.is(rcd.children.length, 0, "expected no children on the RCD");
 
       window.opener.finishTest();
     }
   </script>
 </head>
 <body style="height: 500px; overflow: scroll">
   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151663">Mozilla Bug 1151663</a>
   <div style="height: 50px; width: 50px; overflow: scroll">
--- a/gfx/layers/apz/test/mochitest/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest/mochitest.ini
@@ -9,17 +9,16 @@ support-files =
   helper_subframe_style.css
   helper_basic_pan.html
   helper_div_pan.html
   helper_iframe_pan.html
   helper_tap.html
 tags = apz
 [test_bug982141.html]
 [test_bug1151663.html]
-skip-if = toolkit != 'gonk'  # bug 991198
 [test_wheel_scroll.html]
 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
--- a/gfx/layers/apz/test/mochitest/test_bug1151663.html
+++ b/gfx/layers/apz/test/mochitest/test_bug1151663.html
@@ -12,16 +12,21 @@ https://bugzilla.mozilla.org/show_bug.cg
 
     SimpleTest.waitForExplicitFinish();
 
     // Run the actual test in its own window, because it requires that the
     // root APZC be scrollable. Mochitest pages themselves often run
     // inside an iframe which means we have no control over the root APZC.
     var w = null;
     window.onload = function() {
+      if (!SpecialPowers.getDOMWindowUtils(window).asyncPanZoomEnabled) {
+        ok(true, "APZ is not enabled, this test is not relevant, sorry!\n");
+        SimpleTest.finish();
+        return;
+      }
       SpecialPowers.pushPrefEnv({"set": [["apz.test.logging_enabled", true]]}, function() {
         w = window.open("helper_bug1151663.html", "_blank");
       });
     };
 
     function finishTest() {
       w.close();
       SimpleTest.finish();