tor-browser

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

browser_bug673087-1.js (1063B)


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