2008-11-04 10:59:12 -08:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Test obsolete application caches</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);
|
|
|
|
|
2009-02-18 05:31:30 -08:00
|
|
|
// Make the obsoleting.sjs return a valid manifest
|
2008-11-04 10:59:12 -08:00
|
|
|
var req = new XMLHttpRequest();
|
2010-03-12 13:53:36 -08:00
|
|
|
req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=manifestPresent");
|
2008-11-04 10:59:12 -08:00
|
|
|
req.setRequestHeader("Content-Type", "text/cache-manifest");
|
2009-02-18 05:31:30 -08:00
|
|
|
req.send("");
|
2008-11-04 10:59:12 -08:00
|
|
|
req.onreadystatechange = function() {
|
|
|
|
if (req.readyState == 4) {
|
|
|
|
// now this will properly load the manifest.
|
|
|
|
gTestWin = window.open("obsolete.html");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function finish()
|
|
|
|
{
|
2008-11-12 14:09:09 -08:00
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
pm.remove(uri.asciiHost, "offline-app");
|
|
|
|
|
2008-11-04 10:59:12 -08:00
|
|
|
gTestWin.close();
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|