Title: [90364] trunk
Revision
90364
Author
[email protected]
Date
2011-07-04 07:09:36 -0700 (Mon, 04 Jul 2011)

Log Message

2011-07-04  Vsevolod Vlasov  <[email protected]>

        Web Inspector: Resources loaded to Resources Panel from InspectorPageAgent do not have mime type set.
        https://bugs.webkit.org/show_bug.cgi?id=63701

        Added a test that checks mime type when resources are loaded from cache by InspectorPageAgent.

        Reviewed by Yury Semikhatsky.

        * http/tests/inspector/resource-tree/resource-tree-mimetype-expected.txt: Added.
        * http/tests/inspector/resource-tree/resource-tree-mimetype.html: Added.
        * http/tests/inspector/resource-tree/resources/empty.png: Added.
2011-07-04  Vsevolod Vlasov  <[email protected]>

        Web Inspector: Resources loaded to Resources Panel from InspectorPageAgent do not have mime type set.
        https://bugs.webkit.org/show_bug.cgi?id=63701

        Pass cachedResource/documentLoader mimeType from InspectorPageAgent to frontend.

        Reviewed by Yury Semikhatsky.

        Test: http/tests/inspector/resource-tree/resource-tree-mimetype.html

        * inspector/Inspector.json:
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::buildObjectForFrame):
        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
        * inspector/front-end/ResourceTreeModel.js:
        (WebInspector.ResourceTreeModel.prototype._addFramesRecursively):
        (WebInspector.ResourceTreeModel.prototype._createResource):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90363 => 90364)


--- trunk/LayoutTests/ChangeLog	2011-07-04 13:29:50 UTC (rev 90363)
+++ trunk/LayoutTests/ChangeLog	2011-07-04 14:09:36 UTC (rev 90364)
@@ -1,3 +1,16 @@
+2011-07-04  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Resources loaded to Resources Panel from InspectorPageAgent do not have mime type set.
+        https://bugs.webkit.org/show_bug.cgi?id=63701
+
+        Added a test that checks mime type when resources are loaded from cache by InspectorPageAgent.
+
+        Reviewed by Yury Semikhatsky.
+
+        * http/tests/inspector/resource-tree/resource-tree-mimetype-expected.txt: Added.
+        * http/tests/inspector/resource-tree/resource-tree-mimetype.html: Added.
+        * http/tests/inspector/resource-tree/resources/empty.png: Added.
+
 2011-07-04  Marcus Bulach  <[email protected]>
 
         [chromium] Updates expectations for failures on svg/animations/svgtransform-animation-1.html

Added: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype-expected.txt (0 => 90364)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype-expected.txt	2011-07-04 14:09:36 UTC (rev 90364)
@@ -0,0 +1,9 @@
+Tests that resources panel correctly shows mime type when it loads data from memory cache.
+
+Bug 63701 
+script application/x-_javascript_ http://127.0.0.1:8000/inspector/inspector-test.js
+document text/html http://127.0.0.1:8000/inspector/resource-tree/resource-tree-mimetype.html
+script application/x-_javascript_ http://127.0.0.1:8000/inspector/resource-tree/resource-tree-test.js
+image image/png http://127.0.0.1:8000/inspector/resource-tree/resources/empty.png
+stylesheet text/css http://127.0.0.1:8000/inspector/resource-tree/resources/styles-initial.css
+
Property changes on: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype.html (0 => 90364)


--- trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype.html	2011-07-04 14:09:36 UTC (rev 90364)
@@ -0,0 +1,32 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<link rel="stylesheet" href=""
+<script>
+function test()
+{
+    if (WebInspector.panels.network)
+        WebInspector.panels.network._reset();
+    WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, step2);
+    WebInspector.resourceTreeModel.frontendReused();
+
+    function step2()
+    {
+        function format(resource)
+        {
+            return WebInspector.Resource.Type.toString(resource.type) + " " + resource.mimeType + " " + resource.url;
+        }
+
+        InspectorTest.dumpResources(format);
+        InspectorTest.completeTest();
+    }
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests that resources panel correctly shows mime type when it loads data from memory cache.</p>
+<a href="" 63701</a>
+<img src=""
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/resource-tree/resource-tree-mimetype.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/http/tests/inspector/resource-tree/resources/empty.png


(Binary files differ)
Property changes on: trunk/LayoutTests/http/tests/inspector/resource-tree/resources/empty.png ___________________________________________________________________

Added: svn:mime-type

Modified: trunk/Source/WebCore/ChangeLog (90363 => 90364)


--- trunk/Source/WebCore/ChangeLog	2011-07-04 13:29:50 UTC (rev 90363)
+++ trunk/Source/WebCore/ChangeLog	2011-07-04 14:09:36 UTC (rev 90364)
@@ -1,3 +1,22 @@
+2011-07-04  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Resources loaded to Resources Panel from InspectorPageAgent do not have mime type set.
+        https://bugs.webkit.org/show_bug.cgi?id=63701
+
+        Pass cachedResource/documentLoader mimeType from InspectorPageAgent to frontend.
+
+        Reviewed by Yury Semikhatsky.
+
+        Test: http/tests/inspector/resource-tree/resource-tree-mimetype.html
+
+        * inspector/Inspector.json:
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::buildObjectForFrame):
+        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel.prototype._addFramesRecursively):
+        (WebInspector.ResourceTreeModel.prototype._createResource):
+
 2011-07-04  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: repeated message counter should be aligned with other message icons

Modified: trunk/Source/WebCore/inspector/Inspector.json (90363 => 90364)


--- trunk/Source/WebCore/inspector/Inspector.json	2011-07-04 13:29:50 UTC (rev 90363)
+++ trunk/Source/WebCore/inspector/Inspector.json	2011-07-04 14:09:36 UTC (rev 90364)
@@ -75,7 +75,8 @@
                     { "name": "parentId", "type": "string", "optional": true, "description": "Parent frame identifier." },
                     { "name": "loaderId", "type": "string", "description": "Identifier of the loader associated with this frame." },
                     { "name": "name", "type": "string", "optional": true, "description": "Frame's name as specified in the tag." },
-                    { "name": "url", "type": "string", "description": "Frame document's URL." }
+                    { "name": "url", "type": "string", "description": "Frame document's URL." },
+                    { "name": "mimeType", "type": "string", "description": "Frame document's mimeType as determined by the browser." }
                 ]
             },
             {
@@ -90,7 +91,8 @@
                             "type": "object",
                             "properties": [
                                 { "name": "url", "type": "string", "description": "Resource URL." },
-                                { "name": "type", "$ref": "ResourceType", "description": "Type of this resource." }
+                                { "name": "type", "$ref": "ResourceType", "description": "Type of this resource." },
+                                { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." }
                             ]
                         },
                         "description": "Information about frame resources."

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (90363 => 90364)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2011-07-04 13:29:50 UTC (rev 90363)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2011-07-04 14:09:36 UTC (rev 90364)
@@ -616,6 +616,7 @@
     }
     frameObject->setString("url", frame->document()->url().string());
     frameObject->setString("loaderId", loaderId(frame->loader()->documentLoader()));
+    frameObject->setString("mimeType", frame->loader()->documentLoader()->responseMIMEType());
 
     return frameObject;
 }
@@ -635,6 +636,7 @@
         RefPtr<InspectorObject> resourceObject = InspectorObject::create();
         resourceObject->setString("url", cachedResource->url());
         resourceObject->setString("type", cachedResourceTypeString(*cachedResource));
+        resourceObject->setString("mimeType", cachedResource->response().mimeType());
         subresources->pushValue(resourceObject);
     }
 

Modified: trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js (90363 => 90364)


--- trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js	2011-07-04 13:29:50 UTC (rev 90363)
+++ trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js	2011-07-04 14:09:36 UTC (rev 90364)
@@ -339,6 +339,7 @@
             var subresource = frameTreePayload.resources[i];
             var resource = this._createResource(framePayload, subresource.url);
             resource.type = WebInspector.Resource.Type[subresource.type];
+            resource.mimeType = subresource.mimeType;
             resource.finished = true;
             this._addResourceToFrame(resource);
         }
@@ -349,6 +350,7 @@
         var resource = new WebInspector.Resource(null, url, frame.loaderId);
         resource.frameId = frame.id;
         resource.documentURL = frame.url;
+        resource.mimeType = frame.mimeType;
         return resource;
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to