Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-basic.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-basic.html b/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-basic.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..db6593117dadd7d9f76ea6b8e27f081d86497a68 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-document-basic.html |
| @@ -0,0 +1,58 @@ |
| +<!doctype html> |
| +<html> |
|
philipj_slow
2016/03/04 04:35:08
https://www.chromium.org/blink/coding-style/layout
Mike West
2016/03/04 05:53:54
Huh. I've never ever done that. :(
In this case,
philipj_slow
2016/03/04 10:42:12
When I need a <body> I usually just add that befor
|
| +<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"; |
| + 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, "local"); |
| + t.done(); |
| + } |
| + })); |
| + |
| + document.body.appendChild(i); |
| + }, "localhost == 'local'"); |
| + |
| + async_test(function (t) { |
|
philipj_slow
2016/03/04 04:35:08
It looks like all three of these tests could be ge
Mike West
2016/03/04 08:58:21
Makes sense. Done.
|
| + 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, "local"); |
| + t.done(); |
| + } |
| + })); |
| + |
| + document.body.appendChild(i); |
| + }, "127.0.0.1 == 'local'"); |
| + |
| + 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, "private"); |
|
philipj_slow
2016/03/04 04:35:08
So this isn't what I would have guessed, but then
Mike West
2016/03/04 05:53:54
I thought I'd added a comment here...
The idea is
philipj_slow
2016/03/04 10:42:12
So my surprise was that this is "private" instead
|
| + t.done(); |
| + } |
| + })); |
| + |
| + document.body.appendChild(i); |
| + }, "example.test == 'private'"); |
| + </script> |
| +</body> |
| +</html> |