No bug - ControlCenter screenshots don't need to show the back button (which causes intermittent failures). a=test-only

Differential Revision: https://phabricator.services.mozilla.com/D72580
This commit is contained in:
Matthew Noorenberghe 2020-04-27 17:09:07 +00:00
Родитель 18ac0dd2f1
Коммит 640975324e
1 изменённых файлов: 23 добавлений и 20 удалений

Просмотреть файл

@ -23,6 +23,9 @@ let { UrlClassifierTestUtils } = ChromeUtils.import(
"resource://testing-common/UrlClassifierTestUtils.jsm"
);
const CC_SELECTORS = ["#identity-popup", "#urlbar-input-container"];
const PP_SELECTORS = ["#protections-popup", "#urlbar-input-container"];
const RESOURCE_PATH =
"browser/browser/tools/mozscreenshots/mozscreenshots/extension/mozscreenshots/browser/resources/lib/controlCenter";
const HTTP_PAGE = "http://example.com/";
@ -39,7 +42,7 @@ var ControlCenter = {
configurations: {
about: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage("about:rights");
await openIdentityPopup();
@ -66,7 +69,7 @@ var ControlCenter = {
},
http: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(HTTP_PAGE);
await openIdentityPopup();
@ -74,7 +77,7 @@ var ControlCenter = {
},
httpSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(HTTP_PAGE);
await openIdentityPopup(true);
@ -82,7 +85,7 @@ var ControlCenter = {
},
https: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(HTTPS_PAGE);
await openIdentityPopup();
@ -90,7 +93,7 @@ var ControlCenter = {
},
httpsSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(HTTPS_PAGE);
await openIdentityPopup(true);
@ -98,7 +101,7 @@ var ControlCenter = {
},
singlePermission: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
PERMISSIONS_PAGE
@ -115,7 +118,7 @@ var ControlCenter = {
},
allPermissions: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
// TODO: (Bug 1330601) Rewrite this to consider temporary (TAB) permission states.
// There are 2 possible non-default permission states, so we alternate between them.
@ -137,7 +140,7 @@ var ControlCenter = {
},
mixed: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(MIXED_CONTENT_URL);
await openIdentityPopup();
@ -145,7 +148,7 @@ var ControlCenter = {
},
mixedSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(MIXED_CONTENT_URL);
await openIdentityPopup(true);
@ -153,7 +156,7 @@ var ControlCenter = {
},
mixedPassive: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(MIXED_PASSIVE_CONTENT_URL);
await openIdentityPopup();
@ -161,7 +164,7 @@ var ControlCenter = {
},
mixedPassiveSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(MIXED_PASSIVE_CONTENT_URL);
await openIdentityPopup(true);
@ -169,7 +172,7 @@ var ControlCenter = {
},
mixedActive: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(MIXED_ACTIVE_CONTENT_URL);
await openIdentityPopup();
@ -177,7 +180,7 @@ var ControlCenter = {
},
mixedActiveSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(MIXED_ACTIVE_CONTENT_URL);
await openIdentityPopup(true);
@ -185,7 +188,7 @@ var ControlCenter = {
},
mixedActiveUnblocked: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
let browserWindow = Services.wm.getMostRecentWindow(
"navigator:browser"
@ -203,7 +206,7 @@ var ControlCenter = {
},
mixedActiveUnblockedSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
let browserWindow = Services.wm.getMostRecentWindow(
"navigator:browser"
@ -221,7 +224,7 @@ var ControlCenter = {
},
httpPassword: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(HTTP_PASSWORD_PAGE);
await openIdentityPopup();
@ -229,7 +232,7 @@ var ControlCenter = {
},
httpPasswordSubView: {
selectors: ["#navigator-toolbox", "#identity-popup"],
selectors: CC_SELECTORS,
async applyConfig() {
await loadPage(HTTP_PASSWORD_PAGE);
await openIdentityPopup(true);
@ -237,7 +240,7 @@ var ControlCenter = {
},
trackingProtectionNoElements: {
selectors: ["#navigator-toolbox", "#protections-popup"],
selectors: PP_SELECTORS,
async applyConfig() {
Services.prefs.setBoolPref("privacy.trackingprotection.enabled", true);
@ -247,7 +250,7 @@ var ControlCenter = {
},
trackingProtectionEnabled: {
selectors: ["#navigator-toolbox", "#protections-popup"],
selectors: PP_SELECTORS,
async applyConfig() {
Services.prefs.setBoolPref("privacy.trackingprotection.enabled", true);
await UrlClassifierTestUtils.addTestTrackers();
@ -258,7 +261,7 @@ var ControlCenter = {
},
trackingProtectionDisabled: {
selectors: ["#navigator-toolbox", "#protections-popup"],
selectors: PP_SELECTORS,
async applyConfig() {
let browserWindow = Services.wm.getMostRecentWindow(
"navigator:browser"