Commit fd5fcc2c authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1687878 - Fix test_bug703150.xhtml with nnt on linux. r=dholbert

The linux non-native-theme doesn't create scrollbar buttons, so we can't
rely on the indices.

Differential Revision: https://phabricator.services.mozilla.com/D103145
parent ce5fd139
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -15,14 +15,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=703150

<script class="testbody" type="application/javascript">
<![CDATA[

var scrollbar = document.getElementById("scrollbar");
var scrollbarThumb;

function doTest()
{
  scrollbarThumb = SpecialPowers.unwrap(
    SpecialPowers.InspectorUtils.getChildrenForNode(scrollbar, true)[2]).childNodes[0];
  var scrollbar = document.getElementById("scrollbar");
  var scrollbarThumb = null;
  for (let child of SpecialPowers.InspectorUtils.getChildrenForNode(scrollbar, true)) {
    if (child.nodeName === "slider") {
      scrollbarThumb = SpecialPowers.unwrap(child.childNodes[0]);
    }
  }

  ok(scrollbarThumb, "Should find thumb");
  is(scrollbarThumb.nodeName, "thumb", "Should find thumb");

  function mousedownHandler(aEvent)
  {