test_in_lk_TLD.html (1473B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1603712 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1603712</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 1603712 */ 14 15 SimpleTest.waitForExplicitFinish(); 16 17 var tlds = [ 18 {'tld': 'in', 'expectedEncoding': 'Shift_JIS', 'file': 'file_in_lk_TLD.html'}, 19 {'tld': 'lk', 'expectedEncoding': 'Shift_JIS', 'file': 'file_in_lk_TLD.html'}, 20 {'tld': 'co.jp', 'expectedEncoding': 'windows-1251', 'file': 'file_jp_TLD.html'}, 21 ]; 22 23 var iframe = null; 24 25 var current = null; 26 27 function runTest() { 28 iframe = document.getElementsByTagName("iframe")[0]; 29 window.addEventListener("message", next); 30 next(null); 31 } 32 33 function next(event) { 34 if (event) { 35 is(event.data, current.expectedEncoding, "Got bad encoding for " + current.tld); 36 } 37 current = tlds.shift(); 38 if (!current) { 39 SimpleTest.finish(); 40 return; 41 } 42 iframe.src = "http://example." + current.tld + "/tests/dom/encoding/test/" + current.file; 43 } 44 45 </script> 46 </head> 47 <body onload="runTest();"> 48 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1603712">Mozilla Bug 1603712</a> 49 <p id="display"></p> 50 <div id="content" style="display: none"> 51 <iframe></iframe> 52 </div> 53 <pre id="test"> 54 </pre> 55 </body> 56 </html>