Title: [92755] trunk
Revision
92755
Author
[email protected]
Date
2011-08-10 01:25:50 -0700 (Wed, 10 Aug 2011)

Log Message

2011-08-10  Andrey Kosyakov  <[email protected]>

        Web Inspector: Network panel always displays file:// resources as "(pending)"
        https://bugs.webkit.org/show_bug.cgi?id=65784

        Reviewed by Pavel Feldman.

        Test: inspector/network-status-non-http.html

        * English.lproj/localizedStrings.js:
        * inspector/front-end/NetworkPanel.js:
        (WebInspector.NetworkDataGridNode.prototype._refreshStatusCell):
        * inspector/front-end/Resource.js:
        (WebInspector.Resource.prototype.isHttpFamily):

2011-08-10  Andrey Kosyakov  <[email protected]>

        Web Inspector: Network panel always displays file:// resources as "(pending)"
        https://bugs.webkit.org/show_bug.cgi?id=65784

        Reviewed by Pavel Feldman.

        * inspector/network-status-non-http-expected.txt: Added.
        * inspector/network-status-non-http.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (92754 => 92755)


--- trunk/LayoutTests/ChangeLog	2011-08-10 08:06:14 UTC (rev 92754)
+++ trunk/LayoutTests/ChangeLog	2011-08-10 08:25:50 UTC (rev 92755)
@@ -1,3 +1,13 @@
+2011-08-10  Andrey Kosyakov  <[email protected]>
+
+        Web Inspector: Network panel always displays file:// resources as "(pending)"
+        https://bugs.webkit.org/show_bug.cgi?id=65784
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/network-status-non-http-expected.txt: Added.
+        * inspector/network-status-non-http.html: Added.
+
 2011-08-09  Kent Tamura  <[email protected]>
 
         Move <input type=datetime-local> tests to fast/forms/datetimelocal/

Added: trunk/LayoutTests/inspector/network-status-non-http-expected.txt (0 => 92755)


--- trunk/LayoutTests/inspector/network-status-non-http-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/network-status-non-http-expected.txt	2011-08-10 08:25:50 UTC (rev 92755)
@@ -0,0 +1,6 @@
+{
+    0 : "data:application/_javascript_,var x = 0;: Success"
+    1 : "network-test.js: Success"
+    2 : "non-existent-file.js: (failed)"
+}
+
Property changes on: trunk/LayoutTests/inspector/network-status-non-http-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/network-status-non-http.html (0 => 92755)


--- trunk/LayoutTests/inspector/network-status-non-http.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/network-status-non-http.html	2011-08-10 08:25:50 UTC (rev 92755)
@@ -0,0 +1,61 @@
+<html>
+<head>
+<script src=""
+<script>
+function test() {
+    var resourcesToWatch = /\/network-test\.js$|\/non-existent-file.js$|^data:application\/_javascript_,|/;
+    var seenResources = 0;
+
+    function dumpResources()
+    {
+        var logView = WebInspector.panels.network._networkLogView;
+        logView.refresh();
+        var dataGrid = logView.element.querySelector("table.data");
+        var urls = document.evaluate("//tbody/tr/td[position()=1]/div/@title", dataGrid, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+        var outputStrings = [];
+
+        for (var i = 0; i < urls.snapshotLength; ++i) {
+            var url = ""
+            if (resourcesToWatch.test(url)) {
+                var urlTail = /^file:/.test(url) ? url.replace(/.*\//, "") : url;
+                var status = document.evaluate("ancestor::tr/td[position()=3]", urls.snapshotItem(i), null, XPathResult.STRING_TYPE, null);
+                outputStrings.push(urlTail + ": " + status.stringValue);
+            }
+        }
+        outputStrings.sort();
+        InspectorTest.addObject(outputStrings);
+        InspectorTest.completeTest();
+    }
+
+    function onResourceFinished(resource)
+    {
+        if (!resourcesToWatch.test(resource.url))
+            return;
+        if (++seenResources === 3)
+            dumpResources();
+    }
+
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished);
+    WebInspector.showPanel("network");
+    InspectorTest.evaluateInPage("loadResources()");
+}
+
+function addScriptElement(src)
+{
+    var element = document.createElement("script");
+    element.src = ""
+    document.body.appendChild(element);
+}
+
+function loadResources()
+{
+    addScriptElement("../http/tests/inspector/network-test.js");
+    addScriptElement("non-existent-file.js");
+    addScriptElement("data:application/_javascript_,var x = 0;");
+}
+
+</script>
+</head>
+<body _onload_="runTest()">
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/network-status-non-http.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (92754 => 92755)


--- trunk/Source/WebCore/ChangeLog	2011-08-10 08:06:14 UTC (rev 92754)
+++ trunk/Source/WebCore/ChangeLog	2011-08-10 08:25:50 UTC (rev 92755)
@@ -1,3 +1,18 @@
+2011-08-10  Andrey Kosyakov  <[email protected]>
+
+        Web Inspector: Network panel always displays file:// resources as "(pending)"
+        https://bugs.webkit.org/show_bug.cgi?id=65784
+
+        Reviewed by Pavel Feldman.
+
+        Test: inspector/network-status-non-http.html
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkDataGridNode.prototype._refreshStatusCell):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype.isHttpFamily):
+
 2011-08-09  Luke Macpherson   <[email protected]>
 
         Use setFontDescription helper to set m_fontDirty.

Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js


(Binary files differ)

Modified: trunk/Source/WebCore/inspector/front-end/NetworkPanel.js (92754 => 92755)


--- trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2011-08-10 08:06:14 UTC (rev 92754)
+++ trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2011-08-10 08:25:50 UTC (rev 92755)
@@ -1935,12 +1935,12 @@
             if (this._resource.statusCode >= 400)
                 this.element.addStyleClass("network-error-row");
         } else {
-            if (this._resource.isDataURL() && this._resource.finished)
-                this._statusCell.setTextAndTitle(WebInspector.UIString("(data url)"));
+            if (!this._resource.isHttpFamily() && this._resource.finished)
+                this._statusCell.setTextAndTitle(WebInspector.UIString("Success"));
             else if (this._resource.isPingRequest())
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(ping)"));
             else
-                this._statusCell.setTextAndTitle(WebInspector.UIString("(Pending)"));
+                this._statusCell.setTextAndTitle(WebInspector.UIString("(pending)"));
             this._statusCell.addStyleClass("network-dim-cell");
         }
     },

Modified: trunk/Source/WebCore/inspector/front-end/Resource.js (92754 => 92755)


--- trunk/Source/WebCore/inspector/front-end/Resource.js	2011-08-10 08:06:14 UTC (rev 92754)
+++ trunk/Source/WebCore/inspector/front-end/Resource.js	2011-08-10 08:25:50 UTC (rev 92755)
@@ -877,9 +877,9 @@
             image.src = ""
     },
 
-    isDataURL: function()
+    isHttpFamily: function()
     {
-        return this.url.match(/^data:/i);
+        return this.url.match(/^https?:/i);
     },
 
     requestContentType: function()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to