Bug 1359137 - move webcompat button into toolbar for tests, r=mikedeboer
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 31 May 2017 14:06:57 +0100
changeset 410457 a0899380ac24b0dfea3ea5d6e2ed5f981491bf0e
parent 410456 4f3980aa447fda41b2b082195b5addd1417733cf
child 410458 ca3a6a1ab24f8279b30b73b76ceced0dcb295b9c
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1359137
milestone55.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 1359137 - move webcompat button into toolbar for tests, r=mikedeboer MozReview-Commit-ID: B4aKXo6Ai6z
browser/extensions/webcompat-reporter/test/browser/browser_button_state.js
browser/extensions/webcompat-reporter/test/browser/browser_report_site_issue.js
--- a/browser/extensions/webcompat-reporter/test/browser/browser_button_state.js
+++ b/browser/extensions/webcompat-reporter/test/browser/browser_button_state.js
@@ -1,28 +1,29 @@
 const REPORTABLE_PAGE = "http://example.com/";
 const REPORTABLE_PAGE2 = "https://example.com/";
 const NONREPORTABLE_PAGE = "about:blank";
 
 /* 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() {
+  CustomizableUI.addWidgetToArea("webcompat-reporter-button", "nav-bar");
   let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, REPORTABLE_PAGE);
-  await PanelUI.show();
   is(isButtonDisabled(), false, "Check that button is enabled for reportable schemes on tab load");
 
   let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, NONREPORTABLE_PAGE);
   is(isButtonDisabled(), true, "Check that button is disabled for non-reportable schemes on tab load");
 
   let tab3 = await BrowserTestUtils.openNewForegroundTab(gBrowser, REPORTABLE_PAGE2);
   is(isButtonDisabled(), false, "Check that button is enabled for reportable schemes on tab load");
 
 
   await BrowserTestUtils.switchTab(gBrowser, tab2);
   is(isButtonDisabled(), true, "Check that button is disabled for non-reportable schemes on TabSelect");
 
   await BrowserTestUtils.switchTab(gBrowser, tab1);
   is(isButtonDisabled(), false, "Check that button is enabled for reportable schemes on TabSelect");
 
+  CustomizableUI.reset();
   await BrowserTestUtils.removeTab(tab1);
   await BrowserTestUtils.removeTab(tab2);
   await BrowserTestUtils.removeTab(tab3);
 });
--- a/browser/extensions/webcompat-reporter/test/browser/browser_report_site_issue.js
+++ b/browser/extensions/webcompat-reporter/test/browser/browser_report_site_issue.js
@@ -1,18 +1,18 @@
 /* Test that clicking on the Report Site Issue button opens a new tab
    and sends a postMessaged blob to it. */
 add_task(async function test_screenshot() {
+  CustomizableUI.addWidgetToArea("webcompat-reporter-button", "nav-bar");
   requestLongerTimeout(2);
 
   // ./head.js sets the value for PREF_WC_REPORTER_ENDPOINT
   await SpecialPowers.pushPrefEnv({set: [[PREF_WC_REPORTER_ENDPOINT, NEW_ISSUE_PAGE]]});
 
   let tab1 = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE);
-  await PanelUI.show();
 
   let webcompatButton = document.getElementById("webcompat-reporter-button");
   ok(webcompatButton, "Report Site Issue button exists.");
 
   let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
   webcompatButton.click();
   let tab2 = await newTabPromise;
 
@@ -25,9 +25,10 @@ add_task(async function test_screenshot(
     is(urlParam, args.TEST_PAGE, "Reported page is correctly added to the url param");
 
     is(preview.innerText, "Pass", "A Blob object was successfully transferred to the test page.")
     ok(preview.style.backgroundImage.startsWith("url(\"data:image/png;base64,iVBOR"), "A green screenshot was successfully postMessaged");
   });
 
   await BrowserTestUtils.removeTab(tab2);
   await BrowserTestUtils.removeTab(tab1);
+  CustomizableUI.reset();
 });