Title: [102919] trunk
Revision
102919
Author
[email protected]
Date
2011-12-15 04:16:04 -0800 (Thu, 15 Dec 2011)

Log Message

Web Inspector: Console should show network messages origins.
https://bugs.webkit.org/show_bug.cgi?id=74521

Reviewed by Pavel Feldman.

Source/WebCore:

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype._formatMessage):

LayoutTests:

* http/tests/inspector/console-resource-errors-expected.txt:
* http/tests/inspector/console-xhr-logging-expected.txt:
* platform/chromium/http/tests/inspector/console-resource-errors-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (102918 => 102919)


--- trunk/LayoutTests/ChangeLog	2011-12-15 12:02:55 UTC (rev 102918)
+++ trunk/LayoutTests/ChangeLog	2011-12-15 12:16:04 UTC (rev 102919)
@@ -1,3 +1,14 @@
+2011-12-14  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Console should show network messages origins.
+        https://bugs.webkit.org/show_bug.cgi?id=74521
+
+        Reviewed by Pavel Feldman.
+
+        * http/tests/inspector/console-resource-errors-expected.txt:
+        * http/tests/inspector/console-xhr-logging-expected.txt:
+        * platform/chromium/http/tests/inspector/console-resource-errors-expected.txt:
+
 2011-12-15  Rakesh KN  <[email protected]>
 
         "user-select none" causes selection to incorrectly escape from clicked container

Modified: trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt (102918 => 102919)


--- trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt	2011-12-15 12:02:55 UTC (rev 102918)
+++ trunk/LayoutTests/http/tests/inspector/console-resource-errors-expected.txt	2011-12-15 12:16:04 UTC (rev 102919)
@@ -2,7 +2,7 @@
 
 
 GET http://127.0.0.1:8000/inspector/missing.css 404 (Not Found) console-message console-error-level
-GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) console-message console-error-level
 GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-message console-error-level
-GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) console-message console-error-level
+console-resource-errors.html:18GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) console-message console-error-level
+non-existent-iframe.html:1GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) console-message console-error-level
 

Modified: trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt (102918 => 102919)


--- trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt	2011-12-15 12:02:55 UTC (rev 102918)
+++ trunk/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt	2011-12-15 12:16:04 UTC (rev 102919)
@@ -11,17 +11,17 @@
 Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled.
 
 console-xhr-logging.html:10sending a GET request to resources/xhr-exists.html
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html".
+network-test.js:39XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html".
 console-xhr-logging.html:10sending a GET request to resources/xhr-does-not-exist.html
-GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html".
+network-test.js:39GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
+network-test.js:39XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html".
 console-xhr-logging.html:10sending a POST request to resources/post-target.cgi
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi".
+network-test.js:39XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi".
 console-xhr-logging.html:10sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html
 XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
 console-xhr-logging.html:10sending a GET request to resources/xhr-exists.html
 console-xhr-logging.html:10sending a GET request to resources/xhr-does-not-exist.html
-GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
+network-test.js:39GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found)
 console-xhr-logging.html:10sending a POST request to resources/post-target.cgi
 console-xhr-logging.html:10sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html
 XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.

Modified: trunk/LayoutTests/platform/chromium/http/tests/inspector/console-resource-errors-expected.txt (102918 => 102919)


--- trunk/LayoutTests/platform/chromium/http/tests/inspector/console-resource-errors-expected.txt	2011-12-15 12:02:55 UTC (rev 102918)
+++ trunk/LayoutTests/platform/chromium/http/tests/inspector/console-resource-errors-expected.txt	2011-12-15 12:16:04 UTC (rev 102919)
@@ -1,8 +1,8 @@
 Tests that errors to load a resource cause error messages to be logged to console.
 
 
-GET http://127.0.0.1:8000/inspector/missing.css 404 (Not Found) console-message console-error-level
-GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) console-message console-error-level
-GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-message console-error-level
-GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found)loadXHRconsole-resource-errors.html:18performActionsconsole-resource-errors.html:10(anonymous function)InjectedScript._evaluateOnInjectedScript._evaluateAndWrapInjectedScript.evaluate console-message console-error-level
+console-resource-errors-iframe.html:3GET http://127.0.0.1:8000/inspector/missing.css 404 (Not Found) console-message console-error-level
+console-resource-errors-iframe.html:4GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-message console-error-level
+console-resource-errors.html:18GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found)loadXHRconsole-resource-errors.html:18performActionsconsole-resource-errors.html:10(anonymous function)InjectedScript._evaluateOnInjectedScript._evaluateAndWrapInjectedScript.evaluate console-message console-error-level
+non-existent-iframe.html:1GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) console-message console-error-level
 

Modified: trunk/Source/WebCore/ChangeLog (102918 => 102919)


--- trunk/Source/WebCore/ChangeLog	2011-12-15 12:02:55 UTC (rev 102918)
+++ trunk/Source/WebCore/ChangeLog	2011-12-15 12:16:04 UTC (rev 102919)
@@ -1,3 +1,13 @@
+2011-12-14  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Console should show network messages origins.
+        https://bugs.webkit.org/show_bug.cgi?id=74521
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessageImpl.prototype._formatMessage):
+
 2011-12-15  Rakesh KN  <[email protected]>
 
         "user-select none" causes selection to incorrectly escape from clicked container

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js (102918 => 102919)


--- trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2011-12-15 12:02:55 UTC (rev 102918)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2011-12-15 12:16:04 UTC (rev 102919)
@@ -101,6 +101,10 @@
         } else if (this.source === WebInspector.ConsoleMessage.MessageSource.Network) {
             if (this._request) {
                 this._stackTrace = this._request.stackTrace;
+                if (this._request.initiator && this._request.initiator.url) {
+                    this.url = ""
+                    this.line = this._request.initiator.lineNumber;
+                }
                 messageText = document.createElement("span");
                 if (this.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
                     messageText.appendChild(document.createTextNode(this._request.requestMethod + " "));
@@ -126,8 +130,7 @@
             messageText = this._format(args);
         }
 
-        // FIXME: we should dump network message origins as well.
-        if (this.source !== WebInspector.ConsoleMessage.MessageSource.Network) {
+        if (this.source !== WebInspector.ConsoleMessage.MessageSource.Network || this._request) {
             if (this._stackTrace && this._stackTrace.length && this._stackTrace[0].url) {
                 var urlElement = this._linkifyCallFrame(this._stackTrace[0]);
                 this._formattedMessage.appendChild(urlElement);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to