Bug 1161036 part 2. Only force-enable dom cache in test_serviceworker_interfaces if we're having to force-enable servicewceworkers too. r=bkelly

This commit is contained in:
Boris Zbarsky 2015-05-05 13:38:56 -04:00
Родитель 4d0e24cedf
Коммит d05df285e4
2 изменённых файлов: 21 добавлений и 5 удалений

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

@ -94,12 +94,28 @@
SimpleTest.waitForExplicitFinish();
onload = function() {
SpecialPowers.pushPrefEnv({"set": [
// The handling of "dom.caches.enabled" here is a bit complicated. What we
// want to happen is that Cache is always enabled in service workers. So
// if service workers are disabled by default we want to force on both
// service workers and "dom.caches.enabled". But if service workers are
// enabled by default, we do not want to mess with the "dom.caches.enabled"
// value, since that would defeat the purpose of the test. Use a subframe
// to decide whether service workers are enabled by default, so we don't
// force creation of our own Navigator object before our prefs are set.
var prefs = [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.caches.enabled", true]
]}, runTest);
];
var subframe = document.createElement("iframe");
document.body.appendChild(subframe);
if (!("serviceWorker" in subframe.contentWindow.navigator)) {
prefs.push(["dom.caches.enabled", true]);
}
subframe.remove();
SpecialPowers.pushPrefEnv({"set": prefs}, runTest);
};
</script>
</body>

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

@ -91,9 +91,9 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
"BroadcastChannel",
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Cache", release: false },
"Cache",
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "CacheStorage", release: false },
"CacheStorage",
// IMPORTANT: Do not change this list without review from a DOM peer!
"Client",
// IMPORTANT: Do not change this list without review from a DOM peer!