| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-password"> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 |
| 7 test(function() { |
| 8 var url = new URL('http://www.domain.com/'); |
| 9 assert_equals(url.password, ''); |
| 10 |
| 11 url = new URL('http://user:pass@www.domain.com/'); |
| 12 assert_equals(url.password, 'pass'); |
| 13 |
| 14 url.password = 'changed'; |
| 15 assert_equals(url.toString(), 'http://user:changed@www.domain.com/'); |
| 16 |
| 17 url.password = ''; |
| 18 assert_equals(url.toString(), 'http://user@www.domain.com/'); |
| 19 }, 'password property'); |
| 20 |
| 21 test(function() { |
| 22 var url = new URL('about:test'); |
| 23 assert_equals(url.password, ''); |
| 24 |
| 25 url.password = 'pass'; |
| 26 assert_equals(url.password, ''); |
| 27 assert_equals(url.toString(), 'about:test'); |
| 28 }, 'password property on non relative URL'); |
| 29 |
| 30 test(function() { |
| 31 var url = new URL('http://www.domain.com/'); |
| 32 url.href = 'invalid'; |
| 33 assert_equals(url.password, ''); |
| 34 |
| 35 url.password = 'pass'; |
| 36 assert_equals(url.password, ''); |
| 37 assert_equals(url.href, 'invalid'); |
| 38 }, 'password property invalid URL'); |
| 39 |
| 40 </script> |
| OLD | NEW |