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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/beacon-blob-with-non-simple-type.html

Issue 2184973002: Add UMA to count the usage of sendBeacon with non-simple Content-Type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/navigation/beacon-blob-with-non-simple-type.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/beacon-blob-with-non-simple-type.html b/third_party/WebKit/LayoutTests/http/tests/navigation/beacon-blob-with-non-simple-type.html
new file mode 100644
index 0000000000000000000000000000000000000000..04fad8f62cde1cc886f60157cc632e2b7a79c274
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/beacon-blob-with-non-simple-type.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<script src="/js-test-resources/testharness.js"></script>
+<script src="/js-test-resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ assert_throws(
+ 'SecurityError',
+ () => {
+ navigator.sendBeacon("/",
+ new Blob(["X"], {type: "image/png"}));
+ });
+}, "navigator.sendBeacon() to a cross-origin target with a Blob body with " +
+ "non-simple type should throw.");
+</script>

Powered by Google App Engine
This is Rietveld 408576698