OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | |
4 <script> | |
5 | |
6 var frame; | |
7 | |
8 function append() | |
9 { | |
10 frame = document.createElement("iframe"); | |
11 frame.src = "../resources/blank.html"; | |
12 document.body.appendChild(frame); | |
13 } | |
14 | |
15 function navigate() { | |
16 frame.src = "about:blank"; | |
17 } | |
18 | |
19 function remove() { | |
20 document.body.removeChild(frame); | |
21 } | |
22 | |
23 function test() | |
24 { | |
25 InspectorTest.eventHandler["Page.frameAttached"] = onAttached; | |
26 InspectorTest.eventHandler["Page.frameStartedLoading"] = onStartedLoading; | |
27 InspectorTest.eventHandler["Page.frameNavigated"] = onNavigated; | |
28 InspectorTest.eventHandler["Page.frameDetached"] = onDetached; | |
29 InspectorTest.sendCommand("Page.enable", {}); | |
30 | |
31 function onAttached() | |
32 { | |
33 InspectorTest.log("Attached"); | |
34 } | |
35 function onStartedLoading() | |
36 { | |
37 InspectorTest.log("Started loading"); | |
38 } | |
39 function onNavigated(response) | |
40 { | |
41 InspectorTest.log("Navigated"); | |
42 var frame = response.params.frame; | |
43 if (frame.url == "about:blank") | |
44 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "remov
e()" }); | |
45 else | |
46 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "navig
ate()" }); | |
47 } | |
48 function onDetached() | |
49 { | |
50 InspectorTest.log("Detached"); | |
51 InspectorTest.completeTest(); | |
52 } | |
53 | |
54 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "append()" }); | |
55 } | |
56 | |
57 </script> | |
58 </head> | |
59 <body onload="runTest()"> | |
60 </body> | |
61 </html> | |
OLD | NEW |