Title: [89346] trunk
Revision
89346
Author
podivi...@chromium.org
Date
2011-06-21 03:30:11 -0700 (Tue, 21 Jun 2011)

Log Message

2011-06-17  Pavel Podivilov  <podivi...@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: can't set breakpoint on the last script line.
        https://bugs.webkit.org/show_bug.cgi?id=62861

        * http/tests/inspector/debugger-test.js:
        (initialize_DebuggerTest):
        * inspector/debugger/debugger-pause-on-breakpoint-expected.txt:
        * inspector/debugger/debugger-pause-on-breakpoint.html:
2011-06-17  Pavel Podivilov  <podivi...@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: can't set breakpoint on the last script line.
        https://bugs.webkit.org/show_bug.cgi?id=62861

        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::resolveBreakpoint):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89345 => 89346)


--- trunk/LayoutTests/ChangeLog	2011-06-21 09:58:15 UTC (rev 89345)
+++ trunk/LayoutTests/ChangeLog	2011-06-21 10:30:11 UTC (rev 89346)
@@ -1,3 +1,15 @@
+2011-06-17  Pavel Podivilov  <podivi...@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: can't set breakpoint on the last script line.
+        https://bugs.webkit.org/show_bug.cgi?id=62861
+
+        * http/tests/inspector/debugger-test.js:
+        (initialize_DebuggerTest):
+        * inspector/debugger/debugger-pause-on-breakpoint-expected.txt:
+        * inspector/debugger/debugger-pause-on-breakpoint.html:
+
 2011-06-20  Yury Semikhatsky  <yu...@chromium.org>
 
         Reviewed by Pavel Feldman.

Modified: trunk/LayoutTests/http/tests/inspector/debugger-test.js (89345 => 89346)


--- trunk/LayoutTests/http/tests/inspector/debugger-test.js	2011-06-21 09:58:15 UTC (rev 89345)
+++ trunk/LayoutTests/http/tests/inspector/debugger-test.js	2011-06-21 10:30:11 UTC (rev 89346)
@@ -2,7 +2,8 @@
 
 InspectorTest.startDebuggerTest = function(callback, quiet)
 {
-    InspectorTest._quiet = quiet;
+    if (quiet !== undefined)
+        InspectorTest._quiet = quiet;
     WebInspector.showPanel("scripts");
 
     if (WebInspector.panels.scripts._debuggerEnabled)
@@ -173,7 +174,12 @@
     sourceFrame._delegate.setBreakpoint(lineNumber, condition, enabled);
 };
 
+InspectorTest.removeBreakpoint = function(sourceFrame, lineNumber)
+{
+    sourceFrame._delegate.removeBreakpoint(lineNumber);
+};
 
+
 InspectorTest.expandProperties = function(properties, callback)
 {
     var index = 0;
@@ -219,4 +225,9 @@
     }
 };
 
+InspectorTest.setQuiet = function(quiet)
+{
+    InspectorTest._quiet = quiet;
 };
+
+};

Modified: trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt (89345 => 89346)


--- trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt	2011-06-21 09:58:15 UTC (rev 89345)
+++ trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt	2011-06-21 10:30:11 UTC (rev 89346)
@@ -1,11 +1,21 @@
 Tests that debugger will stop on breakpoint.
 
 Debugger was enabled.
+
+Running: testSetBreakpoint
 Script source was shown.
 Set timer for test function.
 Script execution paused.
 Call stack:
-    0) testFunction (debugger-pause-on-breakpoint.html:9)
+    0) testFunction (debugger-pause-on-breakpoint.html:17)
 Script execution resumed.
+
+Running: testSetBreakpointOnTheLastLine
+Call stack:
+    0) oneLineTestFunction (debugger-pause-on-breakpoint.html:7)
+
+Running: testSetBreakpointOnTheLastLine2
+Call stack:
+    0) oneLineTestFunction2 (debugger-pause-on-breakpoint.html:11)
 Debugger was disabled.
 

Modified: trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html (89345 => 89346)


--- trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html	2011-06-21 09:58:15 UTC (rev 89345)
+++ trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html	2011-06-21 10:30:11 UTC (rev 89346)
@@ -2,8 +2,16 @@
 <head>
 <script src=""
 <script src=""
+
 <script>
+function oneLineTestFunction() { return 0; }
+</script>
 
+<script>
+function oneLineTestFunction2() { return 0; }</script>
+
+<script>
+
 function testFunction()
 {
     var x = Math.sqrt(10);
@@ -12,25 +20,76 @@
 
 var test = function()
 {
-    InspectorTest.startDebuggerTest(step1);
+    var currentSourceFrame;
+    InspectorTest.setQuiet(true);
+    InspectorTest.runDebuggerTestSuite([
+        function testSetBreakpoint(next)
+        {
+            InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", didShowScriptSource);
 
-    function step1()
-    {
-        InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", step2);
-    }
+            function didShowScriptSource(sourceFrame)
+            {
+                currentSourceFrame = sourceFrame;
+                InspectorTest.addResult("Script source was shown.");
+                InspectorTest.setBreakpoint(currentSourceFrame, 16, "", true);
+                InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
+            }
 
-    function step2(sourceFrame)
-    {
-        InspectorTest.addResult("Script source was shown.");
-        InspectorTest.setBreakpoint(sourceFrame, 8, "", true);
-        InspectorTest.runTestFunctionAndWaitUntilPaused(step3);
-    }
+            function didPaused(callFrames)
+            {
+                InspectorTest.addResult("Script execution paused.");
+                InspectorTest.captureStackTrace(callFrames);
+                InspectorTest.removeBreakpoint(currentSourceFrame, 16);
+                InspectorTest.resumeExecution(didResume);
+            }
 
-    function step3(callFrames)
-    {
-        InspectorTest.captureStackTrace(callFrames);
-        InspectorTest.completeDebuggerTest();
-    }
+            function didResume()
+            {
+                InspectorTest.addResult("Script execution resumed.");
+                next();
+            }
+        },
+
+        function testSetBreakpointOnTheLastLine(next)
+        {
+            InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", didShowScriptSource);
+
+            function didShowScriptSource(sourceFrame)
+            {
+                currentSourceFrame = sourceFrame;
+                InspectorTest.setBreakpoint(currentSourceFrame, 6, "", true);
+                InspectorTest.waitUntilPaused(didPaused);
+                InspectorTest.evaluateInPage("setTimeout(oneLineTestFunction, 0)");
+            }
+
+            function didPaused(callFrames)
+            {
+                InspectorTest.captureStackTrace(callFrames);
+                InspectorTest.removeBreakpoint(currentSourceFrame, 6);
+                InspectorTest.resumeExecution(next);
+            }
+        },
+
+        function testSetBreakpointOnTheLastLine2(next)
+        {
+            InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", didShowScriptSource);
+
+            function didShowScriptSource(sourceFrame)
+            {
+                currentSourceFrame = sourceFrame;
+                InspectorTest.setBreakpoint(currentSourceFrame, 10, "", true);
+                InspectorTest.waitUntilPaused(didPaused);
+                InspectorTest.evaluateInPage("setTimeout(oneLineTestFunction2, 0)");
+            }
+
+            function didPaused(callFrames)
+            {
+                InspectorTest.captureStackTrace(callFrames);
+                InspectorTest.removeBreakpoint(currentSourceFrame, 10);
+                InspectorTest.resumeExecution(next);
+            }
+        }
+    ]);
 }
 
 </script>

Modified: trunk/Source/WebCore/ChangeLog (89345 => 89346)


--- trunk/Source/WebCore/ChangeLog	2011-06-21 09:58:15 UTC (rev 89345)
+++ trunk/Source/WebCore/ChangeLog	2011-06-21 10:30:11 UTC (rev 89346)
@@ -1,3 +1,13 @@
+2011-06-17  Pavel Podivilov  <podivi...@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: can't set breakpoint on the last script line.
+        https://bugs.webkit.org/show_bug.cgi?id=62861
+
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
+
 2011-06-20  Yury Semikhatsky  <yu...@chromium.org>
 
         Reviewed by Pavel Feldman.

Modified: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp (89345 => 89346)


--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2011-06-21 09:58:15 UTC (rev 89345)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2011-06-21 10:30:11 UTC (rev 89346)
@@ -264,7 +264,7 @@
     if (scriptIterator == m_scripts.end())
         return 0;
     Script& script = scriptIterator->second;
-    if (breakpoint.lineNumber < script.startLine || script.endLine <= breakpoint.lineNumber)
+    if (breakpoint.lineNumber < script.startLine || script.endLine < breakpoint.lineNumber)
         return 0;
 
     int actualLineNumber;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to