Index: chrome/test/data/safe_browsing/malware_websocket.html |
diff --git a/chrome/test/data/safe_browsing/malware_websocket.html b/chrome/test/data/safe_browsing/malware_websocket.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..df66c39c641cb4957d10dbe85f674a6a9c4918d7 |
--- /dev/null |
+++ b/chrome/test/data/safe_browsing/malware_websocket.html |
@@ -0,0 +1,12 @@ |
+<title>Test whether a WebSocket connection triggers a SafeBrowsing interstitial</title> |
+<script> |
+// Construct the WebSocket URL from the page URL. The server should not be |
+// configured to accept a WebSocket handshake at this endpoint, or the "not |
+// blocked" test will fail. A 404 error is perfect. |
+const wsUrl = new URL('/safe_browsing/malware-ws', document.location.href); |
+wsUrl.protocol = 'ws'; |
+const ws = new WebSocket(wsUrl.href); |
+// The "not blocked" test looks for this title change to verify that the request |
+// has not been blocked. |
+ws.onerror = () => { document.title = 'COMPLETED'; }; |
+</script> |