Bug 1538983 Rewrite test_bug683852 to use a test-only xbl binding r=smaug
authorAndrew Swan <aswan@mozilla.com>
Thu, 11 Apr 2019 13:59:01 -0700
changeset 530246 159eaec1337ea82a0f4f7326849e6135327fda92
parent 530245 a885e5f28d3141921d9235adfdd0b88552e507a2
child 530247 936c2d2014055dcaf1cc8d15bca959815224bd3c
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1538983, 683852
milestone68.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 1538983 Rewrite test_bug683852 to use a test-only xbl binding r=smaug Differential Revision: https://phabricator.services.mozilla.com/D28510
dom/base/test/chrome/test_bug683852.xul
--- a/dom/base/test/chrome/test_bug683852.xul
+++ b/dom/base/test/chrome/test_bug683852.xul
@@ -2,17 +2,24 @@
 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=683852
 -->
 <window title="Mozilla Bug 683852"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-  <button value="testbutton" id="testbutton"/>
+  <xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl"
+                xmlns:xul="http://www.mozilla.org/keymaster/gaktekeeper/there.is.only.xul">
+    <xbl:binding id="test">
+      <xbl:content><xul:box anonid="xbl-anon">Anonymous</xul:box></xbl:content>
+    </xbl:binding>
+  </xbl:bindings>
+  <box id="xbl-host" style="-moz-binding: url(#test)"/>
+
   <!-- test results are displayed in the html:body -->
   <body xmlns="http://www.w3.org/1999/xhtml">
   <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=683852"
      target="_blank" id="link">Mozilla Bug 683852</a>
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript">
@@ -20,24 +27,24 @@ https://bugzilla.mozilla.org/show_bug.cg
   /** Test for Bug 683852 **/
   SimpleTest.waitForExplicitFinish();
 
   const NS_HTML = "http://www.w3.org/1999/xhtml";
 
   function startTest() {
     is(document.contains(document), true, "Document should contain itself!");
 
-    var tb = document.getElementById("testbutton");
-    is(document.contains(tb), true, "Document should contain element in it!");
-    is(tb.contains(tb), true, "Element should contain itself.")
-    var anon = document.getAnonymousElementByAttribute(tb, "anonid", "button-box");
+    let box = document.getElementById("xbl-host");
+    is(document.contains(box), true, "Document should contain element in it!");
+    is(box.contains(box), true, "Element should contain itself.")
+    let anon = document.getAnonymousElementByAttribute(box, "anonid", "xbl-anon");
     is(document.contains(anon), false, "Document should not contain anonymous element in it!");
-    is(tb.contains(anon), false, "Element should not contain anonymous element in it!");
+    is(box.contains(anon), false, "Element should not contain anonymous element in it!");
     is(anon.contains(anon), true, "Anonymous element should contain itself.")
-    is(document.documentElement.contains(tb), true, "Element should contain element in it!");
+    is(document.documentElement.contains(box), true, "Element should contain element in it!");
     is(document.contains(document.createElement("foo")), false, "Document shouldn't contain element which is't in the document");
     is(document.contains(document.createTextNode("foo")), false, "Document shouldn't contain text node which is't in the document");
 
     var link = document.getElementById("link");
     is(document.contains(link.firstChild), true,
        "Document should contain a text node in it.");
     is(link.contains(link.firstChild), true,
        "Element should contain a text node in it.");