Bumping manifests a=b2g-bump
[gecko.git] / dom / bindings / test / test_scalarvaluestring.html
blobc4afd4fc8d2877e87d9d1ab37f2f6dbf4b2af0ed
1 <!-- Any copyright is dedicated to the Public Domain.
2 - http://creativecommons.org/publicdomain/zero/1.0/ -->
3 <!DOCTYPE HTML>
4 <html>
5 <head>
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" />
9 </head>
10 <body>
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
18 var testList = [
19 { string: "foo",
20 expected: "foo" },
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 + "'");
36 });
37 SimpleTest.finish();
38 });
39 </script>
40 </body>
41 </html>