1 <!-- Any copyright is dedicated to the Public Domain.
2 - http://creativecommons.org/publicdomain/zero/1.0/ -->
6 <title>Test ScalarValueString
</title>
7 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <script class=
"testbody" type=
"application/javascript">
12 SimpleTest.waitForExplicitFinish();
13 SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]}, function() {
14 var testInterfaceJS = new TestInterfaceJS();
15 ok(testInterfaceJS,
"got a TestInterfaceJS object");
16 // For expected values, see algorithm definition here:
17 // http://heycam.github.io/webidl/#dfn-obtain-unicode
21 { string:
"This is U+2070E: \ud841\udf0e",
22 expected:
"This is U+2070E: \ud841\udf0e" },
23 { string:
"Missing low surrogate: \ud841",
24 expected:
"Missing low surrogate: \ufffd" },
25 { string:
"Missing low surrogate with trailer: \ud841!!",
26 expected:
"Missing low surrogate with trailer: \ufffd!!" },
27 { string:
"Missing high surrogate: \udf0e",
28 expected:
"Missing high surrogate: \ufffd" },
29 { string:
"Missing high surrogate with trailer: \udf0e!!",
30 expected:
"Missing high surrogate with trailer: \ufffd!!" },
31 { string:
"U+2070E after malformed: \udf0e\ud841\udf0e",
32 expected:
"U+2070E after malformed: \ufffd\ud841\udf0e" }
34 testList.forEach(function(test) {
35 is(testInterfaceJS.convertSVS(test.string), test.expected,
"Convert '" + test.string +
"'");