Bug 1557812 - Fix test that expects getAttribute to return "" instead of null on documentElement without the attribute r=dao
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 07 Jun 2019 18:58:59 +0000
changeset 477887 d820bbb356aaae7b17231df39e7ac0fda9c77493
parent 477886 90fa7d261787a5f3d69dcc5d95cfbb316f20ca7e
child 477889 522a2bc06f9e5d0767bb3f2e127cc21eeaeb8a78
child 477890 046767398eb2089f5cc61cfd007b6c099063be47
push id36125
push userapavel@mozilla.com
push dateFri, 07 Jun 2019 22:00:07 +0000
treeherdermozilla-central@d820bbb356aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1557812
milestone69.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 1557812 - Fix test that expects getAttribute to return "" instead of null on documentElement without the attribute r=dao This is a difference between HTML and XUL elements. Updating the test to use hasAttribute instead. Differential Revision: https://phabricator.services.mozilla.com/D34020
toolkit/components/extensions/test/browser/browser_ext_themes_autocomplete_popup.js
--- a/toolkit/components/extensions/test/browser/browser_ext_themes_autocomplete_popup.js
+++ b/toolkit/components/extensions/test/browser/browser_ext_themes_autocomplete_popup.js
@@ -138,18 +138,18 @@ add_task(async function test_popup_url()
                `rgb(${hexToRGB(POPUP_URL_COLOR_DARK).join(", ")})`,
                `Urlbar popup url color should be set to ${POPUP_URL_COLOR_DARK}`);
 
   Assert.equal(window.getComputedStyle(actionResult.element.action).color,
                `rgb(${hexToRGB(POPUP_ACTION_COLOR_DARK).join(", ")})`,
                `Urlbar popup action color should be set to ${POPUP_ACTION_COLOR_DARK}`);
 
   let root = document.documentElement;
-  Assert.equal(root.getAttribute("lwt-popup-brighttext"),
-               "",
+  Assert.equal(root.hasAttribute("lwt-popup-brighttext"),
+               false,
                "brighttext should not be set!");
   Assert.equal(root.getAttribute("lwt-popup-darktext"),
                "true",
                "darktext should be set!");
 
   await extension.unload();
 
   Assert.equal(root.hasAttribute("lwt-popup-darktext"),
@@ -197,29 +197,29 @@ add_task(async function test_popup_url()
   // POPUP_TEXT_COLOR_BRIGHT with added alpha.
   Assert.equal(window.getComputedStyle(urlResult.element.separator, quantumbar ? ":before" : null).color,
                `rgba(${hexToRGB(POPUP_TEXT_COLOR_BRIGHT).join(", ")}, 0.5)`,
                `Urlbar popup separator color should be set to ${POPUP_TEXT_COLOR_BRIGHT} with alpha`);
 
   Assert.equal(root.getAttribute("lwt-popup-brighttext"),
                "true",
                "brighttext should be set to true!");
-  Assert.equal(root.getAttribute("lwt-popup-darktext"),
-               "",
+  Assert.equal(root.hasAttribute("lwt-popup-darktext"),
+               false,
                "darktext should not be set!");
 
   await extension.unload();
 
   // Check to see if popup-brighttext and secondary color are not set after
   // unload of theme
-  Assert.equal(root.getAttribute("lwt-popup-brighttext"),
-               "",
+  Assert.equal(root.hasAttribute("lwt-popup-brighttext"),
+               false,
                "brighttext should not be set!");
-  Assert.equal(root.getAttribute("lwt-popup-darktext"),
-               "",
+  Assert.equal(root.hasAttribute("lwt-popup-darktext"),
+               false,
                "darktext should not be set!");
 
   // Calculate what GrayText should be. May differ between platforms.
   let span = document.createXULElement("span");
   span.style.color = "GrayText";
   document.documentElement.appendChild(span);
   let GRAY_TEXT = window.getComputedStyle(span).color;
   span.remove();