Title: [112841] trunk
Revision
112841
Author
podivi...@chromium.org
Date
2012-04-02 02:29:24 -0700 (Mon, 02 Apr 2012)

Log Message

Web Inspector: breakpoints are not shown in sidebar pane after switching pretty-print mode.
https://bugs.webkit.org/show_bug.cgi?id=82768

Reviewed by Yury Semikhatsky.

Source/WebCore:

When UISourceCode is replaced with another in ScriptsPanel, newly added
UISourceCode could already have breakpoints. We should iterate over existing
breakpoints and add them to sidebar pane.

* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._uiSourceCodeReplaced):

LayoutTests:

* inspector/debugger/script-formatter-breakpoints-expected.txt:
* inspector/debugger/script-formatter-breakpoints.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (112840 => 112841)


--- trunk/LayoutTests/ChangeLog	2012-04-02 09:18:01 UTC (rev 112840)
+++ trunk/LayoutTests/ChangeLog	2012-04-02 09:29:24 UTC (rev 112841)
@@ -1,3 +1,13 @@
+2012-04-02  Pavel Podivilov  <podivi...@chromium.org>
+
+        Web Inspector: breakpoints are not shown in sidebar pane after switching pretty-print mode.
+        https://bugs.webkit.org/show_bug.cgi?id=82768
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/debugger/script-formatter-breakpoints-expected.txt:
+        * inspector/debugger/script-formatter-breakpoints.html:
+
 2012-04-02  Kent Tamura  <tk...@chromium.org>
 
         Add a calendar picker indicator to date-type input fields

Modified: trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt (112840 => 112841)


--- trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt	2012-04-02 09:18:01 UTC (rev 112840)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt	2012-04-02 09:29:24 UTC (rev 112841)
@@ -4,12 +4,30 @@
 
 Running: testBreakpointsInOriginalAndFormattedSource
 Script execution paused.
+
+Dump breakpoint sidebar pane:
+
+    script-formatter-breakpoints.html:11
+    var f=0;
 Script execution resumed.
 Page reloaded.
 Navigated to test-navigation.html
 Page reloaded.
 Navigated back to test page.
+
+Dump breakpoint sidebar pane:
+
 Script execution paused.
+
+Dump breakpoint sidebar pane:
+
+    script-formatter-breakpoints.html:25
+    return 0;
 Script execution resumed.
+
+Dump breakpoint sidebar pane:
+
+    script-formatter-breakpoints.html:11
+    var f=0;
 Debugger was disabled.
 

Modified: trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html (112840 => 112841)


--- trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html	2012-04-02 09:18:01 UTC (rev 112840)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html	2012-04-02 09:29:24 UTC (rev 112841)
@@ -39,6 +39,7 @@
             function pausedInF1(callFrames)
             {
                 InspectorTest.assertEquals("f1", callFrames[0].functionName);
+                dumpBreakpointSidebarPane();
                 InspectorTest.resumeExecution(resumed);
             }
 
@@ -62,6 +63,7 @@
             function didNavigateBack()
             {
                 InspectorTest.addResult("Navigated back to test page.");
+                dumpBreakpointSidebarPane();
                 InspectorTest.showScriptSource("script-formatter-breakpoints.html", didShowFormattedScriptSource);
             }
 
@@ -77,11 +79,26 @@
             function pausedInF2(callFrames)
             {
                 InspectorTest.assertEquals("f2", callFrames[0].functionName);
+                dumpBreakpointSidebarPane();
                 panel._toggleFormatSource();
-                InspectorTest.resumeExecution(next);
+                InspectorTest.resumeExecution(resumedF2);
             }
+
+            function resumedF2()
+            {
+                dumpBreakpointSidebarPane();
+                next();
+            }
         }
     ]);
+
+    function dumpBreakpointSidebarPane()
+    {
+        var paneElement = WebInspector.panels.scripts.sidebarPanes.jsBreakpoints.listElement
+        InspectorTest.addResult("");
+        InspectorTest.addResult("Dump breakpoint sidebar pane:");
+        InspectorTest.addResult(InspectorTest.textContentWithLineBreaks(paneElement));
+    }
 }
 
 </script>

Modified: trunk/Source/WebCore/ChangeLog (112840 => 112841)


--- trunk/Source/WebCore/ChangeLog	2012-04-02 09:18:01 UTC (rev 112840)
+++ trunk/Source/WebCore/ChangeLog	2012-04-02 09:29:24 UTC (rev 112841)
@@ -1,3 +1,17 @@
+2012-04-02  Pavel Podivilov  <podivi...@chromium.org>
+
+        Web Inspector: breakpoints are not shown in sidebar pane after switching pretty-print mode.
+        https://bugs.webkit.org/show_bug.cgi?id=82768
+
+        Reviewed by Yury Semikhatsky.
+
+        When UISourceCode is replaced with another in ScriptsPanel, newly added
+        UISourceCode could already have breakpoints. We should iterate over existing
+        breakpoints and add them to sidebar pane.
+
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._uiSourceCodeReplaced):
+
 2012-04-02  Eric Seidel  <e...@webkit.org>
 
         Teach RuleSet about modern memory management

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (112840 => 112841)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-04-02 09:18:01 UTC (rev 112840)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-04-02 09:29:24 UTC (rev 112841)
@@ -597,8 +597,13 @@
 
         for (var i = 0; i < oldUISourceCodeList.length; ++i)
             this._removeBreakpointListeners(oldUISourceCodeList[i]);
-        for (var i = 0; i < uiSourceCodeList.length; ++i)
-            this._addBreakpointListeners(uiSourceCodeList[i]);
+        for (var i = 0; i < uiSourceCodeList.length; ++i) {
+            var uiSourceCode = uiSourceCodeList[i];
+            var breakpoints = uiSourceCode.breakpoints();
+            for (var lineNumber in breakpoints)
+                this._uiBreakpointAdded({ data: breakpoints[lineNumber] });
+            this._addBreakpointListeners(uiSourceCode);
+        }
     },
 
     _sourceFrameLoaded: function(event)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to