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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-cross-origin-redirect-blob.html

Issue 2870383002: Have sendBeacon throw for Blobs with a type that is not CORS-safelisted. (Closed)
Patch Set: Rebase Created 3 years, 7 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/sendbeacon/beacon-cross-origin-redirect-blob.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-cross-origin-redirect-blob.html b/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-cross-origin-redirect-blob.html
index 6fa52344eeb0c5098c708edc82737f13891a30bc..adb4cf6a85bd2785f875d838ad5eb1c97c4832b7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-cross-origin-redirect-blob.html
+++ b/third_party/WebKit/LayoutTests/http/tests/sendbeacon/beacon-cross-origin-redirect-blob.html
@@ -1,31 +1,13 @@
<!DOCTYPE HTML>
-<html>
-<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Verifying navigator.sendBeacon(Blob) non-CORS cross-origin redirect handling.");
-window.jsTestIsAsync = true;
-
-var blob;
-function test() {
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpPingLoaderCallbacks();
- }
-
- blob = new Blob(["Cross", "Origin"], {type: "text/plain;from-beacon=true"});
- // The "simple" parameter is just for differentiating the URLs.
- shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/resources/redirection-response.php?status=302&simple=true&target=/non-existent.php", blob);');
- // Wait a while for the redirect response handling to happen before finishing up.
- setTimeout(function () {
- blob = new Blob([new Uint8Array(20)], {type: "application/octet-stream"});
- shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/resources/redirection-response.php?status=302&simple=false&target=/non-existent.php", blob);');
- setTimeout(finishJSTest, 200);
- }, 200);
+if (window.testRunner) {
+ testRunner.dumpPingLoaderCallbacks();
}
+
+const blob = new Blob(["Cross", "Origin"], {type: "text/plain;from-beacon=true"});
+// The "simple" parameter is just for differentiating the URLs.
+shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/resources/redirection-response.php?status=302&simple=true&target=/non-existent.php", blob);');
</script>
-</head>
-<body onload="test();">
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698