diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/bindings/test/test_usvstring.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/bindings/test/test_usvstring.html')
-rw-r--r-- | dom/bindings/test/test_usvstring.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dom/bindings/test/test_usvstring.html b/dom/bindings/test/test_usvstring.html new file mode 100644 index 000000000..cbb1e7971 --- /dev/null +++ b/dom/bindings/test/test_usvstring.html @@ -0,0 +1,41 @@ +<!-- Any copyright is dedicated to the Public Domain. + - http://creativecommons.org/publicdomain/zero/1.0/ --> +<!DOCTYPE HTML> +<html> +<head> + <title>Test USVString</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<script class="testbody" type="application/javascript"> +SimpleTest.waitForExplicitFinish(); +SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]}, function() { + var testInterfaceJS = new TestInterfaceJS(); + ok(testInterfaceJS, "got a TestInterfaceJS object"); + // For expected values, see algorithm definition here: + // http://heycam.github.io/webidl/#dfn-obtain-unicode + var testList = [ + { string: "foo", + expected: "foo" }, + { string: "This is U+2070E: \ud841\udf0e", + expected: "This is U+2070E: \ud841\udf0e" }, + { string: "Missing low surrogate: \ud841", + expected: "Missing low surrogate: \ufffd" }, + { string: "Missing low surrogate with trailer: \ud841!!", + expected: "Missing low surrogate with trailer: \ufffd!!" }, + { string: "Missing high surrogate: \udf0e", + expected: "Missing high surrogate: \ufffd" }, + { string: "Missing high surrogate with trailer: \udf0e!!", + expected: "Missing high surrogate with trailer: \ufffd!!" }, + { string: "U+2070E after malformed: \udf0e\ud841\udf0e", + expected: "U+2070E after malformed: \ufffd\ud841\udf0e" } + ]; + testList.forEach(function(test) { + is(testInterfaceJS.convertSVS(test.string), test.expected, "Convert '" + test.string + "'"); + }); + SimpleTest.finish(); +}); +</script> +</body> +</html> |