1 <html manifest=
"resources/local-content.manifest">
3 <p>Test that documents loaded from application cache don't get access to local resources accidentally.
</p>
4 <p>Should say SUCCESS:
</p>
5 <div id=
"result"></div>
6 <script type=
"text/javascript">
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText()
9 testRunner
.waitUntilDone();
14 document
.getElementById("result").innerHTML
+= message
+ "<br>";
19 var ifr
= document
.createElement("iframe");
20 ifr
.setAttribute("src", "file:///usr/include/stdio.h");
21 ifr
.onload
= frameCreated
;
22 setTimeout(function() {
24 if (window
.testRunner
)
25 testRunner
.notifyDone();
28 document
.body
.appendChild(ifr
);
31 function frameCreated()
33 log("FAILURE: A local resource was opened in an iframe");
34 if (window
.testRunner
)
35 testRunner
.notifyDone();
40 // Reload to ensure that the main document was loaded from application cache.
41 window
.location
.reload();
44 applicationCache
.addEventListener('noupdate', noupdate
, false);
46 applicationCache
.addEventListener('cached', reload
, false);
47 applicationCache
.addEventListener('error', function() { alert("Unexpected error event") }, false);