Title: [124867] trunk
Revision
124867
Author
vse...@chromium.org
Date
2012-08-07 01:39:00 -0700 (Tue, 07 Aug 2012)

Log Message

Web Inspector: [regression r121673] restore link between the command and the result.
https://bugs.webkit.org/show_bug.cgi?id=93280

Patch by Pavel Feldman <pfeld...@chromium.org> on 2012-08-07
Reviewed by Vsevolod Vlasov.

Source/WebCore:

Passing lost parameter along.

Test: inspector/console/console-originating-command.html

* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype.runScript.runCallback):
(WebInspector.ConsoleView.prototype.runScript):
(WebInspector.ConsoleView.prototype._printResult):

LayoutTests:

* http/tests/inspector/console-test.js:
(initialize_ConsoleTest.InspectorTest.dumpConsoleMessages):
* inspector/console/console-originating-command-expected.txt: Added.
* inspector/console/console-originating-command.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (124866 => 124867)


--- trunk/LayoutTests/ChangeLog	2012-08-07 08:33:53 UTC (rev 124866)
+++ trunk/LayoutTests/ChangeLog	2012-08-07 08:39:00 UTC (rev 124867)
@@ -1,3 +1,15 @@
+2012-08-07  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: [regression r121673] restore link between the command and the result.
+        https://bugs.webkit.org/show_bug.cgi?id=93280
+
+        Reviewed by Vsevolod Vlasov.
+
+        * http/tests/inspector/console-test.js:
+        (initialize_ConsoleTest.InspectorTest.dumpConsoleMessages):
+        * inspector/console/console-originating-command-expected.txt: Added.
+        * inspector/console/console-originating-command.html: Added.
+
 2012-08-07  Seokju Kwon  <seokju.k...@samsung.com>
 
         [EFL] Move some inspector tests into TestExpectations

Modified: trunk/LayoutTests/http/tests/inspector/console-test.js (124866 => 124867)


--- trunk/LayoutTests/http/tests/inspector/console-test.js	2012-08-07 08:33:53 UTC (rev 124866)
+++ trunk/LayoutTests/http/tests/inspector/console-test.js	2012-08-07 08:39:00 UTC (rev 124867)
@@ -6,13 +6,17 @@
     WebInspector.drawer.immediatelyFinishAnimation();
 }
 
-InspectorTest.dumpConsoleMessages = function()
+InspectorTest.dumpConsoleMessages = function(printOriginatingCommand)
 {
     var result = [];
     var messages = WebInspector.consoleView.messages;
     for (var i = 0; i < messages.length; ++i) {
         var element = messages[i].toMessageElement();
         InspectorTest.addResult(element.textContent.replace(/\u200b/g, ""));
+        if (printOriginatingCommand && messages[i].originatingCommand) {
+          var originatingElement = messages[i].originatingCommand.toMessageElement();
+          InspectorTest.addResult("Originating from: " + originatingElement.textContent.replace(/\u200b/g, ""));
+      }
     }
     return result;
 }

Added: trunk/LayoutTests/inspector/console/console-originating-command-expected.txt (0 => 124867)


--- trunk/LayoutTests/inspector/console/console-originating-command-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/console/console-originating-command-expected.txt	2012-08-07 08:39:00 UTC (rev 124867)
@@ -0,0 +1,6 @@
+Tests that console result has originating command associated with it.
+
+1 + 1
+2
+Originating from: 1 + 1
+
Property changes on: trunk/LayoutTests/inspector/console/console-originating-command-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/console/console-originating-command.html (0 => 124867)


--- trunk/LayoutTests/inspector/console/console-originating-command.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/console/console-originating-command.html	2012-08-07 08:39:00 UTC (rev 124867)
@@ -0,0 +1,26 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function test()
+{
+    InspectorTest.evaluateInConsole("1 + 1", step1);
+    function step1()
+    {
+        InspectorTest.dumpConsoleMessages(true);
+        InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+    Tests that console result has originating command associated with it.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/console/console-originating-command.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (124866 => 124867)


--- trunk/Source/WebCore/ChangeLog	2012-08-07 08:33:53 UTC (rev 124866)
+++ trunk/Source/WebCore/ChangeLog	2012-08-07 08:39:00 UTC (rev 124867)
@@ -1,3 +1,19 @@
+2012-08-07  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: [regression r121673] restore link between the command and the result.
+        https://bugs.webkit.org/show_bug.cgi?id=93280
+
+        Reviewed by Vsevolod Vlasov.
+
+        Passing lost parameter along.
+
+        Test: inspector/console/console-originating-command.html
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype.runScript.runCallback):
+        (WebInspector.ConsoleView.prototype.runScript):
+        (WebInspector.ConsoleView.prototype._printResult):
+
 2012-08-07  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
 
         CUSTOM_SCHEME_HANDLER flag should depend on REGISTER_PROTOCOL_HANDLER

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (124866 => 124867)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2012-08-07 08:33:53 UTC (rev 124866)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2012-08-07 08:39:00 UTC (rev 124867)
@@ -725,16 +725,16 @@
                 return;
             }
             
-            this._printResult(result, wasThrown);
+            this._printResult(result, wasThrown, null);
         }
     },
 
-    _printResult: function(result, wasThrown)
+    _printResult: function(result, wasThrown, originatingCommand)
     {
         if (!result)
             return;
 
-        this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, null, this._linkifier));
+        this._appendConsoleMessage(new WebInspector.ConsoleCommandResult(result, wasThrown, originatingCommand, this._linkifier));
     },
 
     _appendCommand: function(text, newPromptText, useCommandLineAPI, showResultOnly)
@@ -756,7 +756,7 @@
                 WebInspector.settings.consoleHistory.set(this.prompt.historyData.slice(-30));
             }
             
-            this._printResult(result, wasThrown);
+            this._printResult(result, wasThrown, commandMessage);
         }
         this.evalInInspectedWindow(text, "console", useCommandLineAPI, false, false, printResult.bind(this));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to