2010-03-12 13:53:36 -08:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest">
|
2008-11-05 16:01:06 -08:00
|
|
|
<head>
|
|
|
|
<title>Foreign test</title>
|
|
|
|
|
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
|
|
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This test loads a manifest that contains as an explicit entry
|
|
|
|
* foreign2.html page. After manifest is cached and presence of the
|
|
|
|
* foreign2.html page is checked we redirect to foreign2.html
|
|
|
|
* page. Then the test continues inside that page as follows:
|
|
|
|
* On load of foreign2.html we check there is no associated cache
|
|
|
|
* because the foreign2.html page was marked as FOREIGN in foreign1 cache.
|
|
|
|
* After the foreign2 manifest is updated we check foreign2 cache is
|
|
|
|
* chosen by foreign.html page.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function manifestUpdated()
|
|
|
|
{
|
|
|
|
var appCacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]
|
|
|
|
.getService(Components.interfaces.nsIApplicationCacheService);
|
|
|
|
|
|
|
|
foreign1cache = appCacheService.chooseApplicationCache(
|
2010-03-12 13:53:36 -08:00
|
|
|
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
|
2008-11-05 16:01:06 -08:00
|
|
|
|
|
|
|
OfflineTest.ok(foreign1cache, "foreign2.html chosen from foreign1 cache");
|
2010-03-12 13:53:36 -08:00
|
|
|
OfflineTest.is(foreign1cache.groupID, "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest")
|
2008-11-05 16:01:06 -08:00
|
|
|
|
2010-03-12 13:53:36 -08:00
|
|
|
window.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html";
|
2008-11-05 16:01:06 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
if (OfflineTest.setup()) {
|
|
|
|
applicationCache.onerror = OfflineTest.failEvent;
|
|
|
|
applicationCache.onupdateready = OfflineTest.failEvent;
|
|
|
|
applicationCache.onnoupdate = OfflineTest.failEvent;
|
|
|
|
applicationCache.oncached = OfflineTest.priv(manifestUpdated);
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
</body>
|
|
|
|
</html>
|