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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-worker-basic.html

Issue 1754713006: CORS-RFC1918: Introduce the 'addressSpace' IDL attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar webexposed Created 4 years, 10 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/security/cors-rfc1918/addressspace-worker-basic.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-worker-basic.html b/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-worker-basic.html
new file mode 100644
index 0000000000000000000000000000000000000000..47fe56f0682269ee8f81003a1f239e1fca2bd69f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/addressspace-worker-basic.html
@@ -0,0 +1,62 @@
+<!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-from-worker.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");
+ // TODO(mkwst): Broken.
philipj_slow 2016/03/04 04:35:08 Oh, there's nothing that actually calls setAddress
Mike West 2016/03/04 05:53:54 That's https://codereview.chromium.org/1760523004,
philipj_slow 2016/03/04 10:42:12 Haha, pass on that one :)
+ assert_equals(e.data.addressSpace, "local");
+ t.done();
+ }
+ }));
+
+ document.body.appendChild(i);
+ }, "localhost == 'local'");
+
+ 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");
+ // TODO(mkwst): Broken.
+ 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");
+ // TODO(mkwst): Broken.
+ assert_equals(e.data.addressSpace, "private");
+ t.done();
+ }
+ }));
+
+ document.body.appendChild(i);
+ }, "example.test == 'private'");
+ </script>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698