1 <p>Test pageshow/pagehide event behavior in subframes.
</p>
2 <iframe src=
"resources/pageshow-pagehide-subframe.html"></iframe>
5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.waitUntilDone();
12 var log
= document
.getElementById("log");
13 log
.innerHTML
+= message
+ "\n";
18 log("***Original load - onload and pageshow events should fire for subframes, and then for main frame***");
20 window
.onload = function(evt
) {
21 log("Main frame window.onload");
24 window
.addEventListener("pageshow", function(evt
) {
25 log("Main frame window.onpageshow" + ", target = " + evt
.target
+ ", persisted = " + evt
.persisted
);
27 log("***Navigating bottom-level subframe, onpagehide events should fire for subsubframe***");
28 frames
[0].frames
[0].location
= "resources/pageshow-pagehide-subsubframe-2.html";
31 window
.onpagehide = function(evt
) {
32 log("Main frame window.onpagehide" + ", target = " + evt
.target
+ ", persisted = " + evt
.persisted
);
35 window
.addEventListener("message", function(evt
) {
36 if (evt
.data
== "subframe-loaded") {
39 if (window
.testRunner
)
40 testRunner
.notifyDone();
42 } else if (evt
.data
== "subsubframe-loaded") {
44 log("***Navigating mid-level subframe, onpagehide events should fire for both subframes***");
45 frames
[0].location
= "resources/pageshow-pagehide-subframe-2.html";