Title: [137488] trunk
Revision
137488
Author
[email protected]
Date
2012-12-12 11:23:48 -0800 (Wed, 12 Dec 2012)

Log Message

[Resource Timing] Failed resources shouldn't be recorded in the buffer
https://bugs.webkit.org/show_bug.cgi?id=104762

Reviewed by Tony Gentilcore.

Source/WebCore:

Test: http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::loadDone):

LayoutTests:

* http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures-expected.txt: Added.
* http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137487 => 137488)


--- trunk/LayoutTests/ChangeLog	2012-12-12 19:20:08 UTC (rev 137487)
+++ trunk/LayoutTests/ChangeLog	2012-12-12 19:23:48 UTC (rev 137488)
@@ -1,3 +1,13 @@
+2012-12-12  James Simonsen  <[email protected]>
+
+        [Resource Timing] Failed resources shouldn't be recorded in the buffer
+        https://bugs.webkit.org/show_bug.cgi?id=104762
+
+        Reviewed by Tony Gentilcore.
+
+        * http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures-expected.txt: Added.
+        * http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html: Added.
+
 2012-12-12  Martin Robinson  <[email protected]>
 
         [GTK] Add authentication support to DRT and fix exposed issues in the libsoup backend

Added: trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures-expected.txt (0 => 137488)


--- trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures-expected.txt	2012-12-12 19:23:48 UTC (rev 137488)
@@ -0,0 +1,8 @@
+Description
+
+This test validates that failed resources aren't present in the Resource Timing buffer.
+
+
+
+PASS entries.length == 0 
+

Added: trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html (0 => 137488)


--- trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html	2012-12-12 19:23:48 UTC (rev 137488)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8" />
+<title>Resource Timing ignores failed resources</title>
+<link rel="author" title="Google" href="" />
+<link rel="help" href=""
+<script src=""
+<script src=""
+<script src=""
+<script>
+var iframe;
+function setup_iframe() {
+    var iframe_content = '<img src=""
+    iframe = document.getElementById('frameContext');
+    iframe.contentWindow.document.write(iframe_content);
+}
+function onload_test() {
+    var entries = iframe.contentWindow.performance.webkitGetEntries();
+    test_true(entries.length == 0, "entries.length == 0");
+}
+window.setup_iframe = setup_iframe;
+</script>
+</head>
+<body>
+<h1>Description</h1>
+<p>This test validates that failed resources aren't present in the Resource Timing buffer.</p>
+<div id="log"></div>
+<iframe id="frameContext" _onload_="onload_test();" src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (137487 => 137488)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 19:20:08 UTC (rev 137487)
+++ trunk/Source/WebCore/ChangeLog	2012-12-12 19:23:48 UTC (rev 137488)
@@ -1,3 +1,15 @@
+2012-12-12  James Simonsen  <[email protected]>
+
+        [Resource Timing] Failed resources shouldn't be recorded in the buffer
+        https://bugs.webkit.org/show_bug.cgi?id=104762
+
+        Reviewed by Tony Gentilcore.
+
+        Test: http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_failures.html
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::loadDone):
+
 2012-12-12  Martin Robinson  <[email protected]>
 
         [GTK] Add authentication support to DRT and fix exposed issues in the libsoup backend

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (137487 => 137488)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2012-12-12 19:20:08 UTC (rev 137487)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2012-12-12 19:23:48 UTC (rev 137488)
@@ -706,7 +706,7 @@
     RefPtr<Document> protectDocument(m_document);
 
 #if ENABLE(RESOURCE_TIMING)
-    if (resource) {
+    if (resource && !resource->errorOccurred() && !resource->wasCanceled()) {
         HashMap<CachedResource*, InitiatorInfo>::iterator initiatorIt = m_initiatorMap.find(resource);
         if (initiatorIt != m_initiatorMap.end()) {
             ASSERT(document());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to