| Index: third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-csp.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-csp.html b/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-csp.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7d9bad336cf17ef2760b6d3db0f2a64f7e03d2a9
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-csp.html
|
| @@ -0,0 +1,58 @@
|
| +<!doctype html>
|
| +<html>
|
| +<head>
|
| + <script src="/resources/testharness.js"></script>
|
| + <script src="/resources/testharnessreport.js"></script>
|
| +</head>
|
| +<body>
|
| + <script>
|
| + function createIFrame(origin) {
|
| + var i = document.createElement('iframe');
|
| + i.src = origin + "/security/cors-rfc1918/resources/post-addressspace-to-parent.html?csp";
|
| + return i;
|
| + }
|
| +
|
| + async_test(function (t) {
|
| + var i = createIFrame("http://localhost:8000");
|
| +
|
| + window.addEventListener("message", t.step_func(function (e) {
|
| + if (e.source == i.contentWindow) {
|
| + assert_equals(e.data.host, "localhost:8000");
|
| + assert_equals(e.data.addressSpace, "public");
|
| + t.done();
|
| + }
|
| + }));
|
| +
|
| + document.body.appendChild(i);
|
| + }, "localhost + csp == 'public'");
|
| +
|
| + async_test(function (t) {
|
| + var i = createIFrame("http://127.0.0.1:8000");
|
| +
|
| + window.addEventListener("message", t.step_func(function (e) {
|
| + if (e.source == i.contentWindow) {
|
| + assert_equals(e.data.host, "127.0.0.1:8000");
|
| + assert_equals(e.data.addressSpace, "public");
|
| + t.done();
|
| + }
|
| + }));
|
| +
|
| + document.body.appendChild(i);
|
| + }, "127.0.0.1 + csp == 'public'");
|
| +
|
| + async_test(function (t) {
|
| + var i = createIFrame("http://example.test:8000");
|
| +
|
| + window.addEventListener("message", t.step_func(function (e) {
|
| + if (e.source == i.contentWindow) {
|
| + assert_equals(e.data.host, "example.test:8000");
|
| + assert_equals(e.data.addressSpace, "public");
|
| + t.done();
|
| + }
|
| + }));
|
| +
|
| + document.body.appendChild(i);
|
| + }, "example.test + csp == 'public'");
|
| + </script>
|
| +</body>
|
| +</html>
|
|
|