DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (a81015259a98)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
<html>
<head>
  <title>Test for plugin child widgets not being messed up by scrolling</title>
  <script type="text/javascript"
          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css"
          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body onload="setTimeout(runTests, 0)">
<p id="display">
  <div style="overflow:hidden; height:100px;" id="scroll">
    <embed type="application/x-test" wmode="window" width="100" height="800" id="plugin"></object>
    <div style="height:1000px;"></div>
  </div>
</p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
</pre>

<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();

var plugin = document.getElementById("plugin");

function consistencyCheck(state) {
  var s = plugin.doInternalConsistencyCheck();
  ok(s == "", "Consistency check: " + state + ": " + s);
}

consistencyCheck("Initial state");

function runTests()
{
  var scroll = document.getElementById("scroll");
  scroll.scrollTop = 10;
  consistencyCheck("Scrolled down a bit");

  setTimeout(function() {
    consistencyCheck("Before scrolling back to top");
    scroll.scrollTop = 0;
    consistencyCheck("Scrolled to top");
  
    setTimeout(function() {
      consistencyCheck("After scrolling to top");

      SimpleTest.finish();
    }, 0);
  }, 0);
}

</script>
</body>

</html>