Bug 1686820 [wpt PR 27193] - Origin-keyed agent clusters: make COI imply origin-keyin...
[gecko.git] / docshell / test / browser / browser_bug234628-3.js
blob218a81e144e7c69ba755c90c19fc603236e284d0
1 function test() {
2   var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
3   runCharsetTest(
4     rootDir + "file_bug234628-3.html",
5     afterOpen,
6     "windows-1251",
7     afterChangeCharset
8   );
11 function afterOpen() {
12   is(
13     content.document.documentElement.textContent.indexOf("\u20AC"),
14     118,
15     "Parent doc should be windows-1252 initially"
16   );
18   is(
19     content.frames[0].document.documentElement.textContent.indexOf("\u20AC"),
20     73,
21     "Child doc should be utf-8 initially"
22   );
25 function afterChangeCharset() {
26   is(
27     content.document.documentElement.textContent.indexOf("\u0402"),
28     118,
29     "Parent doc should decode as windows-1251 subsequently"
30   );
31   is(
32     content.frames[0].document.documentElement.textContent.indexOf(
33       "\u0432\u201A\u00AC"
34     ),
35     73,
36     "Child doc should decode as windows-1251 subsequently"
37   );
39   is(
40     content.document.characterSet,
41     "windows-1251",
42     "Parent doc should report windows-1251 subsequently"
43   );
44   is(
45     content.frames[0].document.characterSet,
46     "windows-1251",
47     "Child doc should report windows-1251 subsequently"
48   );