| Index: third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-frame-errors.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-frame-errors.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-frame-errors.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a18f50f28e58f5806394513450a8f737d858d58f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-frame-errors.html
|
| @@ -0,0 +1,29 @@
|
| +<!DOCTYPE html>
|
| +<title>Credential Manager: get() basics.</title>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script>
|
| +function create_iframe_test(origin) {
|
| + return function (t) {
|
| + window.addEventListener("load", _ => {
|
| + var frame_tests = 0;
|
| + var iframe = document.createElement("iframe");
|
| + iframe.src = origin + "/credentialmanager/resources/iframed-credentialscontainer.html";
|
| + window.addEventListener("message", t.step_func(e => {
|
| + if (e.source == iframe.contentWindow) {
|
| + assert_equals(e.data.credential, null);
|
| + assert_equals(e.data.exception, "SecurityError");
|
| + frame_tests++;
|
| + if (frame_tests == 3)
|
| + t.done();
|
| + }
|
| + }));
|
| + document.body.appendChild(iframe);
|
| + });
|
| + };
|
| +}
|
| +
|
| +async_test(create_iframe_test("http://127.0.0.1:8000"), "Same-origin IFrame throws.");
|
| +async_test(create_iframe_test("http://example.test:8000"), "Cross-origin IFrame throws.");
|
| +</script>
|
| +
|
|
|