Diff
Modified: trunk/LayoutTests/ChangeLog (235192 => 235193)
--- trunk/LayoutTests/ChangeLog 2018-08-22 20:02:31 UTC (rev 235192)
+++ trunk/LayoutTests/ChangeLog 2018-08-22 20:07:17 UTC (rev 235193)
@@ -1,3 +1,20 @@
+2018-08-22 John Wilander <[email protected]>
+
+ Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
+ https://bugs.webkit.org/show_bug.cgi?id=188856
+
+ Unreviewed test gardening.
+
+ * TestExpectations:
+ Skipped test since it's only valid on WK2 platforms.
+ * http/tests/websocket/connection-refusal-in-frame-resource-load-statistics-expected.txt: Added.
+ * http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html: Renamed from LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html.
+ * http/tests/websocket/construct-in-detached-frame-resource-load-statistics-expected.txt: Removed.
+ * http/tests/websocket/resources/construct-in-detached-frame-resource-load-statistics.html: Removed.
+ * http/tests/websocket/resources/localhost-websocket-connect.html: Added.
+ * platform/wk2/TestExpectations:
+ Marked test as [ Pass ].
+
2018-08-22 Ryan Haddad <[email protected]>
[iOS] Rebaseline table tests
Modified: trunk/LayoutTests/TestExpectations (235192 => 235193)
--- trunk/LayoutTests/TestExpectations 2018-08-22 20:02:31 UTC (rev 235192)
+++ trunk/LayoutTests/TestExpectations 2018-08-22 20:07:17 UTC (rev 235193)
@@ -115,7 +115,7 @@
http/tests/misc/will-send-request-with-client-provided-http-body.html [ Skip ]
http/tests/loading/resourceLoadStatistics/ [ Skip ]
http/tests/resourceLoadStatistics/ [ Skip ]
-http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html [ Skip ]
+http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html [ Skip ]
http/tests/storageAccess/ [ Skip ]
http/tests/navigation/process-swap-window-open.html [ Skip ]
http/tests/navigation/useragent-reload.php [ Skip ]
Added: trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics-expected.txt (0 => 235193)
--- trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics-expected.txt 2018-08-22 20:07:17 UTC (rev 235193)
@@ -0,0 +1,12 @@
+CONSOLE MESSAGE: WebSocket network error: The operation couldn’t be completed. Connection refused
+CONSOLE MESSAGE: WebSocket network error: The operation couldn’t be completed. Connection refused
+Construct a cross-site WebSocket in a frame with server-side refusal. The test passes if Resource Load Statistics logs it properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS localhost registered as subresource under 127.0.0.1.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html (from rev 235192, trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html) (0 => 235193)
--- trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html (rev 0)
+++ trunk/LayoutTests/http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html 2018-08-22 20:07:17 UTC (rev 235193)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<head>
+ <script src=""
+ <script src=""
+</head>
+<body _onload_="runTest()">
+<script>
+ description('Construct a cross-site WebSocket in a frame with server-side refusal. The test passes if Resource Load Statistics logs it properly.');
+
+ window.jsTestIsAsync = true;
+
+ function completeTest() {
+ 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);
+ }
+
+ function runTest() {
+ setEnableFeature(true, function() {
+ 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);
+ });
+ }
+</script>
+<script src=""
+</body>
Deleted: trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics-expected.txt (235192 => 235193)
--- trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics-expected.txt 2018-08-22 20:02:31 UTC (rev 235192)
+++ trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics-expected.txt 2018-08-22 20:07:17 UTC (rev 235193)
@@ -1,5 +0,0 @@
-PASS localhost registered as subresource under 127.0.0.1.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html (235192 => 235193)
--- trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html 2018-08-22 20:02:31 UTC (rev 235192)
+++ trunk/LayoutTests/http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html 2018-08-22 20:07:17 UTC (rev 235193)
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<head>
- <script src=""
- <script src=""
-</head>
-<body _onload_="runTest()">
-<script>
- description('Construct a WebSocket in a detached frame. The test passes if Resource Load Statistics logs it properly.');
-
- window.jsTestIsAsync = true;
-
- function detachIframe() {
- var testIframe = document.getElementById('testIframe');
- testIframe.parentNode.remove(testIframe);
- }
-
- function completeTest() {
- 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);
- }
-
- let dataRecordsScanned = false;
- function didScanDataRecords() {
- dataRecordsScanned = true;
- if (createdWebSocket)
- completeTest();
- }
-
- let createdWebSocket = false;
- function didCreateWebSocket() {
- createdWebSocket = true;
- if (dataRecordsScanned)
- completeTest();
- }
-
- function runTest() {
- setEnableFeature(true, function() {
- 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(didScanDataRecords);
-
- let iframeElement = document.createElement("iframe");
- iframeElement.src = ""
- iframeElement.id = "testIframe";
- document.body.appendChild(iframeElement);
- });
- }
-</script>
-<script src=""
-</body>
Deleted: trunk/LayoutTests/http/tests/websocket/resources/construct-in-detached-frame-resource-load-statistics.html (235192 => 235193)
--- trunk/LayoutTests/http/tests/websocket/resources/construct-in-detached-frame-resource-load-statistics.html 2018-08-22 20:02:31 UTC (rev 235192)
+++ trunk/LayoutTests/http/tests/websocket/resources/construct-in-detached-frame-resource-load-statistics.html 2018-08-22 20:07:17 UTC (rev 235193)
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<script>
- var parentWindow = parent;
- var webSocketClass = WebSocket;
-
- parentWindow.detachIframe();
- try {
- new webSocketClass('ws://localhost/');
- } catch (e) {
- parentWindow.console.log(e.message);
- }
- parentWindow.didCreateWebSocket();
-</script>
Added: trunk/LayoutTests/http/tests/websocket/resources/localhost-websocket-connect.html (0 => 235193)
--- trunk/LayoutTests/http/tests/websocket/resources/localhost-websocket-connect.html (rev 0)
+++ trunk/LayoutTests/http/tests/websocket/resources/localhost-websocket-connect.html 2018-08-22 20:07:17 UTC (rev 235193)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<script>
+ new WebSocket('ws://localhost/');
+</script>
Modified: trunk/LayoutTests/platform/wk2/TestExpectations (235192 => 235193)
--- trunk/LayoutTests/platform/wk2/TestExpectations 2018-08-22 20:02:31 UTC (rev 235192)
+++ trunk/LayoutTests/platform/wk2/TestExpectations 2018-08-22 20:07:17 UTC (rev 235193)
@@ -721,7 +721,7 @@
webkit.org/b/180703 http/tests/resourceLoadStatistics/telemetry-generation.html [ Pass Failure ]
http/tests/resourceLoadStatistics/prune-statistics.html [ Pass ]
http/tests/resourceLoadStatistics [ Pass ]
-http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html [ Pass ]
+http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html [ Pass ]
# These are only supported behind a compile time flag in macOS High Sierra + iOS 11, and above.
http/tests/resourceLoadStatistics/cookie-deletion.html [ Skip ]
http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html [ Skip ]