tor-browser

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

inheritance-bogus-meta-utf-8.html (1056B)


      1 <!doctype html>
      2 <meta charset="utf-8" />
      3 <title>Inheriting from UTF-8 parent</title>
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <div id=log></div>
      7 <script>
      8 [
      9  {
     10    "title": "Child with bogus <meta charset>",
     11    "url": "resources/bogus-charset.html",
     12    "expected": "\uFFFD\n" // 0x00A2 in windows-1252 is 0xFFFD in UTF-8
     13  },
     14  {
     15    "title": "Child with bogus Content-Type charset",
     16    "url": "resources/bogus-charset-http.py",
     17    "expected": "\uFFFD\n"
     18  },
     19  {
     20    "title": "Child with bogus Content-Type charset, but valid <meta charset>",
     21    "url": "resources/bogus-charset-http-valid-meta.py",
     22    "expected": "\u045E\n"
     23  }
     24 ].forEach(({ title, url, expected }) => {
     25  async_test(t => {
     26    const frame = document.createElement("iframe");
     27    t.add_cleanup(() => frame.remove());
     28    frame.src = url;
     29    frame.onload = t.step_func_done(() => {
     30      assert_equals(frame.contentDocument.body.textContent, expected);
     31    });
     32    document.body.append(frame);
     33  }, title);
     34 });
     35 </script>