tor-browser

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

browser_bug234628-2.js (1089B)


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