1 document.write('<p>This test suite was converted from http://www.hixie.ch/tests/adhoc/html/parsing/encoding/all.html</p>' + 2 '<p>The suite has been broken up to run the tests in smaller batches.</p>' + 3 '<ul>Expected failures:' + 4 '<li>56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.</li>' + 5 '<li>60 - parser treats meta inside style as text, not a tag.</li>' + 6 '<li>97, 99, 102 - we do not run scripts during encoding detection.</li>' + 7 '</ul>' + 8 '<p>Status: <span id="status">Tests did not run.</span></p>' + 9 '<p>Serious failures:</p>' + 10 '<ol id="failures">' + 11 '</ol>' + 12 '<p>(Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)</p>' + 13 '<p><iframe id="test"></iframe></p>'); 14 15 if (window.layoutTestController) { 16 layoutTestController.dumpAsText(); 17 layoutTestController.waitUntilDone(); 18 } 19 20 var frame = document.getElementById('test'); 21 var current = 0; 22 var max = 0; 23 24 function dotest() { 25 var s = current + ''; 26 while (s.length < 3) s = '0' + s; 27 frame.src = 'resources/' + s + '.html'; 28 window.receivedResults = function () { 29 var want = frame.contentWindow.document.getElementById('expected').firstChild.data; 30 var have = frame.contentWindow.document.getElementById('encoding').firstChild.data; 31 if (have == 'ISO-8859-9') 32 have = 'Windows-1254'; 33 if (want != have) { 34 var li = document.createElement('li'); 35 var a = document.createElement('a'); 36 a.appendChild(document.createTextNode('test ' + s)); 37 a.href = s + '.html'; 38 li.appendChild(a); 39 li.appendChild(document.createTextNode(': expected ' + want + '; used ' + have)); 40 var pre = document.createElement('pre'); 41 pre.appendChild(document.createTextNode(frame.contentWindow.document.getElementsByTagName('pre')[0].firstChild.data)); 42 li.appendChild(pre); 43 li.value = current; 44 document.getElementById('failures').appendChild(li); 45 } 46 current += 1; 47 if (current <= max) 48 dotest(); 49 else { 50 frame.parentNode.removeChild(frame); 51 document.getElementById('status').innerText = "Tests ran."; 52 if (window.layoutTestController) 53 layoutTestController.notifyDone(); 54 } 55 }; 56 } 57 58 function runtests(c, m) { 59 current = c; 60 max = m; 61 dotest(); 62 } 63 64 function alert() { } 65