Title: [93962] trunk
Revision
93962
Author
[email protected]
Date
2011-08-29 01:53:30 -0700 (Mon, 29 Aug 2011)

Log Message

Web Inspector: Debugger.setBreakpointByUrl should return error when setting breakpoint on the same location twice.
https://bugs.webkit.org/show_bug.cgi?id=67030

Reviewed by Pavel Feldman.

Source/WebCore:

Test: inspector/debugger/set-breakpoint.html

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

LayoutTests:

* inspector/debugger/set-breakpoint-expected.txt: Renamed from LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt.
* inspector/debugger/set-breakpoint.html: Renamed from LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93961 => 93962)


--- trunk/LayoutTests/ChangeLog	2011-08-29 08:37:24 UTC (rev 93961)
+++ trunk/LayoutTests/ChangeLog	2011-08-29 08:53:30 UTC (rev 93962)
@@ -1,3 +1,13 @@
+2011-08-26  Pavel Podivilov  <[email protected]>
+
+        Web Inspector: Debugger.setBreakpointByUrl should return error when setting breakpoint on the same location twice.
+        https://bugs.webkit.org/show_bug.cgi?id=67030
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/debugger/set-breakpoint-expected.txt: Renamed from LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt.
+        * inspector/debugger/set-breakpoint.html: Renamed from LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html.
+
 2011-08-29  Pavel Podivilov  <[email protected]>
 
         Unreviewed, fix event-constructors.html test.

Deleted: trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt (93961 => 93962)


--- trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt	2011-08-29 08:37:24 UTC (rev 93961)
+++ trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt	2011-08-29 08:53:30 UTC (rev 93962)
@@ -1,21 +0,0 @@
-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: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.
-

Deleted: trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html (93961 => 93962)


--- trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html	2011-08-29 08:37:24 UTC (rev 93961)
+++ trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html	2011-08-29 08:53:30 UTC (rev 93962)
@@ -1,104 +0,0 @@
-<html>
-<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);
-    return x;
-}
-
-var test = function()
-{
-    var currentSourceFrame;
-    InspectorTest.setQuiet(true);
-    InspectorTest.runDebuggerTestSuite([
-        function testSetBreakpoint(next)
-        {
-            InspectorTest.showScriptSource("debugger-pause-on-breakpoint.html", didShowScriptSource);
-
-            function didShowScriptSource(sourceFrame)
-            {
-                currentSourceFrame = sourceFrame;
-                InspectorTest.addResult("Script source was shown.");
-                InspectorTest.setBreakpoint(currentSourceFrame, 16, "", true);
-                InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
-            }
-
-            function didPaused(callFrames)
-            {
-                InspectorTest.addResult("Script execution paused.");
-                InspectorTest.captureStackTrace(callFrames);
-                InspectorTest.removeBreakpoint(currentSourceFrame, 16);
-                InspectorTest.resumeExecution(didResume);
-            }
-
-            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>
-</head>
-
-<body _onload_="runTest()">
-<p>
-Tests that debugger will stop on breakpoint.
-</p>
-
-</body>
-</html>

Copied: trunk/LayoutTests/inspector/debugger/set-breakpoint-expected.txt (from rev 93961, trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint-expected.txt) (0 => 93962)


--- trunk/LayoutTests/inspector/debugger/set-breakpoint-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/set-breakpoint-expected.txt	2011-08-29 08:53:30 UTC (rev 93962)
@@ -0,0 +1,23 @@
+Tests setting breakpoints.
+
+Debugger was enabled.
+
+Running: testSetBreakpoint
+Script source was shown.
+Set timer for test function.
+Script execution paused.
+Call stack:
+    0) testFunction (set-breakpoint.html:17)
+Script execution resumed.
+
+Running: testSetBreakpointOnTheLastLine
+Call stack:
+    0) oneLineTestFunction (set-breakpoint.html:7)
+
+Running: testSetBreakpointOnTheLastLine2
+Call stack:
+    0) oneLineTestFunction2 (set-breakpoint.html:11)
+
+Running: testSetBreakpointOnTheSameLine
+Debugger was disabled.
+

Property changes: trunk/LayoutTests/inspector/debugger/set-breakpoint-expected.txt


Added: svn:eol-style

Copied: trunk/LayoutTests/inspector/debugger/set-breakpoint.html (from rev 93961, trunk/LayoutTests/inspector/debugger/debugger-pause-on-breakpoint.html) (0 => 93962)


--- trunk/LayoutTests/inspector/debugger/set-breakpoint.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/set-breakpoint.html	2011-08-29 08:53:30 UTC (rev 93962)
@@ -0,0 +1,123 @@
+<html>
+<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);
+    return x;
+}
+
+var test = function()
+{
+    var currentSourceFrame;
+    InspectorTest.setQuiet(true);
+    InspectorTest.runDebuggerTestSuite([
+        function testSetBreakpoint(next)
+        {
+            InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptSource);
+
+            function didShowScriptSource(sourceFrame)
+            {
+                currentSourceFrame = sourceFrame;
+                InspectorTest.addResult("Script source was shown.");
+                InspectorTest.setBreakpoint(currentSourceFrame, 16, "", true);
+                InspectorTest.runTestFunctionAndWaitUntilPaused(didPaused);
+            }
+
+            function didPaused(callFrames)
+            {
+                InspectorTest.addResult("Script execution paused.");
+                InspectorTest.captureStackTrace(callFrames);
+                InspectorTest.removeBreakpoint(currentSourceFrame, 16);
+                InspectorTest.resumeExecution(didResume);
+            }
+
+            function didResume()
+            {
+                InspectorTest.addResult("Script execution resumed.");
+                next();
+            }
+        },
+
+        function testSetBreakpointOnTheLastLine(next)
+        {
+            InspectorTest.showScriptSource("set-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("set-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);
+            }
+        },
+
+        function testSetBreakpointOnTheSameLine(next)
+        {
+            DebuggerAgent.setBreakpointByUrl(1, "foo.js", undefined, 2, "", didSetBreakpoint);
+
+            function didSetBreakpoint(error, breakpointId)
+            {
+                InspectorTest.assertTrue(!error);
+                InspectorTest.assertTrue(!!breakpointId);
+                DebuggerAgent.setBreakpointByUrl(1, "foo.js", undefined, 2, "", didSetBreakpointAgain);
+            }
+
+            function didSetBreakpointAgain(error, breakpointId)
+            {
+                InspectorTest.assertTrue(!!error);
+                InspectorTest.assertTrue(!breakpointId);
+                next();
+            }
+        }
+    ]);
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Tests setting breakpoints.
+</p>
+
+</body>
+</html>

Property changes: trunk/LayoutTests/inspector/debugger/set-breakpoint.html


Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (93961 => 93962)


--- trunk/Source/WebCore/ChangeLog	2011-08-29 08:37:24 UTC (rev 93961)
+++ trunk/Source/WebCore/ChangeLog	2011-08-29 08:53:30 UTC (rev 93962)
@@ -1,3 +1,15 @@
+2011-08-26  Pavel Podivilov  <[email protected]>
+
+        Web Inspector: Debugger.setBreakpointByUrl should return error when setting breakpoint on the same location twice.
+        https://bugs.webkit.org/show_bug.cgi?id=67030
+
+        Reviewed by Pavel Feldman.
+
+        Test: inspector/debugger/set-breakpoint.html
+
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
+
 2011-08-29  Matthew Delaney  <[email protected]>
 
         fast/canvas/shadow-offset-*.html fail on Leopard/Snow Leopard when removing the work around for <rdar://problem/5539388>.

Modified: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp (93961 => 93962)


--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2011-08-29 08:37:24 UTC (rev 93961)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp	2011-08-29 08:53:30 UTC (rev 93962)
@@ -195,8 +195,11 @@
 
     String breakpointId = (isRegex ? "/" + url + "/" : url) + ':' + String::number(lineNumber) + ':' + String::number(columnNumber);
     RefPtr<InspectorObject> breakpointsCookie = m_inspectorState->getObject(DebuggerAgentState::_javascript_Breakpoints);
-    if (breakpointsCookie->find(breakpointId) != breakpointsCookie->end())
+    if (breakpointsCookie->find(breakpointId) != breakpointsCookie->end()) {
+        *errorString = "Breakpoint at specified location already exists.";
         return;
+    }
+
     breakpointsCookie->setObject(breakpointId, buildObjectForBreakpointCookie(url, lineNumber, columnNumber, condition, isRegex));
     m_inspectorState->setObject(DebuggerAgentState::_javascript_Breakpoints, breakpointsCookie);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to