Title: [133569] trunk
Revision
133569
Author
yu...@chromium.org
Date
2012-11-06 00:49:20 -0800 (Tue, 06 Nov 2012)

Log Message

Web Inspector: _javascript_ web workers debugging crashes
https://bugs.webkit.org/show_bug.cgi?id=101065

Reviewed by Alexander Pavlov.

Source/WebCore:

Clear m_pageInspector when page inspector instance is deleted.
Disable worker inspection when front-end disconnects.

Test: inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html

* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::WorkerFrontendChannel::~WorkerFrontendChannel): notify
WorkerMessagingProxy so that it can clear pointer to the channel.

LayoutTests:

Test that inspected page won't crash if inspected worker is terminated when it is paused
on a breakpoint.

* inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt: Added.
* inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (133568 => 133569)


--- trunk/LayoutTests/ChangeLog	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/ChangeLog	2012-11-06 08:49:20 UTC (rev 133569)
@@ -1,3 +1,22 @@
+2012-11-05  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: _javascript_ web workers debugging crashes
+        https://bugs.webkit.org/show_bug.cgi?id=101065
+
+        Reviewed by Alexander Pavlov.
+
+        Test that inspected page won't crash if inspected worker is terminated when it is paused
+        on a breakpoint.
+
+        * inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt: Added.
+        * inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html: Added.
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/qt/TestExpectations:
+        * platform/win/TestExpectations:
+        * platform/wincairo/TestExpectations:
+
 2012-11-05  Csaba Osztrogonác  <o...@webkit.org>
 
         [Qt] Unreviewed morning gardening, skip new failing tests.

Added: trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt (0 => 133569)


--- trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt	2012-11-06 08:49:20 UTC (rev 133569)
@@ -0,0 +1,8 @@
+Test that inspected page won't crash if inspected worker is terminated while it is paused. Test passes if it doesn't crash. Bug 101065.
+Started worker
+Worker created
+didEnableWorkerDebugging
+didConnectToWorker
+Worker paused
+SUCCESS: Did terminate paused worker
+
Property changes on: trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html (0 => 133569)


--- trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html	                        (rev 0)
+++ trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html	2012-11-06 08:49:20 UTC (rev 133569)
@@ -0,0 +1,83 @@
+<html>
+<head>
+<script type="text/_javascript_" src=""
+<script>
+
+
+var worker;
+
+function startWorkerAndRunTest()
+{
+    worker = new Worker("resources/dedicated-worker.js");
+    worker._onmessage_ = function(event) { };
+    worker.postMessage(1);
+    log("Started worker");
+    runTest();
+}
+
+
+function test()
+{
+
+    var workerId;
+    var workerRequestId = 1;
+    function sendCommandToWorker(method, params)
+    {
+        InspectorTest.sendCommand("Worker.sendMessageToWorker",
+            {
+                "workerId": workerId,
+                "message": { "method": method,
+                             "params": params,
+                             "id": workerRequestId++
+                           }
+            });
+    }
+
+    function didEnableWorkerDebugging(messageObject)
+    {
+        if ("error" in messageObject) {
+            InspectorTest.log("FAIL: Couldn't enable worker debugger: " + messageObject.error.message);
+            InspectorTest.completeTest();
+            return;
+        }
+        InspectorTest.log("didEnableWorkerDebugging");
+    }
+    InspectorTest.sendCommand("Worker.enable", {}, didEnableWorkerDebugging);
+
+
+    InspectorTest.eventHandler["Worker.workerCreated"] = function(messageObject)
+    {
+        workerId = messageObject["params"]["workerId"];
+        InspectorTest.log("Worker created");
+        InspectorTest.sendCommand("Worker.connectToWorker", { "workerId": workerId }, didConnectToWorker);
+
+        function didConnectToWorker(messageObject)
+        {
+            InspectorTest.log("didConnectToWorker");
+            sendCommandToWorker("Debugger.enable", {});
+            sendCommandToWorker("Debugger.pause", {});
+        }
+    }
+
+    InspectorTest.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject)
+    {
+        var message = messageObject["params"]["message"];
+        if (message["method"] === "Debugger.paused") {
+            InspectorTest.log("Worker paused");
+            InspectorTest.sendCommand("Runtime.evaluate", { "_expression_": "worker.terminate()" }, didTerminateWorker);
+        }
+    }
+
+    function didTerminateWorker(messageObject)
+    {
+        InspectorTest.log("SUCCESS: Did terminate paused worker");
+        InspectorTest.completeTest();
+    }
+
+}
+</script>
+</head>
+<body _onLoad_="startWorkerAndRunTest();">Test that inspected page won't crash if inspected worker is terminated while it is paused. Test passes if it doesn't crash.
+<a href="" 101065.</a>
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/efl/TestExpectations (133568 => 133569)


--- trunk/LayoutTests/platform/efl/TestExpectations	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2012-11-06 08:49:20 UTC (rev 133569)
@@ -1683,3 +1683,4 @@
 webkit.org/b/100855 ietestcenter/css3/text/textshadow-008.htm [ ImageOnlyFailure Missing ]
 
 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ]
+webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ]

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (133568 => 133569)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-11-06 08:49:20 UTC (rev 133569)
@@ -1385,6 +1385,7 @@
 webkit.org/b/100424 editing/selection/user-select-all-selection.html [ Failure ]
 
 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ]
+webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ]
 
 webkit.org/b/95299 fast/images/exif-orientation.html [ Failure ]
 webkit.org/b/95299 fast/images/exif-orientation-image-document.html [ Failure ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (133568 => 133569)


--- trunk/LayoutTests/platform/mac/TestExpectations	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2012-11-06 08:49:20 UTC (rev 133569)
@@ -1160,3 +1160,4 @@
 platform/mac/tiled-drawing/ [ Skip ]
 
 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ]
+webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ]

Modified: trunk/LayoutTests/platform/qt/TestExpectations (133568 => 133569)


--- trunk/LayoutTests/platform/qt/TestExpectations	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/platform/qt/TestExpectations	2012-11-06 08:49:20 UTC (rev 133569)
@@ -2520,6 +2520,7 @@
 webkit.org/b/100424 editing/selection/user-select-all-selection.html [ Failure ]
 
 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ]
+webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ]
 
 # New, but failing test
 webkit.org/b/101035 fast/images/exif-orientation-image-document.html

Modified: trunk/LayoutTests/platform/win/TestExpectations (133568 => 133569)


--- trunk/LayoutTests/platform/win/TestExpectations	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/platform/win/TestExpectations	2012-11-06 08:49:20 UTC (rev 133569)
@@ -2416,6 +2416,7 @@
 fast/images/exif-orientation-image-document.html
 
 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ]
+webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ]
 
 #https://bugs.webkit.org/show_bug.cgi?id=100117
-fast/xmlhttprequest/xmlhttprequest-recursive-sync-event.html
\ No newline at end of file
+fast/xmlhttprequest/xmlhttprequest-recursive-sync-event.html

Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (133568 => 133569)


--- trunk/LayoutTests/platform/wincairo/TestExpectations	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations	2012-11-06 08:49:20 UTC (rev 133569)
@@ -2815,3 +2815,4 @@
 webkit.org/b/86146 css3/supports.html
 
 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ]
+webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (133568 => 133569)


--- trunk/Source/WebCore/ChangeLog	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/Source/WebCore/ChangeLog	2012-11-06 08:49:20 UTC (rev 133569)
@@ -1,3 +1,19 @@
+2012-11-02  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: _javascript_ web workers debugging crashes
+        https://bugs.webkit.org/show_bug.cgi?id=101065
+
+        Reviewed by Alexander Pavlov.
+
+        Clear m_pageInspector when page inspector instance is deleted.
+        Disable worker inspection when front-end disconnects.
+
+        Test: inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html
+
+        * inspector/InspectorWorkerAgent.cpp:
+        (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::~WorkerFrontendChannel): notify
+        WorkerMessagingProxy so that it can clear pointer to the channel.
+
 2012-11-06  Nikita Vasilyev  <m...@elv1s.ru>
 
         Web Inspector: Console: wrap long URLs

Modified: trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp (133568 => 133569)


--- trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp	2012-11-06 08:02:38 UTC (rev 133568)
+++ trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp	2012-11-06 08:49:20 UTC (rev 133569)
@@ -63,6 +63,7 @@
     }
     virtual ~WorkerFrontendChannel()
     {
+        disconnectFromWorkerContext();
     }
 
     int id() const { return m_id; }
@@ -136,9 +137,9 @@
 
 void InspectorWorkerAgent::clearFrontend()
 {
+    m_state->setBoolean(WorkerAgentState::autoconnectToWorkers, false);
+    disable(0);
     m_inspectorFrontend = 0;
-    m_state->setBoolean(WorkerAgentState::autoconnectToWorkers, false);
-    destroyWorkerFrontendChannels();
 }
 
 void InspectorWorkerAgent::enable(ErrorString*)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to