| Index: LayoutTests/fast/domurl/url-password.html
|
| diff --git a/LayoutTests/fast/domurl/url-password.html b/LayoutTests/fast/domurl/url-password.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..66cb9e95c67643d06f0377e1bc385d09db7237f9
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/domurl/url-password.html
|
| @@ -0,0 +1,40 @@
|
| +<!DOCTYPE HTML>
|
| +<link rel="help" href="http://url.spec.whatwg.org/#dom-url-password">
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +
|
| +test(function() {
|
| + var url = new URL('http://www.domain.com/');
|
| + assert_equals(url.password, '');
|
| +
|
| + url = new URL('http://user:pass@www.domain.com/');
|
| + assert_equals(url.password, 'pass');
|
| +
|
| + url.password = 'changed';
|
| + assert_equals(url.toString(), 'http://user:changed@www.domain.com/');
|
| +
|
| + url.password = '';
|
| + assert_equals(url.toString(), 'http://user@www.domain.com/');
|
| +}, 'password property');
|
| +
|
| +test(function() {
|
| + var url = new URL('about:test');
|
| + assert_equals(url.password, '');
|
| +
|
| + url.password = 'pass';
|
| + assert_equals(url.password, '');
|
| + assert_equals(url.toString(), 'about:test');
|
| +}, 'password property on non relative URL');
|
| +
|
| +test(function() {
|
| + var url = new URL('http://www.domain.com/');
|
| + url.href = 'invalid';
|
| + assert_equals(url.password, '');
|
| +
|
| + url.password = 'pass';
|
| + assert_equals(url.password, '');
|
| + assert_equals(url.href, 'invalid');
|
| +}, 'password property invalid URL');
|
| +
|
| +</script>
|
|
|