Title: [228252] trunk/LayoutTests
Revision
228252
Author
wilan...@apple.com
Date
2018-02-07 17:25:06 -0800 (Wed, 07 Feb 2018)

Log Message

Switch testRunner.installStatisticsDidModifyDataRecordsCallback() to testRunner.installStatisticsDidScanDataRecordsCallback() in two tests
https://bugs.webkit.org/show_bug.cgi?id=182366
<rdar://problem/37094805>

Unreviewed test gardening.

This change is an attempt to make two flaky test cases stable.
It also skips http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
because the timestamp resolution of 5 seconds is now so short that we run into timing flakiness.


* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* platform/mac-wk2/TestExpectations:
    Removed [ Skip ] entry for http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
    Added [ Skip ] entry for http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
* platform/wk2/TestExpectations:
    Now both the above test cases are marked [ Pass ].

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (228251 => 228252)


--- trunk/LayoutTests/ChangeLog	2018-02-08 00:58:25 UTC (rev 228251)
+++ trunk/LayoutTests/ChangeLog	2018-02-08 01:25:06 UTC (rev 228252)
@@ -1,3 +1,23 @@
+2018-02-07  John Wilander  <wilan...@apple.com>
+
+        Switch testRunner.installStatisticsDidModifyDataRecordsCallback() to testRunner.installStatisticsDidScanDataRecordsCallback() in two tests
+        https://bugs.webkit.org/show_bug.cgi?id=182366
+        <rdar://problem/37094805>
+
+        Unreviewed test gardening.
+
+        This change is an attempt to make two flaky test cases stable.
+        It also skips http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
+        because the timestamp resolution of 5 seconds is now so short that we run into timing flakiness.
+
+        * http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
+        * http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
+        * platform/mac-wk2/TestExpectations:
+            Removed [ Skip ] entry for http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
+            Added [ Skip ] entry for http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
+        * platform/wk2/TestExpectations:
+            Now both the above test cases are marked [ Pass ].
+
 2018-02-07  Ryan Haddad  <ryanhad...@apple.com>
 
         Skip media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html.

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html (228251 => 228252)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html	2018-02-08 00:58:25 UTC (rev 228251)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html	2018-02-08 01:25:06 UTC (rev 228252)
@@ -10,6 +10,14 @@
     const hostUnderTest = "127.0.0.1:8000";
     const statisticsUrl = "http://" + hostUnderTest + "/temp";
     const otherPrevalentUrl = "http://localhost:8000/temp";
+
+    function setEnableFeature(enable) {
+        if (!enable)
+            testRunner.statisticsResetToConsistentState();
+        internals.setResourceLoadStatisticsEnabled(enable);
+        testRunner.setCookieStoragePartitioningEnabled(enable);
+    }
+
     function runTestRunnerTest() {
         if (document.cookie !== "")
             testFailed("document.cookie not empty.");
@@ -32,13 +40,13 @@
         if (!testRunner.isStatisticsHasHadUserInteraction(statisticsUrl))
             testFailed("Host did not get logged for user interaction.");
 
-        testRunner.installStatisticsDidModifyDataRecordsCallback(function() {
+        testRunner.installStatisticsDidScanDataRecordsCallback(function() {
             if (document.cookie === cookie)
                 testPassed("Cookie not deleted.");
             else
                 testFailed("Cookie deleted or document.cookie contains other cookies: " + document.cookie);
-            testRunner.statisticsResetToConsistentState();
-            internals.setResourceLoadStatisticsEnabled(false);
+
+            setEnableFeature(false);
             testRunner.notifyDone();
         });
         testRunner.setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(false);
@@ -48,7 +56,7 @@
 
     if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
         testRunner.waitUntilDone();
-        internals.setResourceLoadStatisticsEnabled(true);
+        setEnableFeature(true);
         testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
         runTestRunnerTest();
     }

Modified: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html (228251 => 228252)


--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html	2018-02-08 00:58:25 UTC (rev 228251)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html	2018-02-08 01:25:06 UTC (rev 228252)
@@ -10,6 +10,14 @@
     const hostUnderTest = "127.0.0.1:8000";
     const statisticsUrl = "http://" + hostUnderTest + "/temp";
     const otherPrevalentUrl = "http://localhost:8000/temp";
+
+    function setEnableFeature(enable) {
+        if (!enable)
+            testRunner.statisticsResetToConsistentState();
+        internals.setResourceLoadStatisticsEnabled(enable);
+        testRunner.setCookieStoragePartitioningEnabled(enable);
+    }
+
     function runTestRunnerTest() {
         if (document.cookie !== "")
             testFailed("document.cookie not empty.");
@@ -32,13 +40,13 @@
         if (testRunner.isStatisticsHasHadUserInteraction(statisticsUrl))
             testFailed("Host did not get cleared of user interaction.");
 
-        testRunner.installStatisticsDidModifyDataRecordsCallback(function() {
+        testRunner.installStatisticsDidScanDataRecordsCallback(function() {
             if (document.cookie === cookie)
                 testPassed("Cookie not deleted.");
             else
                 testFailed("Cookie deleted or document.cookie contains other cookies: " + document.cookie);
-            testRunner.statisticsResetToConsistentState();
-            internals.setResourceLoadStatisticsEnabled(false);
+
+            setEnableFeature(false);
             testRunner.notifyDone();
         });
         testRunner.setStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval(false);
@@ -48,7 +56,7 @@
 
     if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
         testRunner.waitUntilDone();
-        internals.setResourceLoadStatisticsEnabled(true);
+        setEnableFeature(true);
         testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
         runTestRunnerTest();
     }

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (228251 => 228252)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2018-02-08 00:58:25 UTC (rev 228251)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2018-02-08 01:25:06 UTC (rev 228252)
@@ -741,7 +741,6 @@
 
 # Touch events are not available on open source bots, thus only tested on Mac.
 http/tests/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html [ Pass ]
-http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html [ Pass ]
 http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal.html [ Pass ]
 [ HighSierra+ ] http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html [ Pass ]
 [ HighSierra+ ] http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html [ Pass ]
@@ -762,6 +761,9 @@
 [ HighSierra+ ] http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html [ Pass ]
 [ HighSierra+ ] http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html [ Pass ]
 
+# As of https://trac.webkit.org/changeset/227762 the timestampResolution is just 5 seconds which makes this test flaky
+http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html [ Skip ]
+
 webkit.org/b/173861 [ Release ] http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html [ Pass Timeout ]
 webkit.org/b/173861 [ Release ] http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html [ Pass Timeout ]
 
@@ -879,6 +881,3 @@
 webkit.org/b/181957 [ Release ] http/tests/misc/resource-timing-resolution.html [ Pass Failure ]
 
 webkit.org/b/181835 webrtc/captureCanvas-webrtc.html [ Pass Timeout ]
-
-webkit.org/b/182366 http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html [ Skip ]
-

Modified: trunk/LayoutTests/platform/wk2/TestExpectations (228251 => 228252)


--- trunk/LayoutTests/platform/wk2/TestExpectations	2018-02-08 00:58:25 UTC (rev 228251)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2018-02-08 01:25:06 UTC (rev 228252)
@@ -679,6 +679,7 @@
 
 # Resource Load Statistics are only supported in WebKit2.
 http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html [ Pass ]
+http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html [ Pass ]
 http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html [ Pass ]
 http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html [ Pass ]
 http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html [ Pass ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to