Title: [113432] branches/chromium/1084
Revision
113432
Author
[email protected]
Date
2012-04-06 07:24:54 -0700 (Fri, 06 Apr 2012)

Log Message

Merge 112841 - 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:

[email protected]
BUG=122184
Review URL: https://chromiumcodereview.appspot.com/10005037

Modified Paths

Diff

Modified: branches/chromium/1084/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt (113431 => 113432)


--- branches/chromium/1084/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt	2012-04-06 14:10:43 UTC (rev 113431)
+++ branches/chromium/1084/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt	2012-04-06 14:24:54 UTC (rev 113432)
@@ -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: branches/chromium/1084/LayoutTests/inspector/debugger/script-formatter-breakpoints.html (113431 => 113432)


--- branches/chromium/1084/LayoutTests/inspector/debugger/script-formatter-breakpoints.html	2012-04-06 14:10:43 UTC (rev 113431)
+++ branches/chromium/1084/LayoutTests/inspector/debugger/script-formatter-breakpoints.html	2012-04-06 14:24:54 UTC (rev 113432)
@@ -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: branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsPanel.js (113431 => 113432)


--- branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-04-06 14:10:43 UTC (rev 113431)
+++ branches/chromium/1084/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-04-06 14:24:54 UTC (rev 113432)
@@ -598,8 +598,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
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to