Bug 1616143 follow-up - In test browser_ext_browserAction_properties.js, open tabs before trying to use them. rs=bustage-fix a=jorgk THUNDERBIRD_74_0b2_BUILD1 THUNDERBIRD_74_0b2_RELEASE
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 21 Feb 2020 09:52:56 +1300
changeset 38191 525cb6d3f386111e3e0d242391fd1be1e79d4cb7
parent 38190 e5186eaf6d21744ea6404a6b351db3a28a0cf40d
child 38192 3229ac3cf0dec2565edefdb644d80b3ae67626f1
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersbustage-fix, jorgk
bugs1616143
Bug 1616143 follow-up - In test browser_ext_browserAction_properties.js, open tabs before trying to use them. rs=bustage-fix a=jorgk
mail/components/extensions/test/browser/browser_ext_browserAction_properties.js
--- a/mail/components/extensions/test/browser/browser_ext_browserAction_properties.js
+++ b/mail/components/extensions/test/browser/browser_ext_browserAction_properties.js
@@ -33,16 +33,17 @@ add_task(async () => {
             browser.test.onMessage.removeListener(listener);
             resolve();
           });
           browser.test.sendMessage("checkProperty", property, expected);
         });
       }
 
       let tabs = await browser.mailTabs.query({});
+      browser.test.assertEq(3, tabs.length);
       let tabIDs = tabs.map(t => t.id);
 
       await checkProperty("isEnabled", true, true, true, true);
       await browser.browserAction.disable();
       await checkProperty("isEnabled", false, false, false, false);
       await browser.browserAction.enable(tabIDs[0]);
       await checkProperty("isEnabled", false, true, false, false);
       await browser.browserAction.enable();
@@ -92,25 +93,25 @@ add_task(async () => {
         },
       },
       browser_action: {
         default_title: "default",
       },
     },
   });
 
-  await extension.startup();
-
   let tabmail = document.getElementById("tabmail");
   tabmail.openTab("folder", { folder: rootFolder, background: false });
   tabmail.openTab("folder", { folder: rootFolder, background: false });
 
   let mailTabs = tabmail.tabInfo;
   is(mailTabs.length, 3);
 
+  await extension.startup();
+
   let button = document.getElementById(
     "test1_mochi_test-browserAction-toolbarbutton"
   );
 
   extension.onMessage("checkProperty", async (property, expected) => {
     for (let i = 0; i < 3; i++) {
       tabmail.switchToTab(mailTabs[i]);
       await new Promise(resolve => requestAnimationFrame(resolve));