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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Setting `document.domain` to invalid values fails.</title> 4 <title>Setting `document.domain` to invalid values fails.</title>
5 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <script> 7 <script>
8 test(function () { 8 test(function () {
9 assert_equals(document.domain, '127.0.0.1'); 9 assert_equals(document.domain, '127.0.0.1');
10 assert_throws('SecurityError', 10 assert_throws('SecurityError',
(...skipping 13 matching lines...) Expand all
24 }, 'Setting `document.domain` to the empty string fails.'); 24 }, 'Setting `document.domain` to the empty string fails.');
25 25
26 test(function () { 26 test(function () {
27 assert_equals(document.domain, '127.0.0.1'); 27 assert_equals(document.domain, '127.0.0.1');
28 assert_throws('SecurityError', 28 assert_throws('SecurityError',
29 function () { 29 function () {
30 document.domain = '0.0000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000001.1'; 30 document.domain = '0.0000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000001.1';
31 }); 31 });
32 assert_equals(document.domain, '127.0.0.1'); 32 assert_equals(document.domain, '127.0.0.1');
33 }, 'Setting an invalid `document.domain` that looks like an IP address f ails.'); 33 }, 'Setting an invalid `document.domain` that looks like an IP address f ails.');
34
35 test(function () {
36 assert_equals(document.domain, '127.0.0.1');
37 assert_throws('SecurityError',
38 function () {
39 document.domain = '[]';
40 });
41 assert_throws('SecurityError',
42 function () {
43 document.domain = 'example.test/path';
44 });
45 assert_throws('SecurityError',
46 function () {
47 document.domain = '%.com';
48 });
49 assert_equals(document.domain, '127.0.0.1');
50 }, 'Setting `document.domain` to a host that fails to parse fails.');
34 </script> 51 </script>
35 </head> 52 </head>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698