|
1 <html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/wildcardManifest.cacheManifest"> |
|
2 <head> |
|
3 <title>wildcard in network section test</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 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
8 |
|
9 <style> |
|
10 img { |
|
11 max-width: 400px; |
|
12 max-height: 400px; |
|
13 } |
|
14 </style> |
|
15 |
|
16 <script type="text/javascript"> |
|
17 |
|
18 var gImageLoaded = []; |
|
19 |
|
20 function imageOnLoad(idx) |
|
21 { |
|
22 gImageLoaded[idx] = true; |
|
23 } |
|
24 |
|
25 function manifestUpdated() |
|
26 { |
|
27 window.location.reload(); |
|
28 } |
|
29 |
|
30 function finishTheTest() |
|
31 { |
|
32 OfflineTest.is(gImageLoaded[1], true, "Image from a different origin not cointained in the offline cache has loaded"); |
|
33 OfflineTest.is(gImageLoaded[2], true, "Image not cointained in the offline cache has loaded"); |
|
34 OfflineTest.teardownAndFinish(); |
|
35 } |
|
36 |
|
37 if (OfflineTest.setup()) { |
|
38 applicationCache.onerror = OfflineTest.failEvent; |
|
39 applicationCache.oncached = OfflineTest.priv(manifestUpdated); |
|
40 applicationCache.onnoupdate = OfflineTest.priv(finishTheTest); |
|
41 } |
|
42 |
|
43 SimpleTest.waitForExplicitFinish(); |
|
44 |
|
45 </script> |
|
46 |
|
47 </head> |
|
48 |
|
49 <body> |
|
50 <img src="http://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg" onload="imageOnLoad(1)" /> |
|
51 <img src="jupiter.jpg" onload="imageOnLoad(2)" /> |
|
52 </body> |
|
53 </html> |