tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_bug1543077-3.js (1092B)


      1 function test() {
      2  var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
      3  runCharsetTest(
      4    rootDir + "file_bug1543077-3.html",
      5    afterOpen,
      6    afterChangeCharset
      7  );
      8 }
      9 
     10 function afterOpen() {
     11  is(
     12    content.document.documentElement.textContent.indexOf("\u3042"),
     13    136,
     14    "Parent doc should be ISO-2022-JP initially"
     15  );
     16 
     17  is(
     18    content.frames[0].document.documentElement.textContent.indexOf("\u3042"),
     19    92,
     20    "Child doc should be ISO-2022-JP initially"
     21  );
     22 }
     23 
     24 function afterChangeCharset() {
     25  is(
     26    content.document.documentElement.textContent.indexOf("\u3042"),
     27    136,
     28    "Parent doc should decode as ISO-2022-JP subsequently"
     29  );
     30  is(
     31    content.frames[0].document.documentElement.textContent.indexOf("\u3042"),
     32    92,
     33    "Child doc should decode as ISO-2022-JP subsequently"
     34  );
     35 
     36  is(
     37    content.document.characterSet,
     38    "ISO-2022-JP",
     39    "Parent doc should report ISO-2022-JP subsequently"
     40  );
     41  is(
     42    content.frames[0].document.characterSet,
     43    "ISO-2022-JP",
     44    "Child doc should report ISO-2022-JP subsequently"
     45  );
     46 }