Title: [235210] trunk/LayoutTests
Revision
235210
Author
wilan...@apple.com
Date
2018-08-22 16:10:35 -0700 (Wed, 22 Aug 2018)

Log Message

Further adjustments to http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html
https://bugs.webkit.org/show_bug.cgi?id=188856

Unreviewed test gardening. Trying to address flakiness I can't reproduce locally.


* http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (235209 => 235210)


--- trunk/LayoutTests/ChangeLog	2018-08-22 22:54:34 UTC (rev 235209)
+++ trunk/LayoutTests/ChangeLog	2018-08-22 23:10:35 UTC (rev 235210)
@@ -1,3 +1,12 @@
+2018-08-22  John Wilander  <wilan...@apple.com>
+
+        Further adjustments to http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html
+        https://bugs.webkit.org/show_bug.cgi?id=188856
+
+        Unreviewed test gardening. Trying to address flakiness I can't reproduce locally.
+
+        * http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html:
+
 2018-08-22  Justin Fan  <justin_...@apple.com>
 
         Update webkit-webgl-test-harness.js for more details on WebGL 2 conformance tests

Modified: trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html (235209 => 235210)


--- trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html	2018-08-22 22:54:34 UTC (rev 235209)
+++ trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html	2018-08-22 23:10:35 UTC (rev 235210)
@@ -9,12 +9,22 @@
 
     window.jsTestIsAsync = true;
 
+    const numberOfNotificationsExpected = 2;
+    let numberOfNotificationsReceived = 0;
     function completeTest() {
-        if (testRunner.isStatisticsRegisteredAsSubresourceUnder("http://localhost", "http://127.0.0.1"))
+        numberOfNotificationsReceived++;
+        if (testRunner.isStatisticsRegisteredAsSubresourceUnder("http://localhost", "http://127.0.0.1")) {
             testPassed("localhost registered as subresource under 127.0.0.1.");
-        else
-            testFailed("localhost not registered as subresource under 127.0.0.1.");
-        setEnableFeature(false, finishJSTest);
+            setEnableFeature(false, finishJSTest);
+        } else {
+            if (numberOfNotificationsReceived >= numberOfNotificationsExpected) {
+                testFailed("localhost not registered as subresource under 127.0.0.1.");
+                setEnableFeature(false, finishJSTest);
+            } else {
+                testRunner.installStatisticsDidScanDataRecordsCallback(completeTest);
+                testRunner.statisticsNotifyObserver();
+            }
+        }
     }
 
     function runTest() {
@@ -22,13 +32,13 @@
             if (testRunner.isStatisticsRegisteredAsSubresourceUnder("http://localhost", "http://127.0.0.1"))
                 testFailed("localhost already registered as subresource under 127.0.0.1.");
 
-            testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
-            testRunner.installStatisticsDidScanDataRecordsCallback(completeTest);
-
             let iframeElement = document.createElement("iframe");
             iframeElement.src = ""
             iframeElement.id = "testIframe";
             document.body.appendChild(iframeElement);
+
+            testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+            testRunner.installStatisticsDidScanDataRecordsCallback(completeTest);
         });
     }
 </script>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to