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

Unified Diff: LayoutTests/http/tests/security/document-origin-domain.html

Issue 758913002: Implement the 'document.origin' accessor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moar assertions. Created 6 years, 1 month 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: LayoutTests/http/tests/security/document-origin-domain.html
diff --git a/LayoutTests/http/tests/security/document-origin-domain.html b/LayoutTests/http/tests/security/document-origin-domain.html
new file mode 100644
index 0000000000000000000000000000000000000000..42211a3279194d66f411c5886570e7dd97cb6c4c
--- /dev/null
+++ b/LayoutTests/http/tests/security/document-origin-domain.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<head>
+ <title>document.origin + document.domain</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script>
+ if (document.location.hostname == "127.0.0.1")
+ document.location = "http://subdomain.example.test:8000/security/document-origin-domain.html";
+ </script>
+</head>
+<body>
+
+<script>
+test(function() {
+ assert_equals(document.origin, 'http://subdomain.example.test:8000');
+ assert_equals(document.domain, 'subdomain.example.test');
+
+ document.domain = 'example.test';
+
+ assert_equals(document.origin, 'http://subdomain.example.test:8000');
+ assert_equals(document.domain, 'example.test');
+}, 'document.domain does not effect document.origin.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698