Title: [208755] trunk
Revision
208755
Author
[email protected]
Date
2016-11-15 14:12:50 -0800 (Tue, 15 Nov 2016)

Log Message

Web Inspector: inspector/worker/debugger-pause.html fails on WebKit1
https://bugs.webkit.org/show_bug.cgi?id=164787

Patch by Joseph Pecoraro <[email protected]> on 2016-11-15
Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::cancelPauseOnNextStatement):
Clear this DebuggerAgent state when we resume.

LayoutTests:

* inspector/worker/debugger-pause.html:
Make this test work for WebKit1 where the VM is shared between the
page and inspector page. We need to be able to stop the Inspector's
evaluation, so that we can evaluate and pause on the page, and then
come back to the inspector afterwards.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (208754 => 208755)


--- trunk/LayoutTests/ChangeLog	2016-11-15 22:02:01 UTC (rev 208754)
+++ trunk/LayoutTests/ChangeLog	2016-11-15 22:12:50 UTC (rev 208755)
@@ -1,3 +1,16 @@
+2016-11-15  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: inspector/worker/debugger-pause.html fails on WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=164787
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/worker/debugger-pause.html:
+        Make this test work for WebKit1 where the VM is shared between the
+        page and inspector page. We need to be able to stop the Inspector's
+        evaluation, so that we can evaluate and pause on the page, and then
+        come back to the inspector afterwards.
+
 2016-11-15  Simon Fraser  <[email protected]>
 
         [iOS WK2] Implement support for visual viewports

Modified: trunk/LayoutTests/inspector/worker/debugger-pause.html (208754 => 208755)


--- trunk/LayoutTests/inspector/worker/debugger-pause.html	2016-11-15 22:02:01 UTC (rev 208754)
+++ trunk/LayoutTests/inspector/worker/debugger-pause.html	2016-11-15 22:12:50 UTC (rev 208755)
@@ -19,6 +19,21 @@
         return;
     }
 
+    // In each test, the Worker pauses and the Main Thread is waiting to
+    // pause on the next statement. Do an InspectorTest.log, which evalutes
+    // _javascript_ in the page and should pause. Then later run work.
+    // In WebKit1, because the VM is shared between the inspector and
+    // inspected page we need to put an artificial break between our
+    // Inspector _javascript_, the Page _javascript_, and back to the Inspector.
+    function pauseTheMainThread() {
+        return new Promise((resolve, reject) => {
+            setTimeout(() => {
+                InspectorTest.log("");
+                setTimeout(resolve);
+            });
+        });
+    }
+
     WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint.disabled = false;
     WebInspector.debuggerManager.assertionsBreakpoint.disabled = false;
 
@@ -31,12 +46,13 @@
         test(resolve, reject) {
             InspectorTest.evaluateInPage(`worker.postMessage("triggerDebuggerStatement")`);
             WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
-                InspectorTest.log(""); // This evaluation will pause the MainThread.
-                InspectorTest.pass("Paused");
-                InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
-                InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.DebuggerStatement, "Pause reason should be a debugger statement.");
-                logPauseLocation();
-                WebInspector.debuggerManager.resume().then(resolve, reject);
+                pauseTheMainThread().then(() => {
+                    InspectorTest.pass("Paused");
+                    InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
+                    InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.DebuggerStatement, "Pause reason should be a debugger statement.");
+                    logPauseLocation();
+                    WebInspector.debuggerManager.resume().then(resolve, reject);
+                });
             });
         }
     });
@@ -50,12 +66,13 @@
             WebInspector.debuggerManager.addBreakpoint(breakpoint);
             InspectorTest.evaluateInPage(`worker.postMessage("triggerBreakpoint")`);
             WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
-                InspectorTest.log(""); // This evaluation will pause the MainThread.
-                InspectorTest.pass("Paused");
-                InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
-                InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.Breakpoint, "Pause reason should be a breakpoint.");
-                logPauseLocation();
-                WebInspector.debuggerManager.resume().then(resolve, reject);
+                pauseTheMainThread().then(() => {
+                    InspectorTest.pass("Paused");
+                    InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
+                    InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.Breakpoint, "Pause reason should be a breakpoint.");
+                    logPauseLocation();
+                    WebInspector.debuggerManager.resume().then(resolve, reject);
+                });
             });
         }
     });
@@ -66,12 +83,13 @@
         test(resolve, reject) {
             InspectorTest.evaluateInPage(`worker.postMessage("triggerException")`);
             WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
-                InspectorTest.log(""); // This evaluation will pause the MainThread.
-                InspectorTest.pass("Paused");
-                InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
-                InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.Exception, "Pause reason should be an exception.");
-                logPauseLocation();
-                WebInspector.debuggerManager.resume().then(resolve, reject);
+                pauseTheMainThread().then(() => {
+                    InspectorTest.pass("Paused");
+                    InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
+                    InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.Exception, "Pause reason should be an exception.");
+                    logPauseLocation();
+                    WebInspector.debuggerManager.resume().then(resolve, reject);
+                });
             });
         }
     });
@@ -82,12 +100,13 @@
         test(resolve, reject) {
             InspectorTest.evaluateInPage(`worker.postMessage("triggerAssertion")`);
             WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
-                InspectorTest.log(""); // This evaluation will pause the MainThread.
-                InspectorTest.pass("Paused");
-                InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
-                InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.Assertion, "Pause reason should be an exception.");
-                logPauseLocation();
-                WebInspector.debuggerManager.resume().then(resolve, reject);
+                pauseTheMainThread().then(() => {
+                    InspectorTest.pass("Paused");
+                    InspectorTest.expectEqual(WebInspector.debuggerManager.activeCallFrame.target, workerTarget, "Should be paused in a Worker CallFrame.");
+                    InspectorTest.expectEqual(workerDebuggerData.pauseReason, WebInspector.DebuggerManager.PauseReason.Assertion, "Pause reason should be an exception.");
+                    logPauseLocation();
+                    WebInspector.debuggerManager.resume().then(resolve, reject);
+                });
             });
         }
     });

Modified: trunk/Source/_javascript_Core/ChangeLog (208754 => 208755)


--- trunk/Source/_javascript_Core/ChangeLog	2016-11-15 22:02:01 UTC (rev 208754)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-11-15 22:12:50 UTC (rev 208755)
@@ -1,3 +1,14 @@
+2016-11-15  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: inspector/worker/debugger-pause.html fails on WebKit1
+        https://bugs.webkit.org/show_bug.cgi?id=164787
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/agents/InspectorDebuggerAgent.cpp:
+        (Inspector::InspectorDebuggerAgent::cancelPauseOnNextStatement):
+        Clear this DebuggerAgent state when we resume.
+
 2016-11-15  Filip Pizlo  <[email protected]>
 
         It should be possible to disable concurrent GC timeslicing

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (208754 => 208755)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2016-11-15 22:02:01 UTC (rev 208754)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2016-11-15 22:12:50 UTC (rev 208755)
@@ -598,6 +598,8 @@
     if (!m_javaScriptPauseScheduled)
         return;
 
+    m_javaScriptPauseScheduled = false;
+
     clearBreakDetails();
     m_scriptDebugServer.setPauseOnNextStatement(false);
     m_enablePauseWhenIdle = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to