Title: [201414] trunk
Revision
201414
Author
[email protected]
Date
2016-05-25 22:33:58 -0700 (Wed, 25 May 2016)

Log Message

Fix ResourceTiming XHR flakiness
https://bugs.webkit.org/show_bug.cgi?id=158019

Reviewed by Alex Christensen.

Source/WebCore:

Remove XHR specific ResourceTiming information store and addition as it is not needed.

Test: http/tests/performance/performance-resource-timing-xhr-single-entry.html

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest): Removed XHR-specific initiator info storage.
(WebCore::DocumentThreadableLoader::didFinishLoading): Removed XHR-specific RT entry addition.
* loader/DocumentThreadableLoader.h:

LayoutTests:

Test fixes and additions that make sure XHR tests are not run as part of XHR's onload event, as ResourceTiming entries are added
after it.

* TestExpectations:
* http/tests/performance/performance-resource-timing-cached-entries.html: Avoid running the tests as part of the XHR's load event.
* http/tests/performance/performance-resource-timing-xhr-single-entry-expected.txt: Added.
* http/tests/performance/performance-resource-timing-xhr-single-entry.html: Test that XHR fetch adds a single entry with correct initiatorType.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201413 => 201414)


--- trunk/LayoutTests/ChangeLog	2016-05-26 05:31:43 UTC (rev 201413)
+++ trunk/LayoutTests/ChangeLog	2016-05-26 05:33:58 UTC (rev 201414)
@@ -1,3 +1,18 @@
+2016-05-25  Yoav Weiss  <[email protected]>
+
+        Fix ResourceTiming XHR flakiness
+        https://bugs.webkit.org/show_bug.cgi?id=158019
+
+        Reviewed by Alex Christensen.
+
+        Test fixes and additions that make sure XHR tests are not run as part of XHR's onload event, as ResourceTiming entries are added
+        after it.
+
+        * TestExpectations:
+        * http/tests/performance/performance-resource-timing-cached-entries.html: Avoid running the tests as part of the XHR's load event.
+        * http/tests/performance/performance-resource-timing-xhr-single-entry-expected.txt: Added.
+        * http/tests/performance/performance-resource-timing-xhr-single-entry.html: Test that XHR fetch adds a single entry with correct initiatorType.
+
 2016-05-25  Benjamin Poulain  <[email protected]>
 
         [JSC] RegExp with deeply nested subexpressions overflow the stack in Yarr

Modified: trunk/LayoutTests/TestExpectations (201413 => 201414)


--- trunk/LayoutTests/TestExpectations	2016-05-26 05:31:43 UTC (rev 201413)
+++ trunk/LayoutTests/TestExpectations	2016-05-26 05:33:58 UTC (rev 201414)
@@ -978,8 +978,6 @@
 
 webkit.org/b/156631 fast/text/font-face-_javascript_.html [ Pass Crash Failure ]
 
-webkit.org/b/157816 http/tests/performance/performance-resource-timing-cached-entries.html [ Pass Failure ]
-
 webkit.org/b/157849 fast/frames/crash-during-iframe-load-stop.html [ Pass Timeout ]
 
 webkit.org/b/158085 http/tests/css/shared-stylesheet-mutation.html [ Pass Failure ]

Modified: trunk/LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html (201413 => 201414)


--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html	2016-05-26 05:31:43 UTC (rev 201413)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html	2016-05-26 05:33:58 UTC (rev 201414)
@@ -32,7 +32,7 @@
     var xhr = new XMLHttpRequest();
     xhr.addEventListener("load", function() {
         if (windowLoaded)
-            runTest();
+            setTimeout(runTest, 0);
         xhrLoaded = true;
     });
     xhr.open("GET", "../../resources/square100.png");

Added: trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry-expected.txt (0 => 201414)


--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry-expected.txt	2016-05-26 05:33:58 UTC (rev 201414)
@@ -0,0 +1,3 @@
+PASS foundResource is 1
+PASS initiator is "xmlhttprequest"
+

Copied: trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry.html (from rev 201413, trunk/LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html) (0 => 201414)


--- trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry.html	2016-05-26 05:33:58 UTC (rev 201414)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<script>
+    if (window.internals)
+        internals.setResourceTimingSupport(true);
+    if (window.testRunner) {
+        testRunner.dumpAsText()
+        testRunner.waitUntilDone();
+    }
+</script>
+<script src=""
+<script>
+    var foundResource = 0;
+    var initiator;
+    var runTest = function() {
+        var resources = performance.getEntriesByType('resource');
+        for (var i = 0; i < resources.length; ++i) {
+            if (resources[i].name.indexOf("square") != -1) {
+                ++foundResource;
+                initiator = resources[i].initiatorType;
+            }
+        };
+        shouldBe("foundResource", "1");
+        shouldBeEqualToString("initiator", "xmlhttprequest");
+        if (window.internals)
+            window.internals.setResourceTimingSupport(false);
+        if (window.testRunner)
+            testRunner.notifyDone();
+    };
+    var xhr = new XMLHttpRequest();
+    xhr.addEventListener("load", function() {
+        setTimeout(runTest, 0);
+    });
+    xhr.open("GET", "../../resources/square100.png");
+    xhr.send();
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (201413 => 201414)


--- trunk/Source/WebCore/ChangeLog	2016-05-26 05:31:43 UTC (rev 201413)
+++ trunk/Source/WebCore/ChangeLog	2016-05-26 05:33:58 UTC (rev 201414)
@@ -1,3 +1,19 @@
+2016-05-25  Yoav Weiss  <[email protected]>
+
+        Fix ResourceTiming XHR flakiness
+        https://bugs.webkit.org/show_bug.cgi?id=158019
+
+        Reviewed by Alex Christensen.
+
+        Remove XHR specific ResourceTiming information store and addition as it is not needed.
+
+        Test: http/tests/performance/performance-resource-timing-xhr-single-entry.html
+
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::loadRequest): Removed XHR-specific initiator info storage.
+        (WebCore::DocumentThreadableLoader::didFinishLoading): Removed XHR-specific RT entry addition.
+        * loader/DocumentThreadableLoader.h:
+
 2016-05-25  Konstantin Tokarev  <[email protected]>
 
         [cmake] Deduplicate make-js-file-arrays usage and make it work on Windows.

Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (201413 => 201414)


--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2016-05-26 05:31:43 UTC (rev 201413)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2016-05-26 05:33:58 UTC (rev 201414)
@@ -325,11 +325,6 @@
 
 void DocumentThreadableLoader::didFinishLoading(unsigned long identifier, double finishTime)
 {
-#if ENABLE(WEB_TIMING)
-    if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
-        m_resourceTimingInfo.addResourceTiming(m_resource.get(), &m_document);
-#endif
-
     if (m_actualRequest) {
         InspectorInstrumentation::didFinishLoading(m_document.frame(), m_document.frame()->loader().documentLoader(), identifier, finishTime);
 
@@ -395,15 +390,9 @@
             newRequest.setInitiator(m_options.initiator);
         ASSERT(!m_resource);
         m_resource = m_document.cachedResourceLoader().requestRawResource(newRequest);
-        if (m_resource) {
+        if (m_resource)
             m_resource->addClient(this);
 
-#if ENABLE(WEB_TIMING)
-            if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
-                m_resourceTimingInfo.storeResourceTimingInitiatorInformation(m_resource, newRequest, m_document.frame());
-#endif
-        }
-
         return;
     }
     

Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.h (201413 => 201414)


--- trunk/Source/WebCore/loader/DocumentThreadableLoader.h	2016-05-26 05:31:43 UTC (rev 201413)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.h	2016-05-26 05:33:58 UTC (rev 201414)
@@ -33,7 +33,6 @@
 
 #include "CachedRawResourceClient.h"
 #include "CachedResourceHandle.h"
-#include "ResourceTimingInformation.h"
 #include "ThreadableLoader.h"
 
 namespace WebCore {
@@ -106,9 +105,6 @@
         ThreadableLoaderClient* m_client;
         Document& m_document;
         ThreadableLoaderOptions m_options;
-#if ENABLE(WEB_TIMING)
-        ResourceTimingInformation m_resourceTimingInfo;
-#endif
         bool m_sameOriginRequest;
         bool m_simpleRequest;
         bool m_async;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to