tor-browser

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

test_TLD.html (1377B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=910211
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 910211</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11  <script type="application/javascript">
     12 
     13  /** Test for Bug 910211 */
     14 
     15  SimpleTest.waitForExplicitFinish();
     16 
     17  var tlds = [
     18    {'tld': 'tw', 'encoding': 'Big5'},
     19    {'tld': 'cn', 'encoding': 'GBK'},
     20    {'tld': 'co.jp', 'encoding': 'Shift_JIS'},
     21    {'tld': 'fi', 'encoding': 'windows-1252'},
     22  ];
     23 
     24  var iframe = null;
     25 
     26  var current = null;
     27 
     28  function runTest() {
     29    iframe = document.getElementsByTagName("iframe")[0];
     30    window.addEventListener("message", next);
     31    next(null);
     32  }
     33 
     34  function next(event) {
     35    if (event) {
     36      is(event.data, current.encoding, "Got bad encoding for " + current.tld);
     37    }
     38    current = tlds.shift();
     39    if (!current) {
     40      SimpleTest.finish();
     41      return;
     42    }
     43    iframe.src = "http://example." + current.tld + "/tests/dom/encoding/test/file_TLD.html";
     44  }
     45 
     46  </script>
     47 </head>
     48 <body onload="runTest();">
     49 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=910211">Mozilla Bug 910211</a>
     50 <p id="display"></p>
     51 <div id="content" style="display: none">
     52 <iframe></iframe>
     53 </div>
     54 <pre id="test">
     55 </pre>
     56 </body>
     57 </html>