Backed out changeset 245952e7a2d5 (bug 1355795) for failures in browser_bug795764_cachedisabled.js

This commit is contained in:
Phil Ringnalda 2017-04-16 19:59:17 -07:00
Родитель dc932fcd38
Коммит e669dc7bd5
2 изменённых файлов: 12 добавлений и 24 удалений

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

@ -109,13 +109,7 @@ this.SiteDataManager = {
},
_updateAppCache() {
let groups = null;
try {
groups = this._appCache.getGroups();
} catch (e) {
return;
}
let groups = this._appCache.getGroups();
for (let site of this._sites.values()) {
for (let group of groups) {
let uri = Services.io.newURI(group);

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

@ -1,9 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const { interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/PlacesUtils.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
Components.utils.import("resource://gre/modules/NetUtil.jsm");
function test() {
waitForExplicitFinish();
@ -13,22 +12,17 @@ function test() {
"browser.cache.disk.enable",
"browser.cache.memory.enable",
];
for (let pref of prefs) {
Services.prefs.setBoolPref(pref, false);
}
// Adding one fake site so that the SiteDataManager would run.
// Otherwise, without any site then it would just return so we would end up in not testing SiteDataManager.
let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin("https://www.foo.com");
Services.perms.addFromPrincipal(principal, "persistent-storage", Ci.nsIPermissionManager.ALLOW_ACTION);
registerCleanupFunction(function() {
for (let pref of prefs) {
Services.prefs.clearUserPref(pref);
}
Services.perms.removeFromPrincipal(principal, "persistent-storage");
});
for (let pref of prefs) {
Services.prefs.setBoolPref(pref, false);
}
open_preferences(runTest);
}
@ -38,17 +32,17 @@ function runTest(win) {
let tab = win.document;
let elements = tab.getElementById("mainPrefPane").children;
// Test if privacy pane is opened correctly
win.gotoPref("panePrivacy");
// Test if advanced pane is opened correctly
win.gotoPref("paneAdvanced");
for (let element of elements) {
if (element.nodeName == "preferences") {
continue;
}
let attributeValue = element.getAttribute("data-category");
if (attributeValue == "panePrivacy") {
is_element_visible(element, "Privacy elements should be visible");
if (attributeValue == "paneAdvanced") {
is_element_visible(element, "Advanced elements should be visible");
} else {
is_element_hidden(element, "Non-Privacy elements should be hidden");
is_element_hidden(element, "Non-Advanced elements should be hidden");
}
}