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

Bug 1678906 - Add tests for movement direction and for non-collapsing splitters. r=TYLin

Collapsible splitters with reordered boxes are broken even before
bug 1411372. The patch in this bug progresses them but I have no
intention to fully fix them.

Test that the splitter moves in the right direction too.

Differential Revision: https://phabricator.services.mozilla.com/D97871
parent 9f04a709
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -29,6 +29,12 @@ XUL <splitter> collapsing tests
      synthesizeMouse(splitter, offsetX, 1, {type: "mousemove"});
      synthesizeMouse(splitter, offsetX, 1, {type: "mouseup"});
      await new Promise(SimpleTest.executeSoon);
      var newSplitterRect = splitter.getBoundingClientRect();
      is(
        offsetX > 0,
        newSplitterRect.left > splitterRect.left,
        `Should move in the right direction ${splitterRect.left} -> ${newSplitterRect.left}, ${offsetX}`
      );
    }

    function shouldBeCollapsed(where) {
@@ -62,6 +68,7 @@ XUL <splitter> collapsing tests
    var splitter;
    async function runTests(rtl, splitterId) {
      splitter = document.getElementById(splitterId);
      await runPass(rtl, false, false);
      splitter.setAttribute("collapse", "before");
      await runPass(rtl, rtl, !rtl);
      splitter.setAttribute("collapse", "after");