<pre id="log"></pre>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

function log(string) {
   document.getElementById("log").innerHTML += string + "\n";
}

log("1");
document.write("<script>log('2')<"+"/script>");
document.write("<script>log('3')<"+"/script>");
log("4");
</script>
