| Index: LayoutTests/fast/domurl/url-protocol.html
|
| diff --git a/LayoutTests/fast/domurl/url-protocol.html b/LayoutTests/fast/domurl/url-protocol.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4c3a6f76ab5d6f11b3ed19b7406958ee0b99e42f
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/domurl/url-protocol.html
|
| @@ -0,0 +1,31 @@
|
| +<!DOCTYPE HTML>
|
| +<link rel="help" href="http://url.spec.whatwg.org/#dom-url-protocol">
|
| +<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.protocol, 'http:');
|
| +
|
| + url.protocol = 'https';
|
| + assert_equals(url.protocol, 'https:');
|
| +
|
| + url.protocol = 'https:';
|
| + assert_equals(url.protocol, 'https:');
|
| +
|
| + url.protocol = 'invalid/protocol';
|
| + assert_equals(url.protocol, 'https:');
|
| +}, 'protocol property');
|
| +
|
| +test(function() {
|
| + var url = new URL('http://www.domain.com');
|
| + url.href = 'invalid';
|
| + assert_equals(url.protocol, ':');
|
| +
|
| + url.protocol = 'http';
|
| + assert_equals(url.protocol, ':');
|
| + assert_equals(url.href, 'invalid');
|
| +}, 'protocol property invalid URL');
|
| +
|
| +</script>
|
|
|