Bug 1553778 - adjust mail/components/extensions/test/browser/browser_ext_browserAction.js to toolbarbutton de-xbl. rs=bustage-fix
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Fri, 24 May 2019 13:40:03 +0300
changeset 35681 d5d5ade9fbd66e53a8f9e7ff921d1c36348aefc0
parent 35680 a315856a66fa97d4485d94dd556cb01e0d5228db
child 35682 1aa9b4cb10abaf12f2c3eadae52c6ae32f3f10d2
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersbustage-fix
bugs1553778
Bug 1553778 - adjust mail/components/extensions/test/browser/browser_ext_browserAction.js to toolbarbutton de-xbl. rs=bustage-fix
mail/components/extensions/test/browser/browser_ext_browserAction.js
--- a/mail/components/extensions/test/browser/browser_ext_browserAction.js
+++ b/mail/components/extensions/test/browser/browser_ext_browserAction.js
@@ -10,34 +10,28 @@ add_task(async () => {
     let toolbar = document.getElementById("mail-bar3");
     ok(!toolbar.getAttribute("currentset"), "No toolbar current set");
 
     let button = document.getElementById(buttonId);
     ok(button, "Button created");
     is(toolbar.id, button.parentNode.id, "Button added to toolbar");
     ok(toolbar.currentSet.split(",").includes(buttonId), "Button added to toolbar current set");
 
-    let icon = document.getAnonymousElementByAttribute(
-      button, "class", "toolbarbutton-icon"
-    );
+    let icon = button.querySelector(".toolbarbutton-icon");
     is(getComputedStyle(icon).listStyleImage,
        `url("chrome://messenger/content/extension.svg")`, "Default icon");
-    let label = document.getAnonymousElementByAttribute(
-      button, "class", "toolbarbutton-text"
-    );
+    let label = button.querySelector(".toolbarbutton-text");
     is(label.value, "This is a test", "Correct label");
 
     EventUtils.synthesizeMouseAtCenter(button, { clickCount: 1 });
     await extension.awaitFinish("browserAction");
     await promiseAnimationFrame();
 
     is(document.getElementById(buttonId), button);
-    label = document.getAnonymousElementByAttribute(
-      button, "class", "toolbarbutton-text"
-    );
+    label = button.querySelector(".toolbarbutton-text");
     is(label.value, "New title", "Correct label");
 
     await extension.unload();
     await promiseAnimationFrame();
 
     ok(!document.getElementById(buttonId), "Button destroyed");
   }