summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/url/url-domainToUnicode.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/url/url-domainToUnicode.html')
-rw-r--r--testing/web-platform/tests/url/url-domainToUnicode.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/web-platform/tests/url/url-domainToUnicode.html b/testing/web-platform/tests/url/url-domainToUnicode.html
new file mode 100644
index 000000000..1bd553679
--- /dev/null
+++ b/testing/web-platform/tests/url/url-domainToUnicode.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title></title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+ test(function() {
+ var domain = 'example.org'
+ assert_true(URL.domainToUnicode(domain) === domain, 'Ascii domain should be parsed correctly.')
+ }, 'URL.domainToUnicode valid input')
+
+ test(function() {
+ var domain = 'xn--maana-pta.com'
+ assert_true(URL.domainToUnicode(domain) === 'maƱana.com', ' Ascii encoded domain should be parsed correctly.')
+ }, 'URL.domainToUnicode valid encoded input')
+
+ test(function() {
+ var domain = 'http://not.a.domain'
+ assert_true(URL.domainToUnicode(domain) === "", 'Invalid domain should be return an empty string.')
+ }, 'URL.domainToUnicode invalid input')
+</script>