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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/document-domain-invalid.html

Issue 2447293002: Don't call lower() on KURL protocol/host (Closed)
Patch Set: add canonicalization layout test Created 4 years, 2 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/document-domain-invalid.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/document-domain-invalid.html b/third_party/WebKit/LayoutTests/http/tests/security/document-domain-invalid.html
index 5bfacbd301e85423b93d0dd0f2a6752370e4207f..91fd118d9d170c89cdcd13c17e922c7e24958a4d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/document-domain-invalid.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/document-domain-invalid.html
@@ -31,5 +31,22 @@
});
assert_equals(document.domain, '127.0.0.1');
}, 'Setting an invalid `document.domain` that looks like an IP address fails.');
+
+ test(function () {
+ assert_equals(document.domain, '127.0.0.1');
+ assert_throws('SecurityError',
+ function () {
+ document.domain = '[]';
+ });
+ assert_throws('SecurityError',
+ function () {
+ document.domain = 'example.test/path';
+ });
+ assert_throws('SecurityError',
+ function () {
+ document.domain = '%.com';
+ });
+ assert_equals(document.domain, '127.0.0.1');
+ }, 'Setting `document.domain` to a host that fails to parse fails.');
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698