Back out 2 changesets (bug 1244122) for a 50% failure rate in (at least) 10.6 e10s browser_force_refresh.js

Backed out changeset d383f170be3f (bug 1244122)
Backed out changeset b1eacad41db4 (bug 1244122)
This commit is contained in:
Phil Ringnalda 2016-02-01 19:53:55 -08:00
parent 8c03ed4b8a
commit 77e89ae1cd
4 changed files with 8 additions and 32 deletions

View File

@ -30,9 +30,7 @@ function test() {
['dom.serviceWorkers.exemptFromPerDomainMax', true],
['dom.serviceWorkers.testing.enabled', true],
['dom.serviceWorkers.interception.enabled', true],
['dom.caches.enabled', true],
['browser.cache.disk.enable', false],
['browser.cache.memory.enable', false]]},
['dom.caches.enabled', true]]},
function() {
var url = gTestRoot + 'browser_base_force_refresh.html';
var tab = gBrowser.addTab();
@ -41,37 +39,24 @@ function test() {
tab.linkedBrowser.messageManager.loadFrameScript("data:,(" + encodeURIComponent(frameScript) + ")()", true);
gBrowser.loadURI(url);
function done() {
tab.linkedBrowser.messageManager.removeMessageListener("test:event", eventHandler);
gBrowser.removeTab(tab);
executeSoon(finish);
}
var cachedLoad = false;
var baseLoadCount = 0;
function eventHandler(msg) {
if (msg.data.type === 'base-load') {
baseLoadCount += 1;
if (cachedLoad) {
is(baseLoadCount, 2, 'cached load should occur before second base load');
return done();
}
if (baseLoadCount !== 1) {
ok(false, 'base load without cached load should only occur once');
return done();
tab.linkedBrowser.messageManager.removeMessageListener("test:event", eventHandler);
gBrowser.removeTab(tab);
executeSoon(finish);
}
} else if (msg.data.type === 'base-register') {
ok(!cachedLoad, 'cached load should not occur before base register');
is(baseLoadCount, 1, 'register should occur after first base load');
refresh();
} else if (msg.data.type === 'base-sw-ready') {
ok(!cachedLoad, 'cached load should not occur before base ready');
is(baseLoadCount, 1, 'ready should occur after first base load');
refresh();
} else if (msg.data.type === 'cached-load') {
ok(!cachedLoad, 'cached load should not occur twice');
is(baseLoadCount, 1, 'cache load occur after first base load');
cachedLoad = true;
forceRefresh();
}

View File

@ -48,14 +48,12 @@ NS_IMETHODIMP CacheStorage::AsyncOpenURI(nsIURI *aURI,
if (!CacheStorageService::Self())
return NS_ERROR_NOT_INITIALIZED;
if (MOZ_UNLIKELY(!CacheObserver::UseDiskCache()) && mWriteToDisk &&
!(aFlags & OPEN_INTERCEPTED)) {
if (MOZ_UNLIKELY(!CacheObserver::UseDiskCache()) && mWriteToDisk) {
aCallback->OnCacheEntryAvailable(nullptr, false, nullptr, NS_ERROR_NOT_AVAILABLE);
return NS_OK;
}
if (MOZ_UNLIKELY(!CacheObserver::UseMemoryCache()) && !mWriteToDisk &&
!(aFlags & OPEN_INTERCEPTED)) {
if (MOZ_UNLIKELY(!CacheObserver::UseMemoryCache()) && !mWriteToDisk) {
aCallback->OnCacheEntryAvailable(nullptr, false, nullptr, NS_ERROR_NOT_AVAILABLE);
return NS_OK;
}

View File

@ -56,12 +56,6 @@ interface nsICacheStorage : nsISupports
*/
const uint32_t OPEN_SECRETLY = 1 << 5;
/**
* Entry is being opened as part of a service worker interception. Do not
* allow the cache to be disabled in this case.
*/
const uint32_t OPEN_INTERCEPTED = 1 << 6;
/**
* Asynchronously opens a cache entry for the specified URI.
* Result is fetched asynchronously via the callback.

View File

@ -2991,7 +2991,6 @@ nsHttpChannel::OpenCacheEntry(bool isHttps)
intercepted->NotifyController();
} else {
if (mInterceptCache == INTERCEPTED) {
cacheEntryOpenFlags |= nsICacheStorage::OPEN_INTERCEPTED;
DebugOnly<bool> exists;
MOZ_ASSERT(NS_SUCCEEDED(cacheStorage->Exists(openURI, extension, &exists)) && exists,
"The entry must exist in the cache after we create it here");