From 418b960267646956dbb86cb421ee24424fcc33f5 Mon Sep 17 00:00:00 2001 From: "smontagu%smontagu.org" Date: Mon, 1 Oct 2007 14:14:58 +0000 Subject: [PATCH] Regression test for bug 92473 git-svn-id: svn://10.0.0.236/trunk@236987 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/test/browser/Makefile.in | 2 + .../docshell/test/browser/browser_bug92473.js | 50 +++++++++++++++++++ .../docshell/test/browser/test-form_sjis.html | 22 ++++++++ 3 files changed, 74 insertions(+) create mode 100644 mozilla/docshell/test/browser/browser_bug92473.js create mode 100644 mozilla/docshell/test/browser/test-form_sjis.html diff --git a/mozilla/docshell/test/browser/Makefile.in b/mozilla/docshell/test/browser/Makefile.in index 6b407998ad9..a0fa10b3cf2 100644 --- a/mozilla/docshell/test/browser/Makefile.in +++ b/mozilla/docshell/test/browser/Makefile.in @@ -44,6 +44,8 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk _BROWSER_TEST_FILES = \ + browser_bug92473.js \ + test-form_sjis.html \ browser_bug349769.js \ browser_bug388121-1.js \ browser_bug388121-2.js \ diff --git a/mozilla/docshell/test/browser/browser_bug92473.js b/mozilla/docshell/test/browser/browser_bug92473.js new file mode 100644 index 00000000000..f65d4fc20f0 --- /dev/null +++ b/mozilla/docshell/test/browser/browser_bug92473.js @@ -0,0 +1,50 @@ +const Ci = Components.interfaces; +const Cc = Components.classes; + +/* The test text decoded correctly as Shift_JIS */ +const rightText="\u30E6\u30CB\u30B3\u30FC\u30C9\u306F\u3001\u3059\u3079\u3066\u306E\u6587\u5B57\u306B\u56FA\u6709\u306E\u756A\u53F7\u3092\u4ED8\u4E0E\u3057\u307E\u3059"; + +/* The test text decoded incorrectly as Windows-1251. This is the "right" wrong + text; anything else is unexpected. */ +const wrongText="\u0453\u2020\u0453\u006A\u0453\u0052\u0403\u005B\u0453\u0068\u201A\u041D\u0403\u0041\u201A\u00B7\u201A\u0427\u201A\u0414\u201A\u041C\u2022\u00B6\u040B\u0459\u201A\u0419\u040A\u0415\u2014\u004C\u201A\u041C\u201D\u0424\u040C\u2020\u201A\u0440\u2022\u0074\u2014\u005E\u201A\u00B5\u201A\u042C\u201A\u00B7"; + +var testPage; + +function url(spec) { + var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); + return ios.newURI(spec, null, null); +} + +function testContent(text) { + is(testPage.document.getElementById("testpar").innerHTML, text, + "

contains expected text"); + is(testPage.document.getElementById("testtextarea").innerHTML, text, + " + +

+

Expected text on load:

+

ѓ†ѓjѓRЃ[ѓh‚НЃA‚·‚Ч‚Д‚М•¶Ћљ‚ЙЊЕ—L‚М”ФЌ†‚р•t—^‚µ‚Ь‚·

+

Expected text on resetting the encoding to Shift_JIS:

+

ユニコードは、すべての文字に固有の番号を付与します

+ +