parser/htmlparser/tests/mochitest/test_bug568470.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/htmlparser/tests/mochitest/test_bug568470.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=568470
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 568470</title>
    1.11 +  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
    1.12 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=568470">Mozilla Bug 568470</a>
    1.17 +<p id="display"></p>
    1.18 +<pre id="test">
    1.19 +<script class="testbody" type="text/javascript">
    1.20 +/** Test for Bug 568470 **/
    1.21 +SimpleTest.waitForExplicitFinish();
    1.22 +
    1.23 +// assuming the test runs in less than a year...
    1.24 +var time = new Date().getTime() + 1000*60*60*24*365;
    1.25 +
    1.26 +var interval = setInterval(function() {
    1.27 +  var iframe = document.getElementsByTagName("iframe")[0];
    1.28 +  if (iframe) {
    1.29 +    var doc = iframe.contentDocument;
    1.30 +    if (doc) {
    1.31 +      if (doc.getElementById("flushable")) {
    1.32 +        time = new Date();
    1.33 +        clearInterval(interval);        
    1.34 +      }
    1.35 +    }
    1.36 +  }
    1.37 +}, 25);
    1.38 +
    1.39 +function finish() {
    1.40 +  clearInterval(interval);
    1.41 +  var elapsed = new Date().getTime() - time;
    1.42 +  ok(elapsed > 350,
    1.43 +     "Content flush time and parse end time not enough apart.");
    1.44 +  SimpleTest.finish();
    1.45 +}
    1.46 +
    1.47 +</script>
    1.48 +</pre>
    1.49 +<div id="content" style="display: none">
    1.50 +  <iframe onload="finish();" src="file_bug568470.sjs"></iframe>
    1.51 +</div>
    1.52 +</body>
    1.53 +</html>
    1.54 +

mercurial