mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 477692: applicationCache sending obsolete on new cache groups. r+sr=jst
This commit is contained in:
parent
39c2dd6d73
commit
fa06c787d2
@ -108,6 +108,8 @@ _TEST_FILES = \
|
||||
changingManifest.cacheManifest^headers^ \
|
||||
offlineChild.html \
|
||||
test_xhtmlManifest.xhtml \
|
||||
test_missingManifest.html \
|
||||
missing.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
24
dom/tests/mochitest/ajax/offline/missing.html
Normal file
24
dom/tests/mochitest/ajax/offline/missing.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html manifest="missing.cacheManifest">
|
||||
<head>
|
||||
<title>missing test</title>
|
||||
<script type="text/javascript">
|
||||
|
||||
function obsolete(evt)
|
||||
{
|
||||
window.opener.ok(false, "Got an 'obsolete' event");
|
||||
window.opener.finish();
|
||||
}
|
||||
|
||||
function error(evt) {
|
||||
window.opener.ok(true, "Got an 'error' event");
|
||||
window.opener.finish();
|
||||
}
|
||||
|
||||
applicationCache.onobsolete = obsolete;
|
||||
applicationCache.onerror = error;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1></h1>
|
||||
</body> </html>
|
46
dom/tests/mochitest/ajax/offline/test_missingManifest.html
Normal file
46
dom/tests/mochitest/ajax/offline/test_missingManifest.html
Normal file
@ -0,0 +1,46 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test missing manifest</title>
|
||||
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var gTestWin;
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
// Enable the offline-app permission before loading the new window
|
||||
var pm = Cc["@mozilla.org/permissionmanager;1"]
|
||||
.getService(Ci.nsIPermissionManager);
|
||||
var uri = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(window.location.href, null, null);
|
||||
pm.add(uri, "offline-app", Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
|
||||
// now this will properly load the manifest.
|
||||
gTestWin = window.open("missing.html");
|
||||
|
||||
function finish()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
pm.remove(uri.asciiHost, "offline-app");
|
||||
|
||||
gTestWin.close();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1315,7 +1315,11 @@ nsOfflineCacheUpdate::LoadCompleted()
|
||||
if (status == 404 || status == 410) {
|
||||
mSucceeded = PR_FALSE;
|
||||
mObsolete = PR_TRUE;
|
||||
NotifyObsolete();
|
||||
if (mPreviousApplicationCache) {
|
||||
NotifyObsolete();
|
||||
} else {
|
||||
NotifyError();
|
||||
}
|
||||
Finish();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user