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

Bug 1738265 - Trivially fix other two popup tests that I had missed. r=stransky

parent 21d001f4
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -7,12 +7,10 @@
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>

  <!-- test results are displayed in the html:body -->
  <body xmlns="http://www.w3.org/1999/xhtml">
  </body>

  <!-- test code goes here -->
  <script type="application/javascript"><![CDATA[
  <script><![CDATA[
    SimpleTest.waitForExplicitFinish();

    function openPopup()
@@ -23,12 +21,15 @@
    function popupShown(event)
    {
      document.getElementById("parent").className = "";
      var popup = document.getElementById("thepopup");

      var buttonbcr = document.getElementById("thebutton").getBoundingClientRect();
      var popupbcr = document.getElementById("thepopup").getOuterScreenRect();
      var popupbcr = popup.getOuterScreenRect();
      var popupMarginLeft = parseFloat(getComputedStyle(popup).marginLeft);
      var popupMarginTop = parseFloat(getComputedStyle(popup).marginLeft);

      ok(Math.abs(popupbcr.x - window.mozInnerScreenX - buttonbcr.x) < 3, "x pos is correct");
      ok(Math.abs(popupbcr.y - window.mozInnerScreenY - buttonbcr.bottom) < 3, "y pos is correct");
      ok(Math.abs(popupbcr.x - popupMarginLeft - window.mozInnerScreenX - buttonbcr.x) < 3, "x pos is correct");
      ok(Math.abs(popupbcr.y - popupMarginTop - window.mozInnerScreenY - buttonbcr.bottom) < 3, "y pos is correct");

      event.target.hidePopup();
    }
+5 −5
Original line number Diff line number Diff line
@@ -6,12 +6,10 @@
  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>

  <!-- test results are displayed in the html:body -->
  <body xmlns="http://www.w3.org/1999/xhtml">
  </body>

  <!-- test code goes here -->
  <script type="application/javascript"><![CDATA[
  <script><![CDATA[
    SimpleTest.waitForExplicitFinish();

    var savedzoom;
@@ -29,11 +27,13 @@
    function popupShown(event)
    {
      var panel = document.getElementById("panel");
      var panelMarginLeft = parseFloat(getComputedStyle(panel).marginLeft);
      var panelMarginTop = parseFloat(getComputedStyle(panel).marginLeft);
      var panelbcr = panel.getBoundingClientRect();
      var anchorbcr = document.getElementById("anchor").getBoundingClientRect();

      ok(Math.abs(panelbcr.x - anchorbcr.x) < 3, "x pos is correct");
      ok(Math.abs(panelbcr.y - anchorbcr.bottom) < 3, "y pos is correct");
      ok(Math.abs(panelbcr.x - panelMarginLeft - anchorbcr.x) < 3, "x pos is correct");
      ok(Math.abs(panelbcr.y - panelMarginTop - anchorbcr.bottom) < 3, "y pos is correct");

      SpecialPowers.setFullZoom(window, savedzoom);