Bug 1353036 - Update mozscreenshots to use new preference category names and locations. r=MattN

MozReview-Commit-ID: 3oifWlxUPfY

--HG--
extra : rebase_source : 0309021edbb8cc2618f2efa6557344a9a625aca3
This commit is contained in:
Jared Wein 2017-04-03 11:16:39 -04:00
Родитель 0c61ad5319
Коммит 7329f159c0
1 изменённых файлов: 56 добавлений и 21 удалений

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

@ -17,41 +17,62 @@ this.Preferences = {
init(libDir) {
let panes = [
["paneGeneral", null],
["paneSearch", null],
["paneContent", null],
["paneApplications", null],
["panePrivacy", null],
["panePrivacy", null, DNTDialog],
["panePrivacy", null, clearRecentHistoryDialog],
["paneSecurity", null],
["paneSync", null],
["paneAdvanced", "generalTab"],
["paneAdvanced", "dataChoicesTab"],
["paneAdvanced", "networkTab"],
["paneAdvanced", "networkTab", connectionDialog],
["paneAdvanced", "updateTab"],
["paneAdvanced", "encryptionTab"],
["paneAdvanced", "encryptionTab", certManager],
["paneAdvanced", "encryptionTab", deviceManager],
/* The "new" organization */
["paneGeneral"],
["paneGeneral", scrollToBrowsingGroup],
["paneApplications"],
["paneSync"],
["panePrivacy"],
["panePrivacy", scrollToCacheGroup],
["panePrivacy", DNTDialog],
["panePrivacy", clearRecentHistoryDialog],
["panePrivacy", connectionDialog],
["panePrivacy", certManager],
["panePrivacy", deviceManager],
["paneAdvanced"],
/* The "old" organization. The third argument says to
set the pref to show the old organization when
opening the preferences. */
["paneGeneral", null, true],
["paneSearch", null, true],
["paneContent", null, true],
["paneApplications", null, true],
["panePrivacy", null, true],
["panePrivacy", DNTDialog, true],
["panePrivacy", clearRecentHistoryDialog, true],
["paneSecurity", null, true],
["paneSync", null, true],
["paneAdvanced", null, true, "generalTab"],
["paneAdvanced", null, true, "dataChoicesTab"],
["paneAdvanced", null, true, "networkTab"],
["paneAdvanced", connectionDialog, true, "networkTab"],
["paneAdvanced", null, true, "updateTab"],
["paneAdvanced", null, true, "encryptionTab"],
["paneAdvanced", certManager, true, "encryptionTab"],
["paneAdvanced", deviceManager, true, "encryptionTab"],
];
for (let [primary, advanced, customFn] of panes) {
for (let [primary, customFn, useOldOrg, advanced] of panes) {
let configName = primary.replace(/^pane/, "prefs") + (advanced ? "-" + advanced : "");
if (customFn) {
configName += "-" + customFn.name;
}
this.configurations[configName] = {};
this.configurations[configName].applyConfig = prefHelper.bind(null, primary, advanced, customFn);
this.configurations[configName].applyConfig = prefHelper.bind(null, primary, customFn, useOldOrg, advanced);
}
},
configurations: {},
};
let prefHelper = Task.async(function*(primary, advanced = null, customFn = null) {
let prefHelper = Task.async(function*(primary, customFn = null, useOldOrg = false, advanced = null) {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
let selectedBrowser = browserWindow.gBrowser.selectedBrowser;
if (useOldOrg) {
Services.prefs.setBoolPref("browser.preferences.useOldOrganization", !!useOldOrg);
}
// close any dialog that might still be open
yield ContentTask.spawn(selectedBrowser, null, function*() {
if (!content.window.gSubDialog) {
@ -72,7 +93,7 @@ let prefHelper = Task.async(function*(primary, advanced = null, customFn = null)
readyPromise = TestUtils.topicObserved("advanced-pane-loaded");
}
if (primary == "paneAdvanced") {
if (useOldOrg && primary == "paneAdvanced") {
browserWindow.openAdvancedPreferences(advanced);
} else {
browserWindow.openPreferences(primary);
@ -85,6 +106,8 @@ let prefHelper = Task.async(function*(primary, advanced = null, customFn = null)
yield* customFn(selectedBrowser);
yield customPaintPromise;
}
Services.prefs.clearUserPref("browser.preferences.useOldOrganization");
});
function paintPromise(browserWindow) {
@ -95,6 +118,18 @@ function paintPromise(browserWindow) {
});
}
function* scrollToBrowsingGroup(aBrowser) {
yield ContentTask.spawn(aBrowser, null, function* () {
content.document.getElementById("browsingGroup").scrollIntoView();
});
}
function* scrollToCacheGroup(aBrowser) {
yield ContentTask.spawn(aBrowser, null, function* () {
content.document.getElementById("cacheGroup").scrollIntoView();
});
}
function* DNTDialog(aBrowser) {
yield ContentTask.spawn(aBrowser, null, function* () {
content.document.getElementById("doNotTrackSettings").click();