Bug 1449759 - Add an APZ mochitest for bug 1443518. r=kats draft
authorBotond Ballo <botond@mozilla.com>
Wed, 28 Mar 2018 18:04:32 -0400
changeset 774434 7be5b730fc074cfa872a12adaca27b1584f41cea
parent 773960 074ba63d6c4d9a69393cce691988697def556818
push id104399
push userbballo@mozilla.com
push dateWed, 28 Mar 2018 22:08:27 +0000
reviewerskats
bugs1449759, 1443518
milestone61.0a1
Bug 1449759 - Add an APZ mochitest for bug 1443518. r=kats MozReview-Commit-ID: 1t6wpYo9n3P
gfx/layers/apz/test/mochitest/helper_hittest_float_bug1434846.html
gfx/layers/apz/test/mochitest/helper_hittest_float_bug1443518.html
gfx/layers/apz/test/mochitest/helper_hittest_subframe_float.html
gfx/layers/apz/test/mochitest/mochitest.ini
gfx/layers/apz/test/mochitest/test_group_hittest.html
rename from gfx/layers/apz/test/mochitest/helper_hittest_subframe_float.html
rename to gfx/layers/apz/test/mochitest/helper_hittest_float_bug1434846.html
new file mode 100644
--- /dev/null
+++ b/gfx/layers/apz/test/mochitest/helper_hittest_float_bug1443518.html
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>APZ hit-testing with floated subframe</title>
+  <script type="application/javascript" src="apz_test_utils.js"></script>
+  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
+  <meta name="viewport" content="width=device-width"/>
+  <style>
+    #div1 {
+    	position: relative;
+    }
+    #div2 {
+    	width: 300px;
+    	float: left;
+    }
+    #subframe {
+    	overflow: auto;
+    }
+    #make-root-scrollable {
+      height: 5000px;
+    }
+  </style>
+</head>
+<body>
+  <div id="div1">
+    <div id="div2">
+      <div id="subframe">
+        <pre>A line of text that overflows because it's sufficiently long</pre>
+      </div>
+    </div>
+  </div>
+  <div id="make-root-scrollable"></div>
+</body>
+<script type="application/javascript">
+
+function* test(testDriver) {
+  var utils = getHitTestConfig().utils;
+
+  hitTestScrollbar({
+    element: document.getElementById('subframe'),
+    directions: { horizontal: true },
+    expectedScrollId: utils.getViewId(document.scrollingElement),
+    trackLocation: ScrollbarTrackLocation.START,
+    expectThumb: true,
+    layerState: LayerState.INACTIVE
+  });
+
+  subtestDone();
+}
+
+waitUntilApzStable().then(runContinuation(test));
+
+</script>
+</html>
--- a/gfx/layers/apz/test/mochitest/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest/mochitest.ini
@@ -19,17 +19,18 @@
     helper_drag_click.html
     helper_drag_scroll.html
     helper_iframe_pan.html
     helper_iframe1.html
     helper_iframe2.html
     helper_hittest_backface_hidden.html
     helper_hittest_basic.html
     helper_hittest_checkerboard.html
-    helper_hittest_subframe_float.html
+    helper_hittest_float_bug1434846.html
+    helper_hittest_float_bug1443518.html
     helper_key_scroll.html
     helper_long_tap.html
     helper_override_root.html
     helper_override_subdoc.html
     helper_scroll_inactive_perspective.html
     helper_scroll_inactive_zindex.html
     helper_scroll_on_position_fixed.html
     helper_scroll_over_scrollbar.html
--- a/gfx/layers/apz/test/mochitest/test_group_hittest.html
+++ b/gfx/layers/apz/test/mochitest/test_group_hittest.html
@@ -23,17 +23,18 @@ var prefs = [
   // APZ as a MouseInput so the hit result is recorded.
   ["test.events.async.enabled", true],
   // Turns on APZTestData logging which we use to obtain the hit test results.
   ["apz.test.logging_enabled", true]
 ];
 
 var subtests = [
   {'file': 'helper_hittest_basic.html', 'prefs': prefs},
-  {'file': 'helper_hittest_subframe_float.html', 'prefs': prefs},
+  {'file': 'helper_hittest_float_bug1434846.html', 'prefs': prefs},
+  {'file': 'helper_hittest_float_bug1443518.html', 'prefs': prefs},
   {'file': 'helper_hittest_checkerboard.html', 'prefs': prefs},
   {'file': 'helper_hittest_backface_hidden.html', 'prefs': prefs}
 ];
 
 if (isApzEnabled()) {
   SimpleTest.waitForExplicitFinish();
   window.onload = function() {
     runSubtestsSeriallyInFreshWindows(subtests)