2011-02-21 Pavel Feldman <pfeldman@chromium.org>
[WebKit-https.git] / LayoutTests / http / tests / inspector-enabled / open-close-open.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script>
5
6 function onload()
7 {
8     if (window.layoutTestController) {
9         layoutTestController.dumpAsText();
10         layoutTestController.waitUntilDone();
11         layoutTestController.showWebInspector();
12         layoutTestController.evaluateInWebInspector(0, "true");
13         console.log("Opening Web Inspector.");
14     }
15 }
16
17 function didEvaluateForTestInFrontend(callId)
18 {
19     if (callId === 0) {
20         console.log("Closing Web Inspector.");
21         layoutTestController.closeWebInspector();
22
23         console.log("Re-opending Web Inspector.");
24         layoutTestController.showWebInspector();
25
26         layoutTestController.evaluateInWebInspector(1, "(" + frontend_testCommunucationWithServer + ")()");
27     }
28 }
29
30 function completeTest()
31 {
32     console.log("Completing the test.");
33
34     // Release 'evaluate' control, report result and on close afterwards.
35     setTimeout(function() {
36         layoutTestController.closeWebInspector();
37         layoutTestController.notifyDone();
38     }, 0);
39 }
40
41 function frontend_testCommunucationWithServer()
42 {
43     RuntimeAgent.evaluate("completeTest()", "console", false);
44 }
45
46 </script>
47
48 </head>
49
50 <body onload="onload()">
51 <p>
52 Tests that Web Inspector is functional after the open - close - open sequence.
53 https://bugs.webkit.org/show_bug.cgi?id=54879
54 </p>
55 </body>
56 </html>