|
1 <html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs"> |
|
2 <head> |
|
3 <title>Updating implicit</title> |
|
4 |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script> |
|
7 |
|
8 <script type="text/javascript"> |
|
9 |
|
10 function manifestUpdated() |
|
11 { |
|
12 // Assert that we are properly associated with the application |
|
13 // cache. |
|
14 var req = new XMLHttpRequest; |
|
15 req.open("GET", "namespace2/script3.js", false); |
|
16 try { |
|
17 req.send(null); |
|
18 window.opener.OfflineTest.ok(false, "Able to fetch unlisted resource, not properly associated."); |
|
19 } catch(ex) { |
|
20 window.opener.OfflineTest.ok(true, "Unable to fetch unlisted resource, properly associated."); |
|
21 } |
|
22 |
|
23 req = new XMLHttpRequest; |
|
24 req.open("GET", "updatingImplicit.html", false); |
|
25 try { |
|
26 req.send(null); |
|
27 window.opener.OfflineTest.ok(true, "Able to fetch listed resource, properly associated."); |
|
28 } catch(ex) { |
|
29 window.opener.OfflineTest.ok(false, "Unable to fetch listed resource, not properly associated."); |
|
30 } |
|
31 |
|
32 window.opener.implicitLoaded(window, false); |
|
33 } |
|
34 |
|
35 function manifestError() |
|
36 { |
|
37 window.opener.implicitLoaded(window, true); |
|
38 } |
|
39 |
|
40 if (OfflineTest.setupChild()) { |
|
41 applicationCache.onerror = OfflineTest.priv(manifestError); |
|
42 applicationCache.onupdateready = OfflineTest.failEvent; |
|
43 applicationCache.oncached = OfflineTest.failEvent; |
|
44 applicationCache.onnoupdate = OfflineTest.priv(manifestUpdated); |
|
45 } |
|
46 |
|
47 </script> |
|
48 |
|
49 </head> |
|
50 |
|
51 <body> |
|
52 </body> |
|
53 </html> |