tor-browser

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

browser_bug234628-3.js (1058B)


      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    afterChangeCharset
      7  );
      8 }
      9 
     10 function afterOpen() {
     11  is(
     12    content.document.documentElement.textContent.indexOf("\u20AC"),
     13    118,
     14    "Parent doc should be windows-1252 initially"
     15  );
     16 
     17  is(
     18    content.frames[0].document.documentElement.textContent.indexOf("\u20AC"),
     19    73,
     20    "Child doc should be utf-8 initially"
     21  );
     22 }
     23 
     24 function afterChangeCharset() {
     25  is(
     26    content.document.documentElement.textContent.indexOf("\u20AC"),
     27    118,
     28    "Parent doc should be windows-1252 subsequently"
     29  );
     30 
     31  is(
     32    content.frames[0].document.documentElement.textContent.indexOf("\u20AC"),
     33    73,
     34    "Child doc should be utf-8 subsequently"
     35  );
     36 
     37  is(
     38    content.document.characterSet,
     39    "windows-1252",
     40    "Parent doc should report windows-1252 subsequently"
     41  );
     42  is(
     43    content.frames[0].document.characterSet,
     44    "UTF-8",
     45    "Child doc should report UTF-8 subsequently"
     46  );
     47 }