summaryrefslogtreecommitdiffstats
path: root/extensions/universalchardet/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /extensions/universalchardet/tests
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--extensions/universalchardet/tests/CharsetDetectionTests.js48
-rw-r--r--extensions/universalchardet/tests/bug1071816-1_text.html9
-rw-r--r--extensions/universalchardet/tests/bug1071816-2_text.html9
-rw-r--r--extensions/universalchardet/tests/bug1071816-3_text.html536
-rw-r--r--extensions/universalchardet/tests/bug1071816-4_text.html536
-rw-r--r--extensions/universalchardet/tests/bug306272_text.html9
-rw-r--r--extensions/universalchardet/tests/bug426271_text-euc-jp.html11
-rw-r--r--extensions/universalchardet/tests/bug426271_text-utf-8.html11
-rw-r--r--extensions/universalchardet/tests/bug431054_text.html5
-rw-r--r--extensions/universalchardet/tests/bug620106_text.html1045
-rw-r--r--extensions/universalchardet/tests/bug631751be_text.htmlbin0 -> 354 bytes
-rw-r--r--extensions/universalchardet/tests/bug631751le_text.htmlbin0 -> 366 bytes
-rw-r--r--extensions/universalchardet/tests/bug638318_text.htmlbin0 -> 1108 bytes
-rw-r--r--extensions/universalchardet/tests/bug811363-1.text1
-rw-r--r--extensions/universalchardet/tests/bug811363-2.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-3.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-4.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-5.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-6.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-7.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-8.text3
-rw-r--r--extensions/universalchardet/tests/bug811363-9.text2
-rw-r--r--extensions/universalchardet/tests/bug811363-invalid-1.text4
-rw-r--r--extensions/universalchardet/tests/bug811363-invalid-5.text3
-rw-r--r--extensions/universalchardet/tests/chrome.ini49
-rw-r--r--extensions/universalchardet/tests/moz.build7
-rw-r--r--extensions/universalchardet/tests/test_bug1071816-1.html31
-rw-r--r--extensions/universalchardet/tests/test_bug1071816-2.html31
-rw-r--r--extensions/universalchardet/tests/test_bug1071816-3.html31
-rw-r--r--extensions/universalchardet/tests/test_bug1071816-4.html31
-rw-r--r--extensions/universalchardet/tests/test_bug306272.html31
-rw-r--r--extensions/universalchardet/tests/test_bug426271-euc-jp.html31
-rw-r--r--extensions/universalchardet/tests/test_bug426271-utf-8.html31
-rw-r--r--extensions/universalchardet/tests/test_bug431054-japanese.html30
-rw-r--r--extensions/universalchardet/tests/test_bug431054.html34
-rw-r--r--extensions/universalchardet/tests/test_bug631751be.html31
-rw-r--r--extensions/universalchardet/tests/test_bug631751le.html31
-rw-r--r--extensions/universalchardet/tests/test_bug638318.html31
-rw-r--r--extensions/universalchardet/tests/test_bug811363-1-1.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-1-5.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-1.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-2.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-3.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-4.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-5.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-6.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-7.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-8.html29
-rw-r--r--extensions/universalchardet/tests/test_bug811363-2-9.html29
49 files changed, 2999 insertions, 0 deletions
diff --git a/extensions/universalchardet/tests/CharsetDetectionTests.js b/extensions/universalchardet/tests/CharsetDetectionTests.js
new file mode 100644
index 0000000000..8d6ebad964
--- /dev/null
+++ b/extensions/universalchardet/tests/CharsetDetectionTests.js
@@ -0,0 +1,48 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
+/* vim: set ts=8 et sw=4 tw=80: */
+
+var gExpectedCharset;
+var gLocalDir;
+
+function CharsetDetectionTests(aTestFile, aExpectedCharset) {
+ gExpectedCharset = aExpectedCharset;
+
+ InitDetectorTests();
+
+ var fileURI = gLocalDir + aTestFile;
+ $("testframe").src = fileURI;
+
+ SimpleTest.waitForExplicitFinish();
+}
+
+function InitDetectorTests() {
+ var loader = Services.scriptloader;
+ var ioService = Services.io;
+ loader.loadSubScript("chrome://mochikit/content/chrome-harness.js");
+
+ $("testframe").onload = DoDetectionTest;
+
+ if (gExpectedCharset == "default") {
+ // No point trying to be generic here, because we have plenty of other
+ // unit tests that fail if run using a non-windows-1252 locale.
+ gExpectedCharset = "windows-1252";
+ }
+
+ // Get the local directory. This needs to be a file: URI because chrome:
+ // URIs are always UTF-8 (bug 617339) and we are testing decoding from other
+ // charsets.
+ var jar = getJar(getRootDirectory(window.location.href));
+ var dir = jar
+ ? extractJarToTmp(jar)
+ : getChromeDir(getResolvedURI(window.location.href));
+ gLocalDir = ioService.newFileURI(dir).spec;
+}
+
+function DoDetectionTest() {
+ var iframeDoc = $("testframe").contentDocument;
+ var charset = iframeDoc.characterSet;
+
+ is(charset, gExpectedCharset, "decoded as " + gExpectedCharset);
+
+ SimpleTest.finish();
+}
diff --git a/extensions/universalchardet/tests/bug1071816-1_text.html b/extensions/universalchardet/tests/bug1071816-1_text.html
new file mode 100644
index 0000000000..eae162afd5
--- /dev/null
+++ b/extensions/universalchardet/tests/bug1071816-1_text.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>UTF-8</title>
+</head>
+<body>
+</body>
+</html> \ No newline at end of file
diff --git a/extensions/universalchardet/tests/bug1071816-2_text.html b/extensions/universalchardet/tests/bug1071816-2_text.html
new file mode 100644
index 0000000000..489f383c2e
--- /dev/null
+++ b/extensions/universalchardet/tests/bug1071816-2_text.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>windows-1252</title>
+</head>
+<body>
+
+</body>
+</html> \ No newline at end of file
diff --git a/extensions/universalchardet/tests/bug1071816-3_text.html b/extensions/universalchardet/tests/bug1071816-3_text.html
new file mode 100644
index 0000000000..c0bb397d0e
--- /dev/null
+++ b/extensions/universalchardet/tests/bug1071816-3_text.html
@@ -0,0 +1,536 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>UTF-8</title>
+<!-- More than 1024 bytes
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+-->
+</head>
+<body>
+</body>
+</html> \ No newline at end of file
diff --git a/extensions/universalchardet/tests/bug1071816-4_text.html b/extensions/universalchardet/tests/bug1071816-4_text.html
new file mode 100644
index 0000000000..ee81cb1a50
--- /dev/null
+++ b/extensions/universalchardet/tests/bug1071816-4_text.html
@@ -0,0 +1,536 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>windows-1252</title>
+<!-- More than 1024 bytes
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+a
+-->
+</head>
+<body>
+
+</body>
+</html> \ No newline at end of file
diff --git a/extensions/universalchardet/tests/bug306272_text.html b/extensions/universalchardet/tests/bug306272_text.html
new file mode 100644
index 0000000000..4a0c612834
--- /dev/null
+++ b/extensions/universalchardet/tests/bug306272_text.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head>
+
+ <title>306272</title>
+
+
+</head><body>
+<a href="mailto:Antti.Nayha@somewhere.fi">Antti Näyhä &lt;Antti.Nayha@somewhere.fi&gt;</a>
+</body></html> \ No newline at end of file
diff --git a/extensions/universalchardet/tests/bug426271_text-euc-jp.html b/extensions/universalchardet/tests/bug426271_text-euc-jp.html
new file mode 100644
index 0000000000..467d69c73e
--- /dev/null
+++ b/extensions/universalchardet/tests/bug426271_text-euc-jp.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="ja">
+<head>
+<title>ܸ쥨󥳡ɥƥ</title>
+</head>
+<body>
+EUC-JPǤΡ˻ҶΤʤϷؤǤ̤򤷤Ƥȡ礭ή褿Τǡ줵ȿ٤褦Ȼäͤ椫ˤλҤޤ줿ΤǡϺפ̾դ˰Ƥ
+
+ĹϺϡε͡줷Ƥ뤳ȤΤꡢ༣դ롣ξƤĻҤ̤㤤ƻˤʬͿƥ̡롢˽롣ǵ襤˾ᡢåäƤäꡢ줵󡦤̤θ֤ꡢ餷Ȥŵ: ե꡼ɴʻŵإڥǥWikipediaˡ
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/bug426271_text-utf-8.html b/extensions/universalchardet/tests/bug426271_text-utf-8.html
new file mode 100644
index 0000000000..7e38c27c35
--- /dev/null
+++ b/extensions/universalchardet/tests/bug426271_text-utf-8.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="ja">
+<head>
+<title>日本語エンコードテスト</title>
+</head>
+<body>
+これはUTF-8です昔々、ある所に子供のいない老夫婦が住んでいた。ある日、お婆さんが川で洗濯をしていると、大きな桃が流れて来たので、お爺さんと食べようと持ち帰った。二人で桃を割ると中から男の子が生まれたので、「桃太郎」と名付けて大事に育てた。
+
+成長した桃太郎は、鬼ヶ島の鬼が人々を苦しめていることを知り、鬼退治を決意する。両親から黍団子を餞別に貰い、道中にそれを分け与えてイヌ、サル、キジを家来に従える。鬼ヶ島で鬼と戦い、見事に勝利を収め、鬼が方々から奪っていった財宝を持ち帰り、お爺さん・お婆さんの元に返り、幸せに暮らしたという。出典: フリー百科事典『ウィキペディア(Wikipedia)』
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/bug431054_text.html b/extensions/universalchardet/tests/bug431054_text.html
new file mode 100644
index 0000000000..aa88a4e1d2
--- /dev/null
+++ b/extensions/universalchardet/tests/bug431054_text.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/bug620106_text.html b/extensions/universalchardet/tests/bug620106_text.html
new file mode 100644
index 0000000000..b7ca0aca33
--- /dev/null
+++ b/extensions/universalchardet/tests/bug620106_text.html
@@ -0,0 +1,1045 @@
+<!DOCTYPE html>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ƥȤΥ󥳡ǥ󥰤򸡽С⤦٥ƥȡޤ󥳡ɤθФƥȤޤ줬ФƤޤ
+
diff --git a/extensions/universalchardet/tests/bug631751be_text.html b/extensions/universalchardet/tests/bug631751be_text.html
new file mode 100644
index 0000000000..104d503998
--- /dev/null
+++ b/extensions/universalchardet/tests/bug631751be_text.html
Binary files differ
diff --git a/extensions/universalchardet/tests/bug631751le_text.html b/extensions/universalchardet/tests/bug631751le_text.html
new file mode 100644
index 0000000000..a1e5f6bfbd
--- /dev/null
+++ b/extensions/universalchardet/tests/bug631751le_text.html
Binary files differ
diff --git a/extensions/universalchardet/tests/bug638318_text.html b/extensions/universalchardet/tests/bug638318_text.html
new file mode 100644
index 0000000000..3f2ff44212
--- /dev/null
+++ b/extensions/universalchardet/tests/bug638318_text.html
Binary files differ
diff --git a/extensions/universalchardet/tests/bug811363-1.text b/extensions/universalchardet/tests/bug811363-1.text
new file mode 100644
index 0000000000..a2952d62f7
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-1.text
@@ -0,0 +1 @@
+Two-byte UTF-8 including the first and last characters in the range: €Шерлок߿
diff --git a/extensions/universalchardet/tests/bug811363-2.text b/extensions/universalchardet/tests/bug811363-2.text
new file mode 100644
index 0000000000..b3b672635d
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-2.text
@@ -0,0 +1,3 @@
+Three byte UTF-8, first byte 0xE0, including first and last characters
+in the range: ࠀशर्लक࿿
+
diff --git a/extensions/universalchardet/tests/bug811363-3.text b/extensions/universalchardet/tests/bug811363-3.text
new file mode 100644
index 0000000000..29b6d4c581
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-3.text
@@ -0,0 +1,3 @@
+Three byte UTF-8, first byte 0xE1-EC, including first and last characters
+in the range: ကシャーロック쿿
+
diff --git a/extensions/universalchardet/tests/bug811363-4.text b/extensions/universalchardet/tests/bug811363-4.text
new file mode 100644
index 0000000000..f337d2e438
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-4.text
@@ -0,0 +1,3 @@
+Three byte UTF-8, first byte 0xED, including first and last characters
+in the range: 퀀홈하홈탐퟿
+
diff --git a/extensions/universalchardet/tests/bug811363-5.text b/extensions/universalchardet/tests/bug811363-5.text
new file mode 100644
index 0000000000..2827c8030f
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-5.text
@@ -0,0 +1,3 @@
+Three byte UTF-8, first byte 0xEE-EF, including first and last characters
+in the range: ﴍﻟﻮﻙ￿
+
diff --git a/extensions/universalchardet/tests/bug811363-6.text b/extensions/universalchardet/tests/bug811363-6.text
new file mode 100644
index 0000000000..c23e0077c4
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-6.text
@@ -0,0 +1,3 @@
+Four byte UTF-8, first byte 0xF0, including first and last characters
+in the range: 𐀀𐌲𐌿𐍄𐌹𐍃𐌺 𿿿
+
diff --git a/extensions/universalchardet/tests/bug811363-7.text b/extensions/universalchardet/tests/bug811363-7.text
new file mode 100644
index 0000000000..8a2c209f18
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-7.text
@@ -0,0 +1,3 @@
+Four byte UTF-8, first byte 0xF1-F3, including first and last characters
+in the range: 񀀀񠀀 񠀁 񠀂󿿿
+
diff --git a/extensions/universalchardet/tests/bug811363-8.text b/extensions/universalchardet/tests/bug811363-8.text
new file mode 100644
index 0000000000..b82f3da405
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-8.text
@@ -0,0 +1,3 @@
+Four byte UTF-8, first byte 0xF4, including first and last characters
+in the range:􀀀􈀀 􈀁 􈀂􏿿
+
diff --git a/extensions/universalchardet/tests/bug811363-9.text b/extensions/universalchardet/tests/bug811363-9.text
new file mode 100644
index 0000000000..50b232eafd
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-9.text
@@ -0,0 +1,2 @@
+Four byte UTF-8, first byte 0xF0, including BMP only:𐤔𐤓𐤋𐤅𐤒
+
diff --git a/extensions/universalchardet/tests/bug811363-invalid-1.text b/extensions/universalchardet/tests/bug811363-invalid-1.text
new file mode 100644
index 0000000000..8718c36d73
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-invalid-1.text
@@ -0,0 +1,4 @@
+Orphaned continuation bytes:
+
+
+
diff --git a/extensions/universalchardet/tests/bug811363-invalid-5.text b/extensions/universalchardet/tests/bug811363-invalid-5.text
new file mode 100644
index 0000000000..fa76449c28
--- /dev/null
+++ b/extensions/universalchardet/tests/bug811363-invalid-5.text
@@ -0,0 +1,3 @@
+Isolated surrogates:
+Surrogate pairs:
+
diff --git a/extensions/universalchardet/tests/chrome.ini b/extensions/universalchardet/tests/chrome.ini
new file mode 100644
index 0000000000..a2b17a4dce
--- /dev/null
+++ b/extensions/universalchardet/tests/chrome.ini
@@ -0,0 +1,49 @@
+[DEFAULT]
+support-files =
+ CharsetDetectionTests.js
+ bug306272_text.html
+ bug426271_text-euc-jp.html
+ bug426271_text-utf-8.html
+ bug431054_text.html
+ bug631751be_text.html
+ bug631751le_text.html
+ bug638318_text.html
+ bug811363-1.text
+ bug811363-2.text
+ bug811363-3.text
+ bug811363-4.text
+ bug811363-5.text
+ bug811363-6.text
+ bug811363-7.text
+ bug811363-8.text
+ bug811363-9.text
+ bug811363-invalid-1.text
+ bug811363-invalid-5.text
+ bug1071816-1_text.html
+ bug1071816-2_text.html
+ bug1071816-3_text.html
+ bug1071816-4_text.html
+
+[test_bug306272.html]
+[test_bug426271-euc-jp.html]
+[test_bug426271-utf-8.html]
+[test_bug431054-japanese.html]
+[test_bug431054.html]
+[test_bug631751be.html]
+[test_bug631751le.html]
+[test_bug638318.html]
+[test_bug811363-1-1.html]
+[test_bug811363-1-5.html]
+[test_bug811363-2-1.html]
+[test_bug811363-2-2.html]
+[test_bug811363-2-3.html]
+[test_bug811363-2-4.html]
+[test_bug811363-2-5.html]
+[test_bug811363-2-6.html]
+[test_bug811363-2-7.html]
+[test_bug811363-2-8.html]
+[test_bug811363-2-9.html]
+[test_bug1071816-1.html]
+[test_bug1071816-2.html]
+[test_bug1071816-3.html]
+[test_bug1071816-4.html]
diff --git a/extensions/universalchardet/tests/moz.build b/extensions/universalchardet/tests/moz.build
new file mode 100644
index 0000000000..1a7d5281ea
--- /dev/null
+++ b/extensions/universalchardet/tests/moz.build
@@ -0,0 +1,7 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+MOCHITEST_CHROME_MANIFESTS += ["chrome.ini"]
diff --git a/extensions/universalchardet/tests/test_bug1071816-1.html b/extensions/universalchardet/tests/test_bug1071816-1.html
new file mode 100644
index 0000000000..9d9ea95dd6
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug1071816-1.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1071816
+-->
+<head>
+ <title>Test for Bug 1071816</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1071816">Mozilla Bug 1071816</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 1071816 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug1071816-1_text.html",
+ "UTF-8",
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug1071816-2.html b/extensions/universalchardet/tests/test_bug1071816-2.html
new file mode 100644
index 0000000000..fde4e8d374
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug1071816-2.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1071816
+-->
+<head>
+ <title>Test for Bug 1071816</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1071816">Mozilla Bug 1071816</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 1071816 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug1071816-2_text.html",
+ "windows-1252",
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug1071816-3.html b/extensions/universalchardet/tests/test_bug1071816-3.html
new file mode 100644
index 0000000000..adb8be46bb
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug1071816-3.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1071816
+-->
+<head>
+ <title>Test for Bug 1071816</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1071816">Mozilla Bug 1071816</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 1071816 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug1071816-3_text.html",
+ "UTF-8",
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug1071816-4.html b/extensions/universalchardet/tests/test_bug1071816-4.html
new file mode 100644
index 0000000000..d5c99b3a66
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug1071816-4.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1071816
+-->
+<head>
+ <title>Test for Bug 1071816</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1071816">Mozilla Bug 1071816</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 1071816 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug1071816-4_text.html",
+ "windows-1252",
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug306272.html b/extensions/universalchardet/tests/test_bug306272.html
new file mode 100644
index 0000000000..e1b99a0e51
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug306272.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=306272
+-->
+<head>
+ <title>Test for Bug 306272</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=306272">Mozilla Bug 306272</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 306272 */
+CharsetDetectionTests("bug306272_text.html",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
+
diff --git a/extensions/universalchardet/tests/test_bug426271-euc-jp.html b/extensions/universalchardet/tests/test_bug426271-euc-jp.html
new file mode 100644
index 0000000000..f1a2688298
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug426271-euc-jp.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=426271
+-->
+<head>
+ <title>Test for Bug 426271</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426271">Mozilla Bug 426271</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 426271 */
+CharsetDetectionTests("bug426271_text-euc-jp.html",
+ "EUC-JP",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
+
diff --git a/extensions/universalchardet/tests/test_bug426271-utf-8.html b/extensions/universalchardet/tests/test_bug426271-utf-8.html
new file mode 100644
index 0000000000..70ad00d2cc
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug426271-utf-8.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=426271
+-->
+<head>
+ <title>Test for Bug 426271</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426271">Mozilla Bug 426271</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 426271 */
+CharsetDetectionTests("bug426271_text-utf-8.html",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
+
diff --git a/extensions/universalchardet/tests/test_bug431054-japanese.html b/extensions/universalchardet/tests/test_bug431054-japanese.html
new file mode 100644
index 0000000000..21f76a759b
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug431054-japanese.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=431054
+-->
+<head>
+ <title>Test for Bug 431054</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426271">Mozilla Bug 431054</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 431054 */
+CharsetDetectionTests("bug431054_text.html",
+ "EUC-JP",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug431054.html b/extensions/universalchardet/tests/test_bug431054.html
new file mode 100644
index 0000000000..71a5ec7656
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug431054.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=431054
+-->
+<head>
+ <title>Test for Bug 431054</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=426271">Mozilla Bug 431054</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 431054 */
+CharsetDetectionTests("bug431054_text.html",
+ "EUC-JP",
+ ["zhtw_parallel_state_machine",
+ "zhcn_parallel_state_machine",
+ "zh_parallel_state_machine",
+ "cjk_parallel_state_machine",
+ "universal_charset_detector"]);
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug631751be.html b/extensions/universalchardet/tests/test_bug631751be.html
new file mode 100644
index 0000000000..9333050ae8
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug631751be.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=631751
+-->
+<head>
+ <title>Test for Bug 631751</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=631751">Mozilla Bug 631751</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 631751 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug631751be_text.html",
+ "UTF-8", // Test runs from file: URL, so ASCII gets detected as UTF-8.
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug631751le.html b/extensions/universalchardet/tests/test_bug631751le.html
new file mode 100644
index 0000000000..36725a3a91
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug631751le.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=631751
+-->
+<head>
+ <title>Test for Bug 631751</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=631751">Mozilla Bug 631751</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 631751 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug631751le_text.html",
+ "UTF-8", // Test runs from file: URL, so ASCII gets detected as UTF-8.
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug638318.html b/extensions/universalchardet/tests/test_bug638318.html
new file mode 100644
index 0000000000..ee49b5097c
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug638318.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=638318
+-->
+<head>
+ <title>Test for Bug 638318</title>
+ <script type="text/javascript"
+ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=638318">Mozilla Bug 638318</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 638318 */
+/* Note! This test uses the chardet test harness but doesn't test chardet! */
+CharsetDetectionTests("bug638318_text.html",
+ "UTF-8",
+ new Array(""));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-1-1.html b/extensions/universalchardet/tests/test_bug811363-1-1.html
new file mode 100644
index 0000000000..79a0d6d523
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-1-1.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-invalid-1.text",
+ "windows-1252",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-1-5.html b/extensions/universalchardet/tests/test_bug811363-1-5.html
new file mode 100644
index 0000000000..70429f1c5f
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-1-5.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-invalid-5.text",
+ "windows-1251",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-1.html b/extensions/universalchardet/tests/test_bug811363-2-1.html
new file mode 100644
index 0000000000..3325b1889d
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-1.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-1.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-2.html b/extensions/universalchardet/tests/test_bug811363-2-2.html
new file mode 100644
index 0000000000..31bdde7297
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-2.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-2.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-3.html b/extensions/universalchardet/tests/test_bug811363-2-3.html
new file mode 100644
index 0000000000..73efbe347f
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-3.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-3.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-4.html b/extensions/universalchardet/tests/test_bug811363-2-4.html
new file mode 100644
index 0000000000..f9d90918d9
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-4.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-4.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-5.html b/extensions/universalchardet/tests/test_bug811363-2-5.html
new file mode 100644
index 0000000000..a450ec0527
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-5.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-5.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-6.html b/extensions/universalchardet/tests/test_bug811363-2-6.html
new file mode 100644
index 0000000000..18fb254043
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-6.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-6.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-7.html b/extensions/universalchardet/tests/test_bug811363-2-7.html
new file mode 100644
index 0000000000..c7e571589a
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-7.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-7.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-8.html b/extensions/universalchardet/tests/test_bug811363-2-8.html
new file mode 100644
index 0000000000..fb7951d7c0
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-8.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-8.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>
diff --git a/extensions/universalchardet/tests/test_bug811363-2-9.html b/extensions/universalchardet/tests/test_bug811363-2-9.html
new file mode 100644
index 0000000000..47156e4d54
--- /dev/null
+++ b/extensions/universalchardet/tests/test_bug811363-2-9.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=811363
+-->
+<head>
+ <title>Test for Bug 811363</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js">
+ </script>
+ <script type="text/javascript" src="CharsetDetectionTests.js"></script>
+ <link rel="stylesheet" type="text/css"
+ href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811363">Mozilla Bug 811363</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<iframe id="testframe"></iframe>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+/** Test for Bug 811363 */
+CharsetDetectionTests("bug811363-9.text",
+ "UTF-8",
+ new Array("ja_parallel_state_machine"));
+</script>
+</pre>
+</body>
+</html>