| 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>
|
|
|