| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <head> |
| 3 <script src="/resources/testharness.js"></script> | 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script> | 5 <script> |
| 6 </script> | 6 </script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 | 9 |
| 10 <script> | 10 <script> |
| 11 if (document.location.hostname == "127.0.0.1") { | 11 if (document.location.hostname == "127.0.0.1") { |
| 12 document.location.hostname = "subdomain.example.test"; | 12 document.location.hostname = "sub,.subdomain.example.test"; |
| 13 } else { | 13 } else { |
| 14 test(function() { | 14 test(function() { |
| 15 // Properly canonicalize the host. |
| 16 assert_equals(document.location.hostname, "sub%2C.subdomain.example.test")
; |
| 17 |
| 15 document.domain = 'EXAMPLE.TEST'; | 18 document.domain = 'EXAMPLE.TEST'; |
| 16 assert_equals(document.domain, 'example.test'); | 19 assert_equals(document.domain, 'example.test'); |
| 17 | 20 |
| 18 document.domain = 'subdomain.eXamPle.tEst'; | 21 document.domain = 'subdomain.eXamPle.tEst'; |
| 19 assert_equals(document.domain, 'subdomain.example.test'); | 22 assert_equals(document.domain, 'subdomain.example.test'); |
| 23 |
| 24 document.domain = 'sub,.subdomain.example.test'; |
| 25 assert_equals(document.domain, 'sub%2C.subdomain.example.test'); |
| 26 |
| 20 }, 'document.domain goes through proper canonicalization.'); | 27 }, 'document.domain goes through proper canonicalization.'); |
| 21 } | 28 } |
| 22 </script> | 29 </script> |
| 23 | 30 |
| OLD | NEW |