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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/websocket/subresource-filter-disallows.html

Issue 2724903004: Add ELEMENT_TYPE_WEBSOCKET to subresource filter (Closed)
Patch Set: rebase 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: third_party/WebKit/LayoutTests/http/tests/websocket/subresource-filter-disallows.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/subresource-filter-disallows.html b/third_party/WebKit/LayoutTests/http/tests/websocket/subresource-filter-disallows.html
new file mode 100644
index 0000000000000000000000000000000000000000..2d2c283646631771ba6e0f4fdaef8671545d9445
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/websocket/subresource-filter-disallows.html
@@ -0,0 +1,18 @@
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+if (window.testRunner)
+ testRunner.setDisallowedSubresourcePathSuffixes(["echo"]);
+
+async_test(t => {
+ let ws_allow = new WebSocket("ws://localhost:8880/pong?payload=Hello");
+ ws_allow.onopen = t.step_func_done();
+}, "Allow websocket connection without matching rule");
+
+async_test(t => {
+ let ws_disallow= new WebSocket("ws://localhost:8880/echo");
+ ws_disallow.onclose = t.step_func_done();
+ ws_disallow.onopen =
+ t.unreached_func("Should not open disallowed web socket connections");
+}, "Filter websocket connection successfully");
+</script>

Powered by Google App Engine
This is Rietveld 408576698