Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3349 from gijsk/fix-photon-theme-in-tests
Browse files Browse the repository at this point in the history
Fix tests failing in photon-y Firefox without MOZ_PHOTON_THEME
  • Loading branch information
ianb authored Aug 15, 2017
2 parents 3c2b0a4 + beec56b commit 4ed2926
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions test/addon/browser_screenshots_ui_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ add_task(async function() {
await promiseScreenshotsReset();
});

let id = AppConstants.MOZ_PHOTON_THEME ? "pageAction-panel-screenshots"
: "screenshots_mozilla_org-browser-action";
let onPhoton = (typeof AppConstants.MOZ_PHOTON_THEME == "undefined") ||
AppConstants.MOZ_PHOTON_THEME;
let id = onPhoton ? "pageAction-panel-screenshots" : "screenshots_mozilla_org-browser-action";

await BrowserTestUtils.waitForCondition(
() => document.getElementById(id),
Expand Down
4 changes: 2 additions & 2 deletions test/addon/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function promiseScreenshotsEnabled() {
}
info("Screenshots is not enabled");
return new Promise((resolve, reject) => {
if (!AppConstants.MOZ_PHOTON_THEME) {
if (AppConstants.hasOwnProperty("MOZ_PHOTON_THEME") && !AppConstants.MOZ_PHOTON_THEME) {
let listener = {
onWidgetAfterCreation(widgetid) {
if (widgetid == "screenshots_mozilla_org-browser-action") {
Expand Down Expand Up @@ -47,7 +47,7 @@ function promiseScreenshotsDisabled() {
return Promise.resolve(true);
}
return new Promise((resolve, reject) => {
if (!AppConstants.MOZ_PHOTON_THEME) {
if (AppConstants.hasOwnProperty("MOZ_PHOTON_THEME") && !AppConstants.MOZ_PHOTON_THEME) {
let listener = {
onWidgetDestroyed(widgetid) {
if (widgetid == "screenshots_mozilla_org-browser-action") {
Expand Down

0 comments on commit 4ed2926

Please sign in to comment.