Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / domurl / url-protocol.html
blob4c3a6f76ab5d6f11b3ed19b7406958ee0b99e42f
1 <!DOCTYPE HTML>
2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-protocol">
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.protocol, 'http:');
11 url.protocol = 'https';
12 assert_equals(url.protocol, 'https:');
14 url.protocol = 'https:';
15 assert_equals(url.protocol, 'https:');
17 url.protocol = 'invalid/protocol';
18 assert_equals(url.protocol, 'https:');
19 }, 'protocol property');
21 test(function() {
22 var url = new URL('http://www.domain.com');
23 url.href = 'invalid';
24 assert_equals(url.protocol, ':');
26 url.protocol = 'http';
27 assert_equals(url.protocol, ':');
28 assert_equals(url.href, 'invalid');
29 }, 'protocol property invalid URL');
31 </script>