Bug 1143974. Add test.
authorTimothy Nikkel <tnikkel@gmail.com>
Thu, 19 Mar 2015 23:48:12 -0500
changeset 263546 22f7942307c4ed9fa8f483f7073a8606af8b982f
parent 263545 3ae4e63e37f67bd9e8ee065b07c3a027fe58b050
child 263547 e0d9c9cbee73a42a83dbd8d1db9b4f037debcee5
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1143974
milestone39.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 1143974. Add test.
layout/xul/test/chrome.ini
layout/xul/test/test_popupZoom.xul
--- a/layout/xul/test/chrome.ini
+++ b/layout/xul/test/chrome.ini
@@ -13,12 +13,13 @@ skip-if = buildapp == 'mulet'
 [test_bug398982-2.xul]
 [test_bug467442.xul]
 [test_bug477754.xul]
 [test_bug703150.xul]
 skip-if = buildapp == 'mulet'
 [test_bug987230.xul]
 skip-if = os == 'linux' # No native mousedown event
 [test_popupSizeTo.xul]
+[test_popupZoom.xul]
 [test_resizer.xul]
 [test_stack.xul]
 [test_windowminmaxsize.xul]
 skip-if = buildapp == 'mulet'
new file mode 100644
--- /dev/null
+++ b/layout/xul/test/test_popupZoom.xul
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
+<window title="XUL Panel zoom test"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+  <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
+  <script type="application/javascript" 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[
+    SimpleTest.waitForExplicitFinish();
+
+    var docviewer;
+    var savedzoom;
+
+    function openPopup()
+    {
+      docviewer = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+                        .getInterface(Components.interfaces.nsIWebNavigation)
+                        .QueryInterface(Components.interfaces.nsIDocShell)
+                        .contentViewer;
+      savedzoom = docviewer.fullZoom;
+      docviewer.fullZoom = 2;
+
+      document.getElementById("panel").
+        openPopup(document.getElementById("anchor"), "after_start", 0, 0, false, false, null);
+    }
+
+    function popupShown(event)
+    {
+      var panel = document.getElementById("panel");
+      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");
+
+      docviewer.fullZoom = savedzoom;
+
+      event.target.hidePopup();
+    }
+
+    SimpleTest.waitForFocus(openPopup);
+   ]]></script>
+
+<description id="anchor" value="Sometext to this some texts"/>
+<panel id="panel" onpopupshown="popupShown(event)" onpopuphidden="SimpleTest.finish()">
+  <resizer id="resizer" dir="bottomend" width="16" height="16"/>
+  <hbox width="50" height="50" flex="1"/>
+</panel>
+
+
+</window>