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

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

Issue 2177383006: Update and fix sendBeacon() redirect behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve content type initialization Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob.html b/third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob.html
new file mode 100644
index 0000000000000000000000000000000000000000..1d8ce2bc03f9a787d4a7415d8c7ebe9b8fef4f4f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob.html
@@ -0,0 +1,30 @@
+<!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"});
+ shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/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/navigation/resources/redirection-response.php?status=302&simple=false&target=non-existent.php", blob);');
+ setTimeout(finishJSTest, 200);
+ }, 200);
+}
+</script>
+</head>
+<body onload="test();">
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/navigation/beacon-cross-origin-redirect-blob-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698