Web Inspector: Page: re-add enable/disable after r248454
[WebKit-https.git] / LayoutTests / inspector / page / frameScheduledNavigation.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/resources/protocol-test.js"></script>
4 <script>
5
6 function load()
7 {
8     document.querySelector("iframe").src = "resources/blank.html";
9 }
10
11 function test()
12 {
13     InspectorProtocol.eventHandler["Page.frameScheduledNavigation"] = onScheduled;
14     InspectorProtocol.eventHandler["Page.frameStartedLoading"] = onStarted;
15     InspectorProtocol.eventHandler["Page.frameClearedScheduledNavigation"] = onCleared;
16     InspectorProtocol.sendCommand("Page.enable", {});
17
18     function onScheduled(msg)
19     {
20         ProtocolTest.log("Scheduled navigation with delay " + msg.params.delay);
21     }
22
23     function onStarted(msg)
24     {
25         ProtocolTest.log("Started loading");
26         ProtocolTest.wasStarted = true;
27         if (ProtocolTest.wasCleared)
28             ProtocolTest.completeTest();
29     }
30
31     function onCleared(msg)
32     {
33         ProtocolTest.log("Cleared scheduled navigation");
34         ProtocolTest.wasCleared = true;
35         if (ProtocolTest.wasStarted)
36             ProtocolTest.completeTest();
37     }
38
39     InspectorProtocol.sendCommand("Runtime.evaluate", { "expression": "load()" });
40 }
41
42 </script>
43 </head>
44 <body onload="runTest()">
45 <iframe>
46 </body>
47 </html>