Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5368)

Unified Diff: chrome/test/data/subresource_filter/websocket_connection.js

Issue 2714573002: Enable websocket filtering via SubresourceFilter (Closed)
Patch Set: sync to #455176 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/subresource_filter/websocket_connection.js
diff --git a/chrome/test/data/subresource_filter/websocket_connection.js b/chrome/test/data/subresource_filter/websocket_connection.js
new file mode 100644
index 0000000000000000000000000000000000000000..de43a5a0f3156d7917fdce6b2e1076a9b12bc786
--- /dev/null
+++ b/chrome/test/data/subresource_filter/websocket_connection.js
@@ -0,0 +1,11 @@
+// Note: This JS can run either in a worker or as a script in the main document
+// context.
+function connectWebSocketWithMessageCallback(url, messageCallback) {
+ var ws = new WebSocket(url);
+
+ ws.onopen = () => { ws.send('hello world'); };
+
+ ws.onclose = () => { messageCallback('onclose'); };
+
+ ws.onmessage = () => { messageCallback('onmessage'); };
+}
« no previous file with comments | « chrome/test/data/subresource_filter/page_with_websocket.html ('k') | chrome/test/data/subresource_filter/websocket_worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698