Bug 670058 part.2 Add regression test r=smaug

This commit is contained in:
Masayuki Nakano 2011-07-11 23:13:36 +09:00
parent 45e96cf000
commit 0e4868c8d9
2 changed files with 53 additions and 0 deletions

View File

@ -137,6 +137,7 @@ _CHROME_FILES = \
file_bug514732_window.xul \
test_selection_scrolling.html \
window_selection_scrolling.html \
test_bug670058.html \
$(NULL)
libs:: $(_TEST_FILES)

View File

@ -0,0 +1,52 @@
<!DOCTYPE>
<html>
<head>
<title>test for bug 670058</title>
<script type="text/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body>
<textarea id="textarea" style="width: 200px; height: 100px;"></textarea>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var textarea = document.getElementById('textarea');
var x = 50;
var y = 50;
var timer = 0;
function doTest() {
synthesizeMouse(textarea, x, y, { type: "mousedown" });
timer = setInterval(function()
{
if (textarea.style.display == 'block') {
synthesizeMouse(textarea, x++, y++, { type: "mousemove" });
textarea.style.display = '';
} else {
textarea.style.display = 'block';
synthesizeMouse(textarea, x++, y++, { type: "mousemove" });
}
if (x == 70) {
ok(true, "not crashed");
clearInterval(timer);
SimpleTest.finish();
}
}, 200);
}
SimpleTest.waitForFocus(doTest, window);
</script>
</pre>
</body>
</html>