diff options
Diffstat (limited to 'LayoutTests/http/tests/appcache/top-frame-1.html')
-rw-r--r-- | LayoutTests/http/tests/appcache/top-frame-1.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/top-frame-1.html b/LayoutTests/http/tests/appcache/top-frame-1.html new file mode 100644 index 0000000..9e29300 --- /dev/null +++ b/LayoutTests/http/tests/appcache/top-frame-1.html @@ -0,0 +1,38 @@ +<html manifest="resources/subframes-1.manifest"> +<body> +<p>Test that a subframe without manifest doesn't pick an application cache from parent frame +(as long as no relevant cache contains its resource).</p> +<p>Techically, the check is that iframe subresources that are not in top frame cache are loaded +anyway, so it can also pass if the UA fails to reject loads for cache misses.</p> +<p>Should say SUCCESS:</p> +<div id=result></div> + +<script> +if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); +} + +function log(message) +{ + document.getElementById("result").innerHTML += message + "<br>"; +} + +function test() +{ + var ifr = document.createElement("iframe"); + ifr.setAttribute("src", "resources/subframe-1.html"); + document.body.appendChild(ifr); +} + +applicationCache.addEventListener('noupdate', function() { test() }, false); +applicationCache.addEventListener('cached', function() { test() }, false); + +applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") } +applicationCache.onerror = function() { log("FAIL: received unexpected error event") } + +window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false); + +</script> +</body> +</html> |