summaryrefslogtreecommitdiffstats
path: root/extensions/universalchardet/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /extensions/universalchardet/tests
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
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
+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/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>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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751be_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..d53babcd67
--- /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..58c6714d9f
--- /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..2c094c3136
--- /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..1833beb686
--- /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..d797b45af4
--- /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..4eeca82825
--- /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..1a33433a6d
--- /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..64b806663b
--- /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..57968d1ddd
--- /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..0c991521c9
--- /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..828f893289
--- /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..29a1faf5a2
--- /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..7b7dc6a788
--- /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..e34cd8aa7a
--- /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..6f9a669eae
--- /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..d10fbbc1b0
--- /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..4e176f5c77
--- /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..0fedb76f06
--- /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..fe521d48ea
--- /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..1be3c924c3
--- /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..64e2054f4d
--- /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..95cc6c9213
--- /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..48d3c8e926
--- /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>