blob: 9fc9ddea6be948bb05cb8c03d895cd5ada8e8023 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
<html manifest="resources/subframes-3.manifest">
<body>
<p>Test that a subframe with manifest that matches top frame manifest works correctly.</p>
<p>In this case, the subframe resource is NOT listed in manifest explicitly.</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()
{
applicationCache.onnoupdate = null;
applicationCache.oncached = null;
// When a new main resource is associated with the cache, an update should be started.
applicationCache.onchecking = function() { log("checking") }
var ifr = document.createElement("iframe");
ifr.setAttribute("src", "resources/subframe-3.html");
document.body.appendChild(ifr);
}
function test2()
{
window.removeEventListener("message", test2, false);
window.addEventListener("message", test3, false);
// Add an identical frame, to test that loading its resources from appcache works.
var ifr = document.createElement("iframe");
ifr.setAttribute("src", "resources/subframe-3.html");
document.body.appendChild(ifr);
}
function test3()
{
log("SUCCESS");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
applicationCache.onnoupdate = function() { test() }
applicationCache.oncached = function() { test() }
applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
window.addEventListener("message", test2, false);
</script>
</body>
</html>
|