Title: [95805] trunk
Revision
95805
Author
[email protected]
Date
2011-09-23 08:08:09 -0700 (Fri, 23 Sep 2011)

Log Message

Web Inspector: XHRs requests with the same url as main resource should have correct category.
https://bugs.webkit.org/show_bug.cgi?id=68646

Reviewed by Yury Semikhatsky.

Source/WebCore:

Test: http/tests/inspector/network/network-xhr-same-url-as-main-resource.html

* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didReceiveResponse):

LayoutTests:

* http/tests/inspector/network/network-xhr-same-url-as-main-resource-expected.txt: Added.
* http/tests/inspector/network/network-xhr-same-url-as-main-resource.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (95804 => 95805)


--- trunk/LayoutTests/ChangeLog	2011-09-23 15:06:36 UTC (rev 95804)
+++ trunk/LayoutTests/ChangeLog	2011-09-23 15:08:09 UTC (rev 95805)
@@ -1,3 +1,13 @@
+2011-09-23  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: XHRs requests with the same url as main resource should have correct category.
+        https://bugs.webkit.org/show_bug.cgi?id=68646
+
+        Reviewed by Yury Semikhatsky.
+
+        * http/tests/inspector/network/network-xhr-same-url-as-main-resource-expected.txt: Added.
+        * http/tests/inspector/network/network-xhr-same-url-as-main-resource.html: Added.
+
 2011-09-23  Marcus Bulach  <[email protected]>
 
         [chromium] Update expectation for pservers-grad-14-b.svg on snowleopard

Added: trunk/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource-expected.txt (0 => 95805)


--- trunk/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource-expected.txt	2011-09-23 15:08:09 UTC (rev 95805)
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 13: Done.
+Tests that XHRs with the same url as a main resource have correct category.
+
+Bug 68648
+xhr
+

Added: trunk/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource.html (0 => 95805)


--- trunk/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/network-xhr-same-url-as-main-resource.html	2011-09-23 15:08:09 UTC (rev 95805)
@@ -0,0 +1,34 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+function loadData()
+{
+    doXHR("GET", "network-xhr-same-url-as-main-resource.html", true, resourceLoaded);
+}
+
+function resourceLoaded()
+{
+    console.log("Done.");
+}
+
+function test()
+{
+    InspectorTest.addConsoleSniffer(step2);
+    InspectorTest.evaluateInPage("loadData()");
+
+    function step2()
+    {
+        var resource1 = WebInspector.panels.network.resources[WebInspector.panels.network.resources.length - 1];
+        InspectorTest.addResult(resource1.category.name);
+        InspectorTest.completeTest();
+    }
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests that XHRs with the same url as a main resource have correct category.</p>
+<a href="" 68648</a>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (95804 => 95805)


--- trunk/Source/WebCore/ChangeLog	2011-09-23 15:06:36 UTC (rev 95804)
+++ trunk/Source/WebCore/ChangeLog	2011-09-23 15:08:09 UTC (rev 95805)
@@ -1,5 +1,17 @@
 2011-09-23  Vsevolod Vlasov  <[email protected]>
 
+        Web Inspector: XHRs requests with the same url as main resource should have correct category.
+        https://bugs.webkit.org/show_bug.cgi?id=68646
+
+        Reviewed by Yury Semikhatsky.
+
+        Test: http/tests/inspector/network/network-xhr-same-url-as-main-resource.html
+
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::didReceiveResponse):
+
+2011-09-23  Vsevolod Vlasov  <[email protected]>
+
         Web Inspector: Add context menu action to navigate from resources panel resource to network panel.
         https://bugs.webkit.org/show_bug.cgi?id=68657
 

Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (95804 => 95805)


--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp	2011-09-23 15:06:36 UTC (rev 95804)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp	2011-09-23 15:08:09 UTC (rev 95805)
@@ -247,14 +247,14 @@
 
             m_resourcesData->addCachedResource(requestId, cachedResource);
         }
-        if (equalIgnoringFragmentIdentifier(response.url(), loader->frameLoader()->icon()->url()))
+        if (m_loadingXHRSynchronously || m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
+            type = InspectorPageAgent::XHRResource;
+        else if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::ScriptResource)
+            type = InspectorPageAgent::ScriptResource;
+        else if (equalIgnoringFragmentIdentifier(response.url(), loader->frameLoader()->icon()->url()))
             type = InspectorPageAgent::ImageResource;
         else if (equalIgnoringFragmentIdentifier(response.url(), loader->url()) && type == InspectorPageAgent::OtherResource)
             type = InspectorPageAgent::DocumentResource;
-        else if (m_loadingXHRSynchronously || m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
-            type = InspectorPageAgent::XHRResource;
-        else if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::ScriptResource)
-            type = InspectorPageAgent::ScriptResource;
 
         m_resourcesData->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), response);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to