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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-redirect.html

Issue 1844053003: CREDENTIAL: Rework the integration with Fetch (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear attachedcredentials Created 4 years, 8 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/credentialmanager/passwordcredential-redirect.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-redirect.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-redirect.html
new file mode 100644
index 0000000000000000000000000000000000000000..86affd92d9db9cb4219dbe3dbeab4ac0d935296b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-redirect.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Credential Manager: PasswordCredential basics.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="/serviceworker/resources/interfaces.js"></script>
+<script>
+var c = new PasswordCredential({
+ id: 'id',
+ password: 'pencil',
+ name: 'name',
+ iconURL: 'https://example.com/icon.png'
+});
+
+promise_test(function() {
+ return fetch("./resources/redirect-to-echo-post.php", { credentials: c, method: "POST" })
+ .then(resp => {
+ assert_equals(resp.url, 'http://127.0.0.1:8000/credentialmanager/resources/redirect-to-echo-post.php');
+ assert_equals(resp.type, 'opaqueredirect');
+ assert_equals(resp.status, 0);
+ return resp.text()
+ })
+ .then(t => assert_equals(t, ''));
+}, "Same-origin redirect");
+
+promise_test(function() {
+ return fetch("./resources/redirect-to-echo-post.php?origin=http://example.test:8000", { credentials: c, method: "POST" })
+ .then(resp => {
+ assert_equals(resp.url, 'http://127.0.0.1:8000/credentialmanager/resources/redirect-to-echo-post.php?origin=http://example.test:8000');
+ assert_equals(resp.type, 'opaqueredirect');
+ assert_equals(resp.status, 0);
+ return resp.text()
+ })
+ .then(t => assert_equals(t, ''));
+}, "Cross-origin redirect");
+</script>

Powered by Google App Engine
This is Rietveld 408576698