2013-01-18 18:27:03 +04:00
|
|
|
function test() {
|
|
|
|
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
|
2015-11-09 08:50:10 +03:00
|
|
|
runCharsetTest(
|
|
|
|
rootDir + "file_bug234628-5.html",
|
|
|
|
afterOpen,
|
|
|
|
"windows-1251",
|
|
|
|
afterChangeCharset
|
|
|
|
);
|
2013-01-18 18:27:03 +04:00
|
|
|
}
|
|
|
|
|
2015-11-09 08:50:10 +03:00
|
|
|
function afterOpen() {
|
2019-03-22 21:13:25 +03:00
|
|
|
is(
|
|
|
|
content.document.documentElement.textContent.indexOf("\u20AC"),
|
|
|
|
146,
|
|
|
|
"Parent doc should be windows-1252 initially"
|
|
|
|
);
|
2013-01-18 18:27:03 +04:00
|
|
|
|
2019-03-22 21:13:25 +03:00
|
|
|
is(
|
|
|
|
content.frames[0].document.documentElement.textContent.indexOf("\u20AC"),
|
|
|
|
87,
|
|
|
|
"Child doc should be utf-16 initially"
|
|
|
|
);
|
2013-01-18 18:27:03 +04:00
|
|
|
}
|
|
|
|
|
2015-11-09 08:50:10 +03:00
|
|
|
function afterChangeCharset() {
|
2019-03-22 21:13:25 +03:00
|
|
|
is(
|
|
|
|
content.document.documentElement.textContent.indexOf("\u0402"),
|
|
|
|
146,
|
|
|
|
"Parent doc should decode as windows-1251 subsequently"
|
|
|
|
);
|
|
|
|
is(
|
|
|
|
content.frames[0].document.documentElement.textContent.indexOf("\u20AC"),
|
|
|
|
87,
|
|
|
|
"Child doc should decode as utf-16 subsequently"
|
|
|
|
);
|
2013-01-18 18:27:03 +04:00
|
|
|
|
2015-11-09 08:50:10 +03:00
|
|
|
is(
|
|
|
|
content.document.characterSet,
|
|
|
|
"windows-1251",
|
|
|
|
"Parent doc should report windows-1251 subsequently"
|
|
|
|
);
|
|
|
|
is(
|
|
|
|
content.frames[0].document.characterSet,
|
|
|
|
"UTF-16LE",
|
|
|
|
"Child doc should report UTF-16LE subsequently"
|
|
|
|
);
|
2013-01-18 18:27:03 +04:00
|
|
|
}
|