Bug 1277814 - APZ mochitest for scroll frame with transform that results in a cumulative resolution of zero. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 08 Jun 2016 19:17:57 -0400
changeset 301527 488f4386606b4a6473df70fb3aa218e0778bbcb2
parent 301526 c3d167fbd0e460d6d6d92e0746fe6d20de2755e1
child 301528 2e076bb03ff4458d2c6201bf17580573def0a8fc
push id78352
push userbballo@mozilla.com
push dateFri, 10 Jun 2016 20:07:24 +0000
treeherdermozilla-inbound@488f4386606b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1277814
milestone50.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 1277814 - APZ mochitest for scroll frame with transform that results in a cumulative resolution of zero. r=kats MozReview-Commit-ID: J6ueE23YqC
gfx/layers/apz/test/mochitest/mochitest.ini
gfx/layers/apz/test/mochitest/test_bug1277814.html
--- a/gfx/layers/apz/test/mochitest/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest/mochitest.ini
@@ -20,16 +20,17 @@ support-files =
   helper_bug1271432.html
   helper_touch_action.html
   helper_touch_action_regions.html
   helper_scroll_inactive_perspective.html
   helper_scroll_inactive_zindex.html
 tags = apz
 [test_bug982141.html]
 [test_bug1151663.html]
+[test_bug1277814.html]
 [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
new file mode 100644
--- /dev/null
+++ b/gfx/layers/apz/test/mochitest/test_bug1277814.html
@@ -0,0 +1,94 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1277814
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1277814</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
+  <script type="application/javascript" src="apz_test_utils.js"></script>
+  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript">
+    function* test(testDriver) {
+      // Trigger the buggy scenario
+      var subframe = document.getElementById('bug1277814-div');
+      subframe.classList.add('a');
+
+      // Trigger layerization of the subframe by scrolling the wheel over it
+      moveMouseAndScrollWheelOver(subframe, 10, 10, testDriver);
+
+      // Give APZ the chance to compute a displayport, and content
+      // to render based on it.
+      yield waitForApzFlushedRepaints(testDriver);
+
+      // Examine the content-side APZ test data
+      var utils = SpecialPowers.getDOMWindowUtils(window);
+      var contentTestData = utils.getContentAPZTestData();
+
+      // Test that the scroll frame for the div 'bug1277814-div' appears in
+      // the APZ test data. The bug this test is for causes the displayport
+      // calculation for this scroll frame to go wrong, causing it not to
+      // become layerized.
+      contentTestData = convertTestData(contentTestData);
+      var foundIt = false;
+      for (var seqNo in contentTestData.paints) {
+        var paint = contentTestData.paints[seqNo];
+        for (var scrollId in paint) {
+          var scrollFrame = paint[scrollId];
+          if ('contentDescription' in scrollFrame &&
+              scrollFrame['contentDescription'].includes('bug1277814-div')) {
+            foundIt = true;
+          }
+        }
+      }
+      SimpleTest.ok(foundIt, "expected to find APZ test data for bug1277814-div");
+    }
+
+    if (isApzEnabled()) {
+      SimpleTest.waitForExplicitFinish();
+
+      pushPrefs([["apz.test.logging_enabled", true]])
+        .then(waitUntilApzStable)
+        .then(runContinuation(test))
+        .then(SimpleTest.finish);
+    }
+  </script>
+  <style>
+    #bug1277814-div
+    {
+      position: absolute;
+      left: 0;
+      top: 0;
+      padding: .5em;
+      overflow: auto;
+      color: white;
+      background: green;
+      max-width: 30em;
+      max-height: 6em;
+      visibility: hidden;
+      transform: scaleY(0);
+      transition: transform .15s ease-out, visibility 0s ease .15s;
+    }
+    #bug1277814-div.a
+    {
+      visibility: visible;
+      transform: scaleY(1);
+      transition: transform .15s ease-out;
+    }
+  </style>
+</head>
+<body>
+  <!-- Use a unique id because we'll be checking for it in the content
+       description logged in the APZ test data -->
+  <div id="bug1277814-div">
+    CoolCmd<br>CoolCmd<br>CoolCmd<br>CoolCmd<br>
+    CoolCmd<br>CoolCmd<br>CoolCmd<br>CoolCmd<br>
+    CoolCmd<br>CoolCmd<br>CoolCmd<br>CoolCmd<br>
+    CoolCmd<br>CoolCmd<br>CoolCmd<br>CoolCmd<br>
+    CoolCmd<br>CoolCmd<br>CoolCmd<br>CoolCmd<br>
+  <button>click me</button>
+</body>
+</html>