Bug 1585582 - Set appcache prefs on before start to prevent races in tests. r=baku

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kingston 2019-10-21 19:33:02 +00:00
Родитель c25b106076
Коммит ff67914f11
6 изменённых файлов: 20 добавлений и 12 удалений

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

@ -3,6 +3,9 @@ support-files=
head.js head.js
dummy.js dummy.js
dummy_page.html dummy_page.html
prefs=
browser.cache.offline.enable=true
browser.cache.offline.storage.enable=true
[browser_purgehistory_clears_sh.js] [browser_purgehistory_clears_sh.js]
[browser_sanitize-formhistory.js] [browser_sanitize-formhistory.js]

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

@ -490,8 +490,6 @@ add_task(async function test_form_entries() {
// Test for offline cache deletion // Test for offline cache deletion
add_task(async function test_offline_cache() { add_task(async function test_offline_cache() {
Services.prefs.setBoolPref("browser.cache.offline.enable", true);
Services.prefs.setBoolPref("browser.cache.offline.storage.enable", true);
// Prepare stuff, we will work with www.example.com // Prepare stuff, we will work with www.example.com
var URL = "http://www.example.com"; var URL = "http://www.example.com";
var URI = makeURI(URL); var URI = makeURI(URL);
@ -570,8 +568,6 @@ add_task(async function test_offline_cache() {
cacheListener cacheListener
); );
await wh.promiseClosed; await wh.promiseClosed;
Services.prefs.clearUserPref("browser.cache.offline.enable");
Services.prefs.clearUserPref("browser.cache.offline.storage.enable");
}); });
// Test for offline apps permission deletion // Test for offline apps permission deletion

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

@ -40,3 +40,7 @@ user_pref("dom.animations-api.implicit-keyframes.enabled", true);
// sometime wpt runs test even before the document becomes visible, which would // sometime wpt runs test even before the document becomes visible, which would
// delay video.play() and cause play() running in wrong order. // delay video.play() and cause play() running in wrong order.
user_pref("media.block-autoplay-until-in-foreground", false); user_pref("media.block-autoplay-until-in-foreground", false);
user_pref("media.block-autoplay-until-in-foreground", false);
// Enable AppCache globally for now whilst it's being removed in Bug 1584984
user_pref("browser.cache.offline.storage.enable", true);
user_pref("browser.cache.offline.enable", true);

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

@ -1,5 +1,5 @@
[appcache.tentative.https.sub.html] [appcache.tentative.https.sub.html]
expected: TIMEOUT prefs: [browser.cache.offline.storage.enable:true,browser.cache.offline.enable:true]
[Appcache!] [Appcache!]
expected: TIMEOUT expected: FAIL

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

@ -406,8 +406,6 @@ async function test_push_cleared() {
const { PushService } = serviceExports; const { PushService } = serviceExports;
const userAgentID = "bd744428-f125-436a-b6d0-dd0c9845837f"; const userAgentID = "bd744428-f125-436a-b6d0-dd0c9845837f";
const channelID = "0ef2ad4a-6c49-41ad-af6e-95d2425276bf"; const channelID = "0ef2ad4a-6c49-41ad-af6e-95d2425276bf";
Services.prefs.setBoolPref("browser.cache.offline.storage.enable", true);
Services.prefs.setBoolPref("browser.cache.offline.enable", true);
let db = PushServiceWebSocket.newPushDB(); let db = PushServiceWebSocket.newPushDB();
@ -557,11 +555,19 @@ var tests = [
// Storage // Storage
test_storage_cleared, test_storage_cleared,
// Cache
test_cache_cleared,
]; ];
// Cache
//
// Due to these prefs being static, setting them doesn't make a difference in time for the test
// As we are removing AppCache in Bug 1584984 this will just be removed soon.
if (
Services.prefs.getBoolPref("browser.cache.offline.enable") &&
Services.prefs.getBoolPref("browser.cache.offline.storage.enable")
) {
tests.push(test_cache_cleared);
}
function run_test() { function run_test() {
for (let i = 0; i < tests.length; i++) { for (let i = 0; i < tests.length; i++) {
add_task(tests[i]); add_task(tests[i]);

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

@ -1,5 +1,4 @@
[DEFAULT] [DEFAULT]
prefs = [browser.cache.offline.enable = true, browser.cache.offline.storage.enable=true]
head = head_forgetaboutsite.js ../../../../dom/push/test/xpcshell/head.js head = head_forgetaboutsite.js ../../../../dom/push/test/xpcshell/head.js
skip-if = toolkit == 'android' skip-if = toolkit == 'android'
support-files = support-files =