Switch testRunner.installStatisticsDidModifyDataRecordsCallback() to testRunner.insta...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Feb 2018 01:25:06 +0000 (01:25 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Feb 2018 01:25:06 +0000 (01:25 +0000)
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 ].

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228252 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/wk2/TestExpectations

index 401c061..7869d17 100644 (file)
@@ -1,3 +1,23 @@
+2018-02-07  John Wilander  <wilander@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  <ryanhaddad@apple.com>
 
         Skip media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html.
index 27ee722..fcb51f5 100644 (file)
     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.");
         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();
     }
index 6fca777..d331267 100644 (file)
     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.");
         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();
     }
index ae23a14..3ee8cc9 100644 (file)
@@ -741,7 +741,6 @@ webkit.org/b/172397 [ Debug ] animations/needs-layout.html [ Pass ImageOnlyFailu
 
 # 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 @@ http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-r
 [ 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/181753 [ HighSierra Release ] http/wpt/service-workers/update-servi
 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 ]
-
index 0dc9637..7b6aad1 100644 (file)
@@ -679,6 +679,7 @@ imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached.h
 
 # 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 ]