2011-04-12 Pavel Feldman <pfeldman@google.com>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 13:25:43 +0000 (13:25 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 13:25:43 +0000 (13:25 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: cookies view is empty even for sites with cookies.
        https://bugs.webkit.org/show_bug.cgi?id=58316

        * http/tests/inspector/resource-tree-model-expected.txt: Added.
        * http/tests/inspector/resource-tree-model.html: Added.
2011-04-12  Pavel Feldman  <pfeldman@google.com>

        Reviewed by Yury Semikhatsky.

        Web Inspector: cookies view is empty even for sites with cookies.
        https://bugs.webkit.org/show_bug.cgi?id=58316

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

        * inspector/front-end/ResourceTreeModel.js:
        (WebInspector.ResourceTreeModel.prototype._callForFrameResources):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83584 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/resource-tree-model-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/resource-tree-model.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/ResourceTreeModel.js

index b9f5ce2..1d5877a 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-12  Pavel Feldman  <pfeldman@google.com>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: cookies view is empty even for sites with cookies.
+        https://bugs.webkit.org/show_bug.cgi?id=58316
+
+        * http/tests/inspector/resource-tree-model-expected.txt: Added.
+        * http/tests/inspector/resource-tree-model.html: Added.
+
 2011-04-12  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/LayoutTests/http/tests/inspector/resource-tree-model-expected.txt b/LayoutTests/http/tests/inspector/resource-tree-model-expected.txt
new file mode 100644 (file)
index 0000000..06c2155
--- /dev/null
@@ -0,0 +1,8 @@
+Tests resource tree model.
+
+
+http://127.0.0.1:8000/inspector/inspector-test.js => http://127.0.0.1:8000/inspector/resource-tree-model.html
+http://127.0.0.1:8000/inspector/resource-tree-model.html => http://127.0.0.1:8000/inspector/resource-tree-model.html
+http://127.0.0.1:8000/inspector/resources-test.js => http://127.0.0.1:8000/inspector/resource-tree-model.html
+http://127.0.0.1:8000/inspector/resources/dummy-iframe.php => http://127.0.0.1:8000/inspector/resources/dummy-iframe.php
+
diff --git a/LayoutTests/http/tests/inspector/resource-tree-model.html b/LayoutTests/http/tests/inspector/resource-tree-model.html
new file mode 100644 (file)
index 0000000..e9a7349
--- /dev/null
@@ -0,0 +1,46 @@
+<html>
+<head>
+<script src="inspector-test.js"></script>
+<script src="resources-test.js"></script>
+
+<script>
+
+function loadIframe()
+{
+    var iframe = document.createElement("iframe");
+    iframe.src = "resources/dummy-iframe.php";
+    document.body.appendChild(iframe);
+}
+
+var test = function()
+{
+    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished);
+
+    var urls = [];
+    function onResourceFinished(event)
+    {
+        WebInspector.resourceTreeModel.forAllResources(printResource);
+        urls.sort();
+        urls.forEach(InspectorTest.addResult);
+        InspectorTest.completeTest();
+    }
+
+    function printResource(resource)
+    {
+        urls.push(resource.url + " => " + resource.documentURL);
+    }
+
+    InspectorTest.evaluateInPage("loadIframe()");    
+}
+
+</script>
+
+</head>
+
+<body onload="runTest()">
+<p>
+Tests resource tree model.
+</p>
+
+</body>
+</html>
index 7b47dd5..063a81d 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-12  Pavel Feldman  <pfeldman@google.com>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: cookies view is empty even for sites with cookies.
+        https://bugs.webkit.org/show_bug.cgi?id=58316
+
+        Test: http/tests/inspector/resource-tree-model.html
+
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel.prototype._callForFrameResources):
+
 2011-04-11  Stephen White  <senorblanco@chromium.org>
 
         Reviewed by James Robinson.
index db6b5d2..cf04fdc 100644 (file)
@@ -246,8 +246,6 @@ WebInspector.ResourceTreeModel.prototype = {
     _callForFrameResources: function(frameId, callback)
     {
         var resources = this._resourcesByFrameId[frameId];
-        if (!resources)
-            return;
 
         for (var url in resources) {
             if (callback(resources[url]))
@@ -301,6 +299,7 @@ WebInspector.ResourceTreeModel.prototype = {
         var resource = new WebInspector.Resource(null, url);
         resource.frameId = frame.id;
         resource.loaderId = frame.loaderId;
+        resource.documentURL = frame.url;
         return resource;
     }
 }