Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / domurl / url-href.html
blobf5056af6e89058f698b96c14b98895ddb91fe023
1 <!DOCTYPE HTML>
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-href">
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script>
7 test(function() {
8 var url = new URL('http://www.domain.com/');
9 assert_equals(url.href, 'http://www.domain.com/');
10 assert_equals(url.href, url.toString());
12 url.href = 'mailto:foo@bar.com';
13 assert_equals(url.href, 'mailto:foo@bar.com');
15 }, 'href property');
17 test(function() {
18 var url = new URL('http://abc.de/path/file?query#fragment');
19 url.href = 'invalid';
20 assert_equals(url.href, 'invalid');
21 }, 'setting href to an invalid URL');
23 test(function() {
24 var url = new URL('http://domain.com/');
25 url.href = null;
26 assert_equals(url.href, 'null');
27 }, 'setting href to null');
29 </script>