Commit a75dea4e authored by Mike Taylor's avatar Mike Taylor
Browse files

Bug 1391975. Wait for popupshown event on page actions panel before continuing...

Bug 1391975. Wait for popupshown event on page actions panel before continuing with tests. r=miketaylr a=testonly

--HG--
extra : rebase_source : ce0bceb9774ce46b79bfd3b173479e6b9458a949
parent 7e3c80cf
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
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);