2011-02-21 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 18:29:27 +0000 (18:29 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Feb 2011 18:29:27 +0000 (18:29 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: navigation does not work after reopening frontend.
        https://bugs.webkit.org/show_bug.cgi?id=54879

        Test: http/tests/inspector-enabled/open-close-open.html

        * inspector/InspectorAgent.cpp:
        (WebCore::InspectorAgent::setFrontend):
        * inspector/InspectorState.cpp:
        (WebCore::InspectorState::unmute):
        * inspector/InspectorState.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector-enabled/open-close-open-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector-enabled/open-close-open.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorState.cpp
Source/WebCore/inspector/InspectorState.h

index 0af519d..02bb382 100644 (file)
@@ -1,3 +1,13 @@
+2011-02-21  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: navigation does not work after reopening frontend.
+        https://bugs.webkit.org/show_bug.cgi?id=54879
+
+        * http/tests/inspector-enabled/open-close-open-expected.txt: Added.
+        * http/tests/inspector-enabled/open-close-open.html: Added.
+
 2011-02-21  Martin Robinson  <mrobinson@igalia.com>
 
         Add results for tests missing results and unskip a test that
 2011-02-21  Martin Robinson  <mrobinson@igalia.com>
 
         Add results for tests missing results and unskip a test that
diff --git a/LayoutTests/http/tests/inspector-enabled/open-close-open-expected.txt b/LayoutTests/http/tests/inspector-enabled/open-close-open-expected.txt
new file mode 100644 (file)
index 0000000..cec49da
--- /dev/null
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 13: Opening Web Inspector.
+CONSOLE MESSAGE: line 20: Closing Web Inspector.
+CONSOLE MESSAGE: line 23: Re-opending Web Inspector.
+CONSOLE MESSAGE: line 32: Completing the test.
+Tests that Web Inspector is functional after the open - close - open sequence. https://bugs.webkit.org/show_bug.cgi?id=54879
diff --git a/LayoutTests/http/tests/inspector-enabled/open-close-open.html b/LayoutTests/http/tests/inspector-enabled/open-close-open.html
new file mode 100644 (file)
index 0000000..6ce92ed
--- /dev/null
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script>
+
+function onload()
+{
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+        layoutTestController.showWebInspector();
+        layoutTestController.evaluateInWebInspector(0, "true");
+        console.log("Opening Web Inspector.");
+    }
+}
+
+function didEvaluateForTestInFrontend(callId)
+{
+    if (callId === 0) {
+        console.log("Closing Web Inspector.");
+        layoutTestController.closeWebInspector();
+
+        console.log("Re-opending Web Inspector.");
+        layoutTestController.showWebInspector();
+
+        layoutTestController.evaluateInWebInspector(1, "(" + frontend_testCommunucationWithServer + ")()");
+    }
+}
+
+function completeTest()
+{
+    console.log("Completing the test.");
+
+    // Release 'evaluate' control, report result and on close afterwards.
+    setTimeout(function() {
+        layoutTestController.closeWebInspector();
+        layoutTestController.notifyDone();
+    }, 0);
+}
+
+function frontend_testCommunucationWithServer()
+{
+    RuntimeAgent.evaluate("completeTest()", "console", false);
+}
+
+</script>
+
+</head>
+
+<body onload="onload()">
+<p>
+Tests that Web Inspector is functional after the open - close - open sequence.
+https://bugs.webkit.org/show_bug.cgi?id=54879
+</p>
+</body>
+</html>
index d28c967..8791081 100644 (file)
@@ -1,3 +1,18 @@
+2011-02-21  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: navigation does not work after reopening frontend.
+        https://bugs.webkit.org/show_bug.cgi?id=54879
+
+        Test: http/tests/inspector-enabled/open-close-open.html
+
+        * inspector/InspectorAgent.cpp:
+        (WebCore::InspectorAgent::setFrontend):
+        * inspector/InspectorState.cpp:
+        (WebCore::InspectorState::unmute):
+        * inspector/InspectorState.h:
+
 2011-02-21  Adam Roben  <aroben@apple.com>
 
         Protect the PluginView when evaluating javascript: URLs
 2011-02-21  Adam Roben  <aroben@apple.com>
 
         Protect the PluginView when evaluating javascript: URLs
index 9b0a4fb..3693844 100644 (file)
@@ -338,6 +338,9 @@ void InspectorAgent::setSearchingForNode(bool enabled, bool* newState)
 
 void InspectorAgent::setFrontend(InspectorFrontend* inspectorFrontend)
 {
 
 void InspectorAgent::setFrontend(InspectorFrontend* inspectorFrontend)
 {
+    // We can reconnect to existing front-end -> unmute state.
+    m_state->unmute();
+
     m_frontend = inspectorFrontend;
     createFrontendLifetimeAgents();
 
     m_frontend = inspectorFrontend;
     createFrontendLifetimeAgents();
 
index 290ffc2..897724e 100644 (file)
@@ -59,6 +59,11 @@ void InspectorState::mute()
     m_isOnMute = true;
 }
 
     m_isOnMute = true;
 }
 
+void InspectorState::unmute()
+{
+    m_isOnMute = false;
+}
+
 void InspectorState::updateCookie()
 {
     if (!m_isOnMute)
 void InspectorState::updateCookie()
 {
     if (!m_isOnMute)
index 3a9c3ed..1cae9ad 100644 (file)
@@ -50,6 +50,7 @@ public:
     virtual ~InspectorState() {}
 
     void mute();
     virtual ~InspectorState() {}
 
     void mute();
+    void unmute();
 
     bool getBoolean(const String& propertyName);
     String getString(const String& propertyName);
 
     bool getBoolean(const String& propertyName);
     String getString(const String& propertyName);