Title: [249702] trunk
Revision
249702
Author
cdu...@apple.com
Date
2019-09-09 21:06:42 -0700 (Mon, 09 Sep 2019)

Log Message

REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
https://bugs.webkit.org/show_bug.cgi?id=201550

Reviewed by Alex Christensen.

Source/WebCore:

* loader/ResourceLoadObserver.h:
(WebCore::ResourceLoadObserver::hasStatistics const):

Source/WebKit:

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleResourceLoadStatisticsNotifyObserver):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

Tools:

Update testRunner.statisticsNotifyObserver() to return a boolean indicating if it did
anything or not.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::statisticsNotifyObserver):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsNotifyObserver):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

Update test to do checks on a timer if its call to testRunner.statisticsNotifyObserver() is a no-op
due to having no statistics to send to the network process.

* http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (249701 => 249702)


--- trunk/LayoutTests/ChangeLog	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/LayoutTests/ChangeLog	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1,3 +1,15 @@
+2019-09-09  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
+        https://bugs.webkit.org/show_bug.cgi?id=201550
+
+        Reviewed by Alex Christensen.
+
+        Update test to do checks on a timer if its call to testRunner.statisticsNotifyObserver() is a no-op
+        due to having no statistics to send to the network process.
+
+        * http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html:
+
 2019-09-09  Joonghun Park  <pjh0...@gmail.com>
 
         getComputedStyle for line-height: normal should return the keyword instead of a length

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html (249701 => 249702)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html	2019-09-10 04:06:42 UTC (rev 249702)
@@ -10,7 +10,12 @@
     description("Test that a non-redirected top frame navigation doesn't get captured in statistics.");
     jsTestIsAsync = true;
 
+    let timerHandle = 0;
+
     function finishTest() {
+        if (timerHandle)
+          clearTimeout(timerHandle);
+
         shouldBeFalse('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
         shouldBeFalse('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://127.0.0.1", "http://localhost")');
         setEnableFeature(false, finishJSTest);
@@ -28,7 +33,8 @@
             case "localhost:8000":
                 testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
                 testRunner.installStatisticsDidScanDataRecordsCallback(finishTest);
-                testRunner.statisticsNotifyObserver();
+                if (!testRunner.statisticsNotifyObserver())
+                    timerHandle = setTimeout(finishTest, 100);
                 break;
             default:
                 testFailed("Unknown host: " + document.location.host);

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (249701 => 249702)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1354,5 +1354,3 @@
 
 # problem with blur handling
 mathml/focus-event-handling.html [ Failure ]
-
-webkit.org/b/201550 http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html [ Pass Timeout ]

Modified: trunk/Source/WebCore/ChangeLog (249701 => 249702)


--- trunk/Source/WebCore/ChangeLog	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Source/WebCore/ChangeLog	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1,3 +1,13 @@
+2019-09-09  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
+        https://bugs.webkit.org/show_bug.cgi?id=201550
+
+        Reviewed by Alex Christensen.
+
+        * loader/ResourceLoadObserver.h:
+        (WebCore::ResourceLoadObserver::hasStatistics const):
+
 2019-09-09  Timothy Hatcher  <timo...@apple.com>
 
         Tap and hold on Facebook sometimes creates a tall empty selection.

Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.h (249701 => 249702)


--- trunk/Source/WebCore/loader/ResourceLoadObserver.h	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.h	2019-09-10 04:06:42 UTC (rev 249702)
@@ -57,6 +57,8 @@
     virtual void updateCentralStatisticsStore() { }
     virtual void clearState() { }
     
+    virtual bool hasStatistics() const { return false; }
+    
 #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
     virtual void setShouldLogUserInteraction(bool) { }
 #endif

Modified: trunk/Source/WebKit/ChangeLog (249701 => 249702)


--- trunk/Source/WebKit/ChangeLog	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Source/WebKit/ChangeLog	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1,3 +1,14 @@
+2019-09-09  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
+        https://bugs.webkit.org/show_bug.cgi?id=201550
+
+        Reviewed by Alex Christensen.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleResourceLoadStatisticsNotifyObserver):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+
 2019-09-09  Alex Christensen  <achristen...@webkit.org>
 
         Disable TLS 1.0 and 1.1 in WebSockets

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp (249701 => 249702)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2019-09-10 04:06:42 UTC (rev 249702)
@@ -311,9 +311,13 @@
     WebCore::ResourceLoadObserver::shared().clearState();
 }
 
-void WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef)
+bool WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef)
 {
+    if (!WebCore::ResourceLoadObserver::shared().hasStatistics())
+        return false;
+
     WebCore::ResourceLoadObserver::shared().updateCentralStatisticsStore();
+    return true;
 }
 
 

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (249701 => 249702)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2019-09-10 04:06:42 UTC (rev 249702)
@@ -92,7 +92,7 @@
 WK_EXPORT void WKBundleSetTabKeyCyclesThroughElements(WKBundleRef bundle, WKBundlePageRef page, bool enabled);
 
 WK_EXPORT void WKBundleClearResourceLoadStatistics(WKBundleRef);
-WK_EXPORT void WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef);
+WK_EXPORT bool WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef);
 
 WK_EXPORT void WKBundleExtendClassesForParameterCoder(WKBundleRef bundle, WKArrayRef classes);
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.h (249701 => 249702)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.h	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.h	2019-09-10 04:06:42 UTC (rev 249702)
@@ -56,6 +56,8 @@
     String statisticsForURL(PAL::SessionID, const URL&) final;
     void updateCentralStatisticsStore() final;
     void clearState() final;
+    
+    bool hasStatistics() const final { return !m_perSessionResourceStatisticsMap.isEmpty(); }
 
 private:
     WebCore::ResourceLoadStatistics& ensureResourceStatisticsForRegistrableDomain(PAL::SessionID, const WebCore::RegistrableDomain&);

Modified: trunk/Tools/ChangeLog (249701 => 249702)


--- trunk/Tools/ChangeLog	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Tools/ChangeLog	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1,3 +1,21 @@
+2019-09-09  Chris Dumez  <cdu...@apple.com>
+
+        REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
+        https://bugs.webkit.org/show_bug.cgi?id=201550
+
+        Reviewed by Alex Christensen.
+
+        Update testRunner.statisticsNotifyObserver() to return a boolean indicating if it did
+        anything or not.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::statisticsNotifyObserver):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::statisticsNotifyObserver):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2019-09-09  Timothy Hatcher  <timo...@apple.com>
 
         Tap and hold on Facebook sometimes creates a tall empty selection.

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (249701 => 249702)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2019-09-10 04:06:42 UTC (rev 249702)
@@ -321,7 +321,7 @@
     void setStatisticsTopFrameUniqueRedirectFrom(DOMString hostName, DOMString hostNameRedirectedTo);
     void setStatisticsCrossSiteLoadWithLinkDecoration(DOMString fromHost, DOMString toHost);
     void setStatisticsTimeToLiveUserInteraction(double seconds);
-    void statisticsNotifyObserver();
+    boolean statisticsNotifyObserver();
     void statisticsProcessStatisticsAndDataRecords();
     void statisticsUpdateCookieBlocking(object completionHandler);
     void statisticsSubmitTelemetry();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (249701 => 249702)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1017,9 +1017,9 @@
     WebCoreTestSupport::setAllowsAnySSLCertificate(allowsAnySSLCertificate);
 }
 
-void InjectedBundle::statisticsNotifyObserver()
+bool InjectedBundle::statisticsNotifyObserver()
 {
-    WKBundleResourceLoadStatisticsNotifyObserver(m_bundle);
+    return WKBundleResourceLoadStatisticsNotifyObserver(m_bundle);
 }
 
 void InjectedBundle::textDidChangeInTextField()

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (249701 => 249702)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2019-09-10 04:06:42 UTC (rev 249702)
@@ -133,7 +133,7 @@
 
     void setAllowsAnySSLCertificate(bool);
 
-    void statisticsNotifyObserver();
+    bool statisticsNotifyObserver();
 
     void textDidChangeInTextField();
     void textFieldDidBeginEditing();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (249701 => 249702)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2019-09-10 04:06:42 UTC (rev 249702)
@@ -1931,9 +1931,9 @@
     callTestRunnerCallback(StatisticsDidRunTelemetryCallbackID, 1, &result);
 }
 
-void TestRunner::statisticsNotifyObserver()
+bool TestRunner::statisticsNotifyObserver()
 {
-    InjectedBundle::singleton().statisticsNotifyObserver();
+    return InjectedBundle::singleton().statisticsNotifyObserver();
 }
 
 void TestRunner::statisticsProcessStatisticsAndDataRecords()

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (249701 => 249702)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2019-09-10 03:50:04 UTC (rev 249701)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2019-09-10 04:06:42 UTC (rev 249702)
@@ -386,7 +386,7 @@
     void statisticsDidModifyDataRecordsCallback();
     void statisticsDidScanDataRecordsCallback();
     void statisticsDidRunTelemetryCallback(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins);
-    void statisticsNotifyObserver();
+    bool statisticsNotifyObserver();
     void statisticsProcessStatisticsAndDataRecords();
     void statisticsUpdateCookieBlocking(JSValueRef completionHandler);
     void statisticsCallDidSetBlockCookiesForHostCallback();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to