test_TLD.html 1.4 KB

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