Bug 1391975. Wait for popupshown event on page actions panel before continuing with tests. r=me a=testonly draft
authorMike Taylor <miket@mozilla.com>
Mon, 11 Sep 2017 18:15:51 -0500
changeset 662663 d2882c53851a07f768c55330812af8ebbb9c7a77
parent 662656 3a6d2e30bbe18b4ed6d3d964afe9c97237f0515d
child 730940 3f1ff3c0c849bd9a201c8723730a6516f8961eac
push id79158
push userbmo:miket@mozilla.com
push dateMon, 11 Sep 2017 23:22:43 +0000
reviewersme, testonly
bugs1391975
milestone57.0a1
Bug 1391975. Wait for popupshown event on page actions panel before continuing with tests. r=me a=testonly
browser/extensions/webcompat-reporter/test/browser/browser_button_state.js
--- a/browser/extensions/webcompat-reporter/test/browser/browser_button_state.js
+++ b/browser/extensions/webcompat-reporter/test/browser/browser_button_state.js
@@ -1,23 +1,26 @@
 const REPORTABLE_PAGE = "http://example.com/";
 const REPORTABLE_PAGE2 = "https://example.com/";
-const NONREPORTABLE_PAGE = "about:blank";
+const NONREPORTABLE_PAGE = "about:mozilla";
 
 /* Test that the Report Site Issue button is enabled for http and https tabs,
    on page load, or TabSelect, and disabled for everything else. */
 add_task(async function test_button_state_disabled() {
   let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, REPORTABLE_PAGE);
   openPageActions();
+  await BrowserTestUtils.waitForEvent(BrowserPageActions.panelNode, "popupshown");
   is(isButtonDisabled(), false, "Check that button is enabled for reportable schemes on tab load");
 
   let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, NONREPORTABLE_PAGE);
   openPageActions();
+  await BrowserTestUtils.waitForEvent(BrowserPageActions.panelNode, "popupshown");
   is(isButtonDisabled(), true, "Check that button is disabled for non-reportable schemes on tab load");
 
   let tab3 = await BrowserTestUtils.openNewForegroundTab(gBrowser, REPORTABLE_PAGE2);
   openPageActions();
+  await BrowserTestUtils.waitForEvent(BrowserPageActions.panelNode, "popupshown");
   is(isButtonDisabled(), false, "Check that button is enabled for reportable schemes on tab load");
 
   await BrowserTestUtils.removeTab(tab1);
   await BrowserTestUtils.removeTab(tab2);
   await BrowserTestUtils.removeTab(tab3);
 });