Changeset 201414 in webkit


Ignore:
Timestamp:
May 25, 2016 10:33:58 PM (8 years ago)
Author:
yoav@yoav.ws
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.
Location:
trunk
Files:
1 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201412 r201414  
     12016-05-25  Yoav Weiss  <yoav@yoav.ws>
     2
     3        Fix ResourceTiming XHR flakiness
     4        https://bugs.webkit.org/show_bug.cgi?id=158019
     5
     6        Reviewed by Alex Christensen.
     7
     8        Test fixes and additions that make sure XHR tests are not run as part of XHR's onload event, as ResourceTiming entries are added
     9        after it.
     10
     11        * TestExpectations:
     12        * http/tests/performance/performance-resource-timing-cached-entries.html: Avoid running the tests as part of the XHR's load event.
     13        * http/tests/performance/performance-resource-timing-xhr-single-entry-expected.txt: Added.
     14        * http/tests/performance/performance-resource-timing-xhr-single-entry.html: Test that XHR fetch adds a single entry with correct initiatorType.
     15
    1162016-05-25  Benjamin Poulain  <benjamin@webkit.org>
    217
  • trunk/LayoutTests/TestExpectations

    r201400 r201414  
    979979webkit.org/b/156631 fast/text/font-face-javascript.html [ Pass Crash Failure ]
    980980
    981 webkit.org/b/157816 http/tests/performance/performance-resource-timing-cached-entries.html [ Pass Failure ]
    982 
    983981webkit.org/b/157849 fast/frames/crash-during-iframe-load-stop.html [ Pass Timeout ]
    984982
  • trunk/LayoutTests/http/tests/performance/performance-resource-timing-cached-entries.html

    r201130 r201414  
    3333    xhr.addEventListener("load", function() {
    3434        if (windowLoaded)
    35             runTest();
     35            setTimeout(runTest, 0);
    3636        xhrLoaded = true;
    3737    });
  • trunk/LayoutTests/http/tests/performance/performance-resource-timing-xhr-single-entry.html

    r201413 r201414  
    88        testRunner.waitUntilDone();
    99    }
    10     if (window.performance)
    11         console.log("current entries: " + performance.getEntriesByType('resource').length);
    1210</script>
    1311<script src="../../resources/js-test-pre.js"></script>
    14 <img src="../../resources/square100.png">
    1512<script>
    1613    var foundResource = 0;
     14    var initiator;
    1715    var runTest = function() {
    1816        var resources = performance.getEntriesByType('resource');
    1917        for (var i = 0; i < resources.length; ++i) {
    20             console.log("entry: " + resources[i].name);
    21             if (resources[i].name.indexOf("square") != -1)
     18            if (resources[i].name.indexOf("square") != -1) {
    2219                ++foundResource;
     20                initiator = resources[i].initiatorType;
     21            }
    2322        };
    24         shouldBe("foundResource", "2");
     23        shouldBe("foundResource", "1");
     24        shouldBeEqualToString("initiator", "xmlhttprequest");
    2525        if (window.internals)
    2626            window.internals.setResourceTimingSupport(false);
     
    2828            testRunner.notifyDone();
    2929    };
    30     var windowLoaded = false;
    31     var xhrLoaded = false;
    3230    var xhr = new XMLHttpRequest();
    3331    xhr.addEventListener("load", function() {
    34         if (windowLoaded)
    35             runTest();
    36         xhrLoaded = true;
     32        setTimeout(runTest, 0);
    3733    });
    3834    xhr.open("GET", "../../resources/square100.png");
    3935    xhr.send();
    40     window.addEventListener("load", function() {
    41         if (xhrLoaded)
    42             runTest();
    43         windowLoaded = true;
    44     });
    4536</script>
    4637</body>
  • trunk/Source/WebCore/ChangeLog

    r201413 r201414  
     12016-05-25  Yoav Weiss  <yoav@yoav.ws>
     2
     3        Fix ResourceTiming XHR flakiness
     4        https://bugs.webkit.org/show_bug.cgi?id=158019
     5
     6        Reviewed by Alex Christensen.
     7
     8        Remove XHR specific ResourceTiming information store and addition as it is not needed.
     9
     10        Test: http/tests/performance/performance-resource-timing-xhr-single-entry.html
     11
     12        * loader/DocumentThreadableLoader.cpp:
     13        (WebCore::DocumentThreadableLoader::loadRequest): Removed XHR-specific initiator info storage.
     14        (WebCore::DocumentThreadableLoader::didFinishLoading): Removed XHR-specific RT entry addition.
     15        * loader/DocumentThreadableLoader.h:
     16
    1172016-05-25  Konstantin Tokarev  <annulen@yandex.ru>
    218
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp

    r201018 r201414  
    326326void DocumentThreadableLoader::didFinishLoading(unsigned long identifier, double finishTime)
    327327{
    328 #if ENABLE(WEB_TIMING)
    329     if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
    330         m_resourceTimingInfo.addResourceTiming(m_resource.get(), &m_document);
    331 #endif
    332 
    333328    if (m_actualRequest) {
    334329        InspectorInstrumentation::didFinishLoading(m_document.frame(), m_document.frame()->loader().documentLoader(), identifier, finishTime);
     
    396391        ASSERT(!m_resource);
    397392        m_resource = m_document.cachedResourceLoader().requestRawResource(newRequest);
    398         if (m_resource) {
     393        if (m_resource)
    399394            m_resource->addClient(this);
    400 
    401 #if ENABLE(WEB_TIMING)
    402             if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
    403                 m_resourceTimingInfo.storeResourceTimingInitiatorInformation(m_resource, newRequest, m_document.frame());
    404 #endif
    405         }
    406395
    407396        return;
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.h

    r201018 r201414  
    3434#include "CachedRawResourceClient.h"
    3535#include "CachedResourceHandle.h"
    36 #include "ResourceTimingInformation.h"
    3736#include "ThreadableLoader.h"
    3837
     
    107106        Document& m_document;
    108107        ThreadableLoaderOptions m_options;
    109 #if ENABLE(WEB_TIMING)
    110         ResourceTimingInformation m_resourceTimingInfo;
    111 #endif
    112108        bool m_sameOriginRequest;
    113109        bool m_simpleRequest;
Note: See TracChangeset for help on using the changeset viewer.