summaryrefslogtreecommitdiffstats
path: root/intl/uconv/tests/test_ncr_fallback.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /intl/uconv/tests/test_ncr_fallback.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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 'intl/uconv/tests/test_ncr_fallback.html')
-rw-r--r--intl/uconv/tests/test_ncr_fallback.html74
1 files changed, 74 insertions, 0 deletions
diff --git a/intl/uconv/tests/test_ncr_fallback.html b/intl/uconv/tests/test_ncr_fallback.html
new file mode 100644
index 000000000..d86afa3e3
--- /dev/null
+++ b/intl/uconv/tests/test_ncr_fallback.html
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1202366
+-->
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
+ <title>Test for unpaired surrogates</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body onload="step()">
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/* NOTE:
+ * When we make our data: URL origin work as in Blink, this test will fail.
+ * Don't let this test block alignment of data: URL origin with Blink.
+ */
+SimpleTest.waitForExplicitFinish();
+
+var expectations = [
+ "%26%2365533%3B",
+ "a%26%2365533%3B",
+ "%26%2365533%3Ba",
+ "a%26%2365533%3Ba",
+ "%26%2365533%3B",
+ "a%26%2365533%3B",
+ "%26%2365533%3Ba",
+ "a%26%2365533%3Ba",
+ "%26%23128169%3B",
+ "%26%23128169%3B",
+ "%1B%24B%22%29%1B%28B",
+ "%1B%24B%22%29%1B%28B%26%23128169%3B",
+];
+
+var i = 0;
+
+function step() {
+ var f = document.getElementsByTagName("iframe")[i];
+ f.onload = function() {
+ var href = f.contentWindow.location.href;
+ var index = href.indexOf("?foo=");
+ var actual = href.substring(index + 5);
+ var expected = expectations[i];
+ is(actual, expected, "Should have gotten the expected encode.");
+ i++
+ if (i == document.getElementsByTagName("iframe").length) {
+ SimpleTest.finish();
+ } else {
+ step();
+ }
+ }
+ f.contentDocument.forms[0].submit();
+}
+</script>
+</pre>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1202366">Mozilla Bug 1202366</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=\uD83D></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=a\uD83D></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=\uD83Da></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=a\uD83Da></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=\uDCA9></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=a\uDCA9></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=\uDCA9a></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=a\uDCA9a></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=big5,<script>document.write('<form><input name=foo value=\uD83D\uDCA9></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=iso-2022-jp,<script>document.write('<form><input name=foo value=\uD83D\uDCA9></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=iso-2022-jp,<script>document.write('<form><input name=foo value=\u3012></form>');</script>"></iframe>
+<iframe src="data:text/html;charset=iso-2022-jp,<script>document.write('<form><input name=foo value=\u3012\uD83D\uDCA9></form>');</script>"></iframe>
+</div>
+</body>
+</html>