Title: [102898] trunk
Revision
102898
Author
[email protected]
Date
2011-12-15 00:52:28 -0800 (Thu, 15 Dec 2011)

Log Message

Web Inspector: [Regression] Network manager fails to show resource type and MIME type in incorrect MIME type console message.
https://bugs.webkit.org/show_bug.cgi?id=74516

Reviewed by Pavel Feldman.

Source/WebCore:

Test: http/tests/inspector/network/script-as-text-loading.html

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

LayoutTests:

* http/tests/inspector/network/resources/script-as-text.php: Added.
* http/tests/inspector/network/script-as-text-loading-expected.txt: Added.
* http/tests/inspector/network/script-as-text-loading.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (102897 => 102898)


--- trunk/LayoutTests/ChangeLog	2011-12-15 08:10:08 UTC (rev 102897)
+++ trunk/LayoutTests/ChangeLog	2011-12-15 08:52:28 UTC (rev 102898)
@@ -1,3 +1,14 @@
+2011-12-14  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: [Regression] Network manager fails to show resource type and MIME type in incorrect MIME type console message.
+        https://bugs.webkit.org/show_bug.cgi?id=74516
+
+        Reviewed by Pavel Feldman.
+
+        * http/tests/inspector/network/resources/script-as-text.php: Added.
+        * http/tests/inspector/network/script-as-text-loading-expected.txt: Added.
+        * http/tests/inspector/network/script-as-text-loading.html: Added.
+
 2011-12-15  Philippe Normand  <[email protected]>
 
         Unreviewed, GTK rebaseline after r102149 and r102846.

Added: trunk/LayoutTests/http/tests/inspector/network/resources/script-as-text.php (0 => 102898)


--- trunk/LayoutTests/http/tests/inspector/network/resources/script-as-text.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/script-as-text.php	2011-12-15 08:52:28 UTC (rev 102898)
@@ -0,0 +1,8 @@
+<?php
+    header("Content-Type: text/plain");
+?>
+
+function foo()
+{
+    var bar = 42;
+}
Property changes on: trunk/LayoutTests/http/tests/inspector/network/resources/script-as-text.php
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt (0 => 102898)


--- trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt	2011-12-15 08:52:28 UTC (rev 102898)
@@ -0,0 +1,5 @@
+Tests console message when script is loaded with incorrect text/html mime type.
+
+Bug 69972
+Resource interpreted as Script but transferred with MIME type text/plain: "http://127.0.0.1:8000/inspector/network/resources/script-as-text.php".
+
Property changes on: trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading.html (0 => 102898)


--- trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading.html	2011-12-15 08:52:28 UTC (rev 102898)
@@ -0,0 +1,30 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+function loadScript()
+{
+    var s = document.createElement("script");
+    s.src = ""
+    document.body.appendChild(s);
+}
+
+function test()
+{
+    InspectorTest.addConsoleSniffer(step1);
+    InspectorTest.evaluateInPage("loadScript()");
+
+    function step1()
+    {
+        InspectorTest.dumpConsoleMessages();
+        InspectorTest.completeTest();
+    }
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests console message when script is loaded with incorrect text/html mime type.</p>
+<a href="" 69972</a>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/network/script-as-text-loading.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (102897 => 102898)


--- trunk/Source/WebCore/ChangeLog	2011-12-15 08:10:08 UTC (rev 102897)
+++ trunk/Source/WebCore/ChangeLog	2011-12-15 08:52:28 UTC (rev 102898)
@@ -1,3 +1,17 @@
+2011-12-14  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: [Regression] Network manager fails to show resource type and MIME type in incorrect MIME type console message.
+        https://bugs.webkit.org/show_bug.cgi?id=74516
+
+        Reviewed by Pavel Feldman.
+
+        Test: http/tests/inspector/network/script-as-text-loading.html
+
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessageImpl.prototype._formatMessage):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkDispatcher.prototype._updateResourceWithResponse):
+
 2011-11-03  Kent Tamura  <[email protected]>
 
         A spin button changes the value incorrectly if it is clicked after touch events.

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


--- trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2011-12-15 08:10:08 UTC (rev 102897)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleMessage.js	2011-12-15 08:52:28 UTC (rev 102898)
@@ -139,7 +139,7 @@
 
         this._formattedMessage.appendChild(messageText);
 
-        var dumpStackTrace = !!this._stackTrace && (this.source === WebInspector.ConsoleMessage.MessageSource.Network || this.level === WebInspector.ConsoleMessage.MessageLevel.Error || this.type === WebInspector.ConsoleMessage.MessageType.Trace);
+        var dumpStackTrace = !!this._stackTrace && this._stackTrace.length && (this.source === WebInspector.ConsoleMessage.MessageSource.Network || this.level === WebInspector.ConsoleMessage.MessageLevel.Error || this.type === WebInspector.ConsoleMessage.MessageType.Trace);
         if (dumpStackTrace) {
             var ol = document.createElement("ol");
             ol.className = "outline-disclosure";

Modified: trunk/Source/WebCore/inspector/front-end/NetworkManager.js (102897 => 102898)


--- trunk/Source/WebCore/inspector/front-end/NetworkManager.js	2011-12-15 08:10:08 UTC (rev 102897)
+++ trunk/Source/WebCore/inspector/front-end/NetworkManager.js	2011-12-15 08:52:28 UTC (rev 102898)
@@ -152,11 +152,16 @@
             resource.timing = response.timing;
 
         if (!this._mimeTypeIsConsistentWithType(resource)) {
-            WebInspector.console.addMessage(WebInspector.ConsoleMessage.create(WebInspector.ConsoleMessage.MessageSource.Other,
+            WebInspector.console.addMessage(WebInspector.ConsoleMessage.create(WebInspector.ConsoleMessage.MessageSource.Network,
                 WebInspector.ConsoleMessage.MessageLevel.Warning,
-                WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s.", WebInspector.Resource.Type.toUIString(this.type), this.mimeType),
+                WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s: \"%s\".", WebInspector.Resource.Type.toUIString(resource.type), resource.mimeType, resource.url),
                 WebInspector.ConsoleMessage.MessageType.Log,
-                this.url));
+                "",
+                0,
+                1,
+                [],
+                null,
+                resource));
         }
     },
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to