Bug 1629450 - Permissions manager tests (extensions/permissions/test/unit) failing in Thunderbird since it's running tests with a real profile. r=baku

After bug 1363541 the calls to Services.prefs.setCharPref("permissions.manager.defaultsUrl", ""); must be done early to have any effect. Otherwise the defaults will already be imported and tests do not get the expected starting point.

Differential Revision: https://phabricator.services.mozilla.com/D70675

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Magnus Melin 2020-04-14 08:34:17 +00:00
parent ef534a1b06
commit 7e719a42a0
10 changed files with 19 additions and 18 deletions

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(async function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(async function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -46,9 +46,9 @@ function GetPermissionsFile(profile) {
*/
add_task(function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// Make sure that we can't resolve the nsINavHistoryService
try {

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(async function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
var pm = Services.perms;
Assert.equal(pm.all.length, 0, "No cookies");

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(async function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(async function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -16,9 +16,9 @@ function GetPermissionsFile(profile) {
}
add_task(async function test() {
/* Create and set up the permissions database */
let profile = do_get_profile();
// Create and set up the permissions database.
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
let profile = do_get_profile();
// We need to execute a pm method to be sure that the DB is fully
// initialized.

View File

@ -2,6 +2,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
add_task(async function test() {
Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
// setup a profile directory
var dir = do_get_profile();