1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/encoding/test/test_TLD.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=910211 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 910211</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 + <script type="application/javascript"> 1.15 + 1.16 + /** Test for Bug 910211 **/ 1.17 + 1.18 + SimpleTest.waitForExplicitFinish(); 1.19 + 1.20 + var tlds = [ 1.21 + {'tld': 'tw', 'encoding': 'Big5'}, 1.22 + {'tld': 'cn', 'encoding': 'gbk'}, 1.23 + {'tld': 'co.jp', 'encoding': 'Shift_JIS'}, 1.24 + {'tld': 'fi', 'encoding': 'windows-1252'}, 1.25 + ]; 1.26 + 1.27 + var iframe = null; 1.28 + 1.29 + var current = null; 1.30 + 1.31 + function runTest() { 1.32 + iframe = document.getElementsByTagName("iframe")[0]; 1.33 + window.addEventListener("message", next); 1.34 + next(null); 1.35 + } 1.36 + 1.37 + function next(event) { 1.38 + if (event) { 1.39 + is(event.data, current['encoding'], "Got bad encoding for " + current["tld"]); 1.40 + } 1.41 + current = tlds.shift(); 1.42 + if (!current) { 1.43 + SimpleTest.finish(); 1.44 + return; 1.45 + } 1.46 + iframe.src = "http://example." + current["tld"] + "/tests/dom/encoding/test/file_TLD.html"; 1.47 + } 1.48 + 1.49 + </script> 1.50 +</head> 1.51 +<body onload="runTest();"> 1.52 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=910211">Mozilla Bug 910211</a> 1.53 +<p id="display"></p> 1.54 +<div id="content" style="display: none"> 1.55 +<iframe></iframe> 1.56 +</div> 1.57 +<pre id="test"> 1.58 +</pre> 1.59 +</body> 1.60 +</html>