Bug 1391975. Wait for popupshown event on page actions panel before continuing with tests. r=miketaylr a=testonly
authorMike Taylor <miket@mozilla.com>
Mon, 11 Sep 2017 18:15:51 -0500
changeset 429875 b1a6f693269b62bb57e1279e480bc50eac91ae0f
parent 429874 15adab29635350835ce0e3b0310280f3e9ba1314
child 429876 74ab1f8f99bbae82bd0ff81f213df4512c48d7ee
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiketaylr, testonly
bugs1391975
milestone57.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 1391975. Wait for popupshown event on page actions panel before continuing with tests. r=miketaylr 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);
 });