summaryrefslogtreecommitdiffstats
path: root/docshell/test/browser/browser_bug673087-2.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docshell/test/browser/browser_bug673087-2.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/docshell/test/browser/browser_bug673087-2.js b/docshell/test/browser/browser_bug673087-2.js
new file mode 100644
index 0000000000..13a7a2a82c
--- /dev/null
+++ b/docshell/test/browser/browser_bug673087-2.js
@@ -0,0 +1,36 @@
+function test() {
+ var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
+ runCharsetTest(
+ rootDir + "file_bug673087-2.html",
+ afterOpen,
+ afterChangeCharset
+ );
+}
+
+function afterOpen() {
+ is(
+ content.document.documentElement.textContent.indexOf("\uFFFD"),
+ 0,
+ "Doc should decode as replacement initially"
+ );
+
+ is(
+ content.document.characterSet,
+ "replacement",
+ "Doc should report replacement initially"
+ );
+}
+
+function afterChangeCharset() {
+ is(
+ content.document.documentElement.textContent.indexOf("\uFFFD"),
+ 0,
+ "Doc should decode as replacement subsequently"
+ );
+
+ is(
+ content.document.characterSet,
+ "replacement",
+ "Doc should report replacement subsequently"
+ );
+}