Title: [99405] trunk
Revision
99405
Author
[email protected]
Date
2011-11-07 04:19:57 -0800 (Mon, 07 Nov 2011)

Log Message

Web Inspector: split script-formatter test into multiple tests.
https://bugs.webkit.org/show_bug.cgi?id=71607

Patch by Pavel Feldman <[email protected]> on 2011-11-07
Reviewed by Yury Semikhatsky.

Source/WebCore:

Tests: inspector/debugger/script-formatter-breakpoints.html
       inspector/debugger/script-formatter-console.html

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

LayoutTests:

* inspector/debugger/script-formatter-breakpoints-expected.txt: Added.
* inspector/debugger/script-formatter-breakpoints.html: Added.
* inspector/debugger/script-formatter-console-expected.txt: Added.
* inspector/debugger/script-formatter-console.html: Added.
* inspector/debugger/script-formatter-expected.txt:
* inspector/debugger/script-formatter.html:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (99404 => 99405)


--- trunk/LayoutTests/ChangeLog	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/LayoutTests/ChangeLog	2011-11-07 12:19:57 UTC (rev 99405)
@@ -1,3 +1,20 @@
+2011-11-07  Pavel Feldman  <[email protected]>
+
+        Web Inspector: split script-formatter test into multiple tests.
+        https://bugs.webkit.org/show_bug.cgi?id=71607
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/debugger/script-formatter-breakpoints-expected.txt: Added.
+        * inspector/debugger/script-formatter-breakpoints.html: Added.
+        * inspector/debugger/script-formatter-console-expected.txt: Added.
+        * inspector/debugger/script-formatter-console.html: Added.
+        * inspector/debugger/script-formatter-expected.txt:
+        * inspector/debugger/script-formatter.html:
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2011-11-07  Philippe Normand  <[email protected]>
 
         Unreviewed, fast/dom/gc-11.html is now passing on GTK, it seems.

Added: trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt (0 => 99405)


--- trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt	2011-11-07 12:19:57 UTC (rev 99405)
@@ -0,0 +1,15 @@
+Tests the script formatting is working fine with breakpoints.
+
+Debugger was enabled.
+
+Running: testBreakpointsInOriginalAndFormattedSource
+Script execution paused.
+Script execution resumed.
+Page reloaded.
+Navigated to test-navigation.html
+Page reloaded.
+Navigated back to test page.
+Script execution paused.
+Script execution resumed.
+Debugger was disabled.
+
Property changes on: trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html (0 => 99405)


--- trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html	2011-11-07 12:19:57 UTC (rev 99405)
@@ -0,0 +1,96 @@
+<html>
+<head>
+<script src=""
+<script src=""
+
+<script>
+
+function f1()
+{
+    var a=0;var b=1;var c=3;var d=4;var e=5;
+    var f=0;
+    return 0;
+}
+
+function f2()
+{
+    var x = 0;
+    return 0;
+}
+
+var test = function()
+{
+    var panel = WebInspector.panels.scripts;
+
+    InspectorTest.runDebuggerTestSuite([
+        function testBreakpointsInOriginalAndFormattedSource(next)
+        {
+            var root;
+            InspectorTest.showScriptSource("script-formatter-breakpoints.html", didShowScriptSource);
+
+            function didShowScriptSource(sourceFrame)
+            {
+                root = sourceFrame._url.substr(0, sourceFrame._url.lastIndexOf("/") + 1);
+                InspectorTest.setBreakpoint(sourceFrame, 10, "", true);
+                InspectorTest.waitUntilPaused(pausedInF1);
+                InspectorTest.evaluateInPageWithTimeout("f1()");
+            }
+
+            function pausedInF1(callFrames)
+            {
+                InspectorTest.assertEquals("f1", callFrames[0].functionName);
+                InspectorTest.resumeExecution(resumed);
+            }
+
+            function resumed()
+            {
+                InspectorTest.navigate(root + "resources/test-navigation.html", didNavigateAnotherPage);
+            }
+
+            function didNavigateAnotherPage()
+            {
+                InspectorTest.addResult("Navigated to test-navigation.html");
+                panel._toggleFormatSource();
+                InspectorTest.showScriptSource("test-navigation.html", didShowAnotherPage);
+            }
+
+            function didShowAnotherPage(sourceFrame)
+            {
+                InspectorTest.navigate(root + "script-formatter-breakpoints.html", didNavigateBack);
+            }
+
+            function didNavigateBack()
+            {
+                InspectorTest.addResult("Navigated back to test page.");
+                InspectorTest.showScriptSource("script-formatter-breakpoints.html", didShowFormattedScriptSource);
+            }
+
+            function didShowFormattedScriptSource(sourceFrame)
+            {
+                // There should be no breakpoint in f1 since script is pretty-printed now.
+                InspectorTest.evaluateInPageWithTimeout("f1()");
+                InspectorTest.setBreakpoint(panel.visibleView, 24, "", true);
+                InspectorTest.waitUntilPaused(pausedInF2);
+                InspectorTest.evaluateInPageWithTimeout("f2()");
+            }
+
+            function pausedInF2(callFrames)
+            {
+                InspectorTest.assertEquals("f2", callFrames[0].functionName);
+                panel._toggleFormatSource();
+                InspectorTest.resumeExecution(next);
+            }
+        }
+    ]);
+}
+
+</script>
+
+</head>
+
+<body _onload_="runTest()">
+<p>Tests the script formatting is working fine with breakpoints.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/debugger/script-formatter-breakpoints.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/debugger/script-formatter-console-expected.txt (0 => 99405)


--- trunk/LayoutTests/inspector/debugger/script-formatter-console-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-console-expected.txt	2011-11-07 12:19:57 UTC (rev 99405)
@@ -0,0 +1,10 @@
+CONSOLE MESSAGE: line 10: Test message.
+Tests that the script formatting changes console line numbers.
+
+Debugger was enabled.
+
+Running: testConsoleMessagesForFormattedScripts
+script-formatter-console.html:10
+script-formatter-console.html:13
+Debugger was disabled.
+
Property changes on: trunk/LayoutTests/inspector/debugger/script-formatter-console-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/debugger/script-formatter-console.html (0 => 99405)


--- trunk/LayoutTests/inspector/debugger/script-formatter-console.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-console.html	2011-11-07 12:19:57 UTC (rev 99405)
@@ -0,0 +1,63 @@
+<html>
+<head>
+<script src=""
+<script src=""
+
+<script>
+
+function f1()
+{
+    console.log("Test message.");
+}
+
+var test = function()
+{
+    var panel = WebInspector.panels.scripts;
+    var worker = new Worker("ScriptFormatterWorker.js");
+
+    InspectorTest.runDebuggerTestSuite([
+        function testConsoleMessagesForFormattedScripts(next)
+        {
+            InspectorTest.showScriptSource("script-formatter-console.html", didShowScriptSource);
+
+            function didShowScriptSource(sourceFrame)
+            {
+                InspectorTest.evaluateInPage("f1()", didEvaluate);
+            }
+
+            function didEvaluate()
+            {
+                dumpConsoleMessageURLs();
+                InspectorTest.addSniffer(WebInspector, "formatLinkText", setTimeout.bind(window, didFormatLinkText, 0));
+                panel._toggleFormatSource();
+            }
+
+            function didFormatLinkText()
+            {
+                dumpConsoleMessageURLs();
+                next();
+            }
+        }
+    ]);
+
+    function dumpConsoleMessageURLs()
+    {
+        var messages = WebInspector.console.messages;
+        for (var i = 0; i < messages.length; ++i) {
+            var element = messages[i].toMessageElement();
+            var anchor = element.querySelector(".console-message-url");
+            InspectorTest.addResult(anchor.textContent);
+        }
+    }
+}
+
+</script>
+
+</head>
+
+<body _onload_="runTest()">
+<p>Tests that the script formatting changes console line numbers.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/debugger/script-formatter-console.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/inspector/debugger/script-formatter-expected.txt (99404 => 99405)


--- trunk/LayoutTests/inspector/debugger/script-formatter-expected.txt	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/LayoutTests/inspector/debugger/script-formatter-expected.txt	2011-11-07 12:19:57 UTC (rev 99405)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: line 24: Test message.
 Tests the script formatting functionality.
 
 Debugger was enabled.
@@ -15,19 +14,5 @@
 function g() {
 }
 </script></body></html>
-
-Running: testBreakpointsInOriginalAndFormattedSource
-Script execution paused.
-Script execution resumed.
-Page reloaded.
-Navigated to test-navigation.html
-Page reloaded.
-Navigated back to test page.
-Script execution paused.
-Script execution resumed.
-
-Running: testConsoleMessagesForFormattedScripts
-script-formatter.html:24
-script-formatter.html:32
 Debugger was disabled.
 

Modified: trunk/LayoutTests/inspector/debugger/script-formatter.html (99404 => 99405)


--- trunk/LayoutTests/inspector/debugger/script-formatter.html	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/LayoutTests/inspector/debugger/script-formatter.html	2011-11-07 12:19:57 UTC (rev 99405)
@@ -6,24 +6,6 @@
 
 <script>
 
-function f1()
-{
-    var a=0;var b=1;var c=3;var d=4;var e=5;
-    var f=0;
-    return 0;
-}
-
-function f2()
-{
-    var x = 0;
-    return 0;
-}
-
-function f3()
-{
-    console.log("Test message.");
-}
-
 var test = function()
 {
     var panel = WebInspector.panels.scripts;
@@ -108,92 +90,6 @@
 
             var content = "<html><body><script>function f(){}<" + "/script><script>function g(){}<" + "/script></body></html>";
             worker.postMessage({ mimeType: "text/html", content: content });
-        },
-
-        function testBreakpointsInOriginalAndFormattedSource(next)
-        {
-            var root;
-            InspectorTest.showScriptSource("script-formatter.html", didShowScriptSource);
-
-            function didShowScriptSource(sourceFrame)
-            {
-                root = sourceFrame._url.substr(0, sourceFrame._url.lastIndexOf("/") + 1);
-                InspectorTest.setBreakpoint(sourceFrame, 11, "", true);
-                InspectorTest.waitUntilPaused(pausedInF1);
-                InspectorTest.evaluateInPageWithTimeout("f1()");
-            }
-
-            function pausedInF1(callFrames)
-            {
-                InspectorTest.assertEquals("f1", callFrames[0].functionName);
-                InspectorTest.resumeExecution(resumed);
-            }
-
-            function resumed()
-            {
-                InspectorTest.navigate(root + "resources/test-navigation.html", didNavigateAnotherPage);
-            }
-
-            function didNavigateAnotherPage()
-            {
-                InspectorTest.addResult("Navigated to test-navigation.html");
-                panel._toggleFormatSource();
-                InspectorTest.showScriptSource("test-navigation.html", didShowAnotherPage);
-            }
-
-            function didShowAnotherPage(sourceFrame)
-            {
-                InspectorTest.navigate(root + "script-formatter.html", didNavigateBack);
-            }
-
-            function didNavigateBack()
-            {
-                InspectorTest.addResult("Navigated back to test page.");
-                InspectorTest.showScriptSource("script-formatter.html", didShowFormattedScriptSource);
-            }
-
-            function didShowFormattedScriptSource(sourceFrame)
-            {
-                // There should be no breakpoint in f1 since script is pretty-printed now.
-                InspectorTest.evaluateInPageWithTimeout("f1()");
-                InspectorTest.setBreakpoint(panel.visibleView, 24, "", true);
-                InspectorTest.waitUntilPaused(pausedInF2);
-                InspectorTest.evaluateInPageWithTimeout("f2()");
-            }
-
-            function pausedInF2(callFrames)
-            {
-                InspectorTest.assertEquals("f2", callFrames[0].functionName);
-                panel._toggleFormatSource();
-                InspectorTest.resumeExecution(next);
-            }
-        },
-
-        function testConsoleMessagesForFormattedScripts(next)
-        {
-            function dumpConsoleMessageURLs()
-            {
-                var messages = WebInspector.console.messages;
-                for (var i = 0; i < messages.length; ++i) {
-                    var element = messages[i].toMessageElement();
-                    var anchor = element.querySelector(".console-message-url");
-                    InspectorTest.addResult(anchor.textContent);
-                }
-            }
-            InspectorTest.evaluateInPage("f3()", didEvaluate);
-
-            function didEvaluate()
-            {
-                dumpConsoleMessageURLs();
-                InspectorTest.addSniffer(WebInspector, "formatLinkText", setTimeout.bind(window, didFormatLinkText, 0));
-                panel._toggleFormatSource();
-            }
-
-            function didFormatLinkText()
-            {
-                dumpConsoleMessageURLs();
-                next();
-            }
         }
     ]);
 }

Modified: trunk/LayoutTests/platform/mac/Skipped (99404 => 99405)


--- trunk/LayoutTests/platform/mac/Skipped	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/LayoutTests/platform/mac/Skipped	2011-11-07 12:19:57 UTC (rev 99405)
@@ -486,5 +486,3 @@
 # It needs a rebaseline
 fast/repaint/table-extra-bottom-grow.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=71581
-inspector/debugger/script-formatter.html

Modified: trunk/LayoutTests/platform/qt/Skipped (99404 => 99405)


--- trunk/LayoutTests/platform/qt/Skipped	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/LayoutTests/platform/qt/Skipped	2011-11-07 12:19:57 UTC (rev 99405)
@@ -2432,10 +2432,6 @@
 # https://bugs.webkit.org/show_bug.cgi?id=69719
 fast/text/line-initial-and-final-swashes.html
 
-# [Qt] inspector/debugger/script-formatter.html failed after r97056
-# https://bugs.webkit.org/show_bug.cgi?id=69757
-inspector/debugger/script-formatter.html
-
 # [Qt] Assertion fail in CSSPrimitiveValue ctor
 # https://bugs.webkit.org/show_bug.cgi?id=69933
 fast/borders/inline-mask-overlay-image-outset-vertical-rl.html

Modified: trunk/LayoutTests/platform/win/Skipped (99404 => 99405)


--- trunk/LayoutTests/platform/win/Skipped	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/LayoutTests/platform/win/Skipped	2011-11-07 12:19:57 UTC (rev 99405)
@@ -1444,5 +1444,3 @@
 fast/events/platform-wheelevent-paging-y-in-scrolling-div.html
 fast/events/platform-wheelevent-paging-y-in-scrolling-page.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=71581
-inspector/debugger/script-formatter.html

Modified: trunk/Source/WebCore/ChangeLog (99404 => 99405)


--- trunk/Source/WebCore/ChangeLog	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/Source/WebCore/ChangeLog	2011-11-07 12:19:57 UTC (rev 99405)
@@ -1,3 +1,16 @@
+2011-11-07  Pavel Feldman  <[email protected]>
+
+        Web Inspector: split script-formatter test into multiple tests.
+        https://bugs.webkit.org/show_bug.cgi?id=71607
+
+        Reviewed by Yury Semikhatsky.
+
+        Tests: inspector/debugger/script-formatter-breakpoints.html
+               inspector/debugger/script-formatter-console.html
+
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._removeSourceFrame):
+
 2011-11-07  Keishi Hattori  <[email protected]>
 
         Change ColorChooser from singleton to ordinary object

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


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-11-07 11:46:23 UTC (rev 99404)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2011-11-07 12:19:57 UTC (rev 99405)
@@ -657,7 +657,8 @@
     _removeSourceFrame: function(uiSourceCode)
     {
         var option = uiSourceCode._option;
-        if (option)
+        // FIXME: find out why we are getting here with option detached.
+        if (option && this._filesSelectElement === option.parentElement)
             this._filesSelectElement.removeChild(option);
 
         var sourceFrame = uiSourceCode._sourceFrame;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to