Bug 396367. Fix up some tests to be more robust. r=enndeakin

--HG--
extra : rebase_source : c3aafd472aebcacfce7f778d61f5a088dd0493c4
This commit is contained in:
Timothy Nikkel 2009-12-22 17:53:07 -06:00
Родитель 6f934b4f2a
Коммит 6f64bee5b3
8 изменённых файлов: 34 добавлений и 24 удалений

Просмотреть файл

@ -12,8 +12,9 @@
<iframe id="f1" width="100" height="100" onload="frameLoaded()"
src="data:text/html,%3Cbody%20style='height:%208000px'%3E%3Cp%3EHello%3C/p%3EGoodbye%3C/body%3E"/>
<!-- <body style='height: 8000px'><p>Hello</p><span id='s'>Goodbye<span></body> -->
<iframe id="f2" type="content" showcaret="true" width="100" height="100" onload="frameLoaded()"
src="data:text/html,%3Cbody%20style='height:%208000px'%3E%3Cp%3EHello%3C/p%3EGoodbye%3C/body%3E"/>
src="data:text/html,%3Cbody%20style%3D%27height%3A%208000px%27%3E%3Cp%3EHello%3C%2Fp%3E%3Cspan%20id%3D%27s%27%3EGoodbye%3Cspan%3E%3C%2Fbody%3E"/>
<script>
<![CDATA[
@ -21,7 +22,7 @@
var framesLoaded = 0;
var otherWindow = null;
function frameLoaded() { if (++framesLoaded == 2) runTest(); }
function frameLoaded() { if (++framesLoaded == 2) SimpleTest.waitForFocus(runTest); }
SimpleTest.waitForExplicitFinish();
function runTest()
@ -42,7 +43,9 @@ function runTest()
window.frames[1].focus();
document.commandDispatcher.getControllerForCommand("cmd_scrollBottom").doCommand("cmd_scrollBottom");
is(frames[1].scrollY, 0, "scrollY for showcaret");
ok(frames[1].scrollY <
frames[1].document.getElementById('s').getBoundingClientRect().top,
"scrollY for showcaret");
isnot(sel2.focusNode, frames[1].document.body, "focusNode for showcaret");
ok(sel2.anchorOffset > 0, "focusOffset for showcaret");

Просмотреть файл

@ -8,8 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=436084
<window title="Mozilla Bug 288254"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -65,7 +64,7 @@ var prefs = [
["keyCode.modifier", "char", "none"],
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -83,5 +82,7 @@ function onLoad()
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]></script>
</window>

Просмотреть файл

@ -8,8 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=436084
<window title="Mozilla Bug 288254"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -47,7 +46,7 @@ var prefs = [
["keyCode.modifier", "char", "none"],
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -65,5 +64,7 @@ function onLoad()
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]></script>
</window>

Просмотреть файл

@ -4,8 +4,7 @@
<window title="Mozilla Bug 444801"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -41,7 +40,7 @@
["keyCode.modifier", "char", "none"],
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -59,6 +58,8 @@
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]>
</script>
</window>

Просмотреть файл

@ -4,8 +4,7 @@
<window title="Mozilla Bug 444801"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -53,7 +52,7 @@
["keyCode.up", "int", 85], // DOM_VK_U
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -71,6 +70,8 @@
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]>
</script>
</window>

Просмотреть файл

@ -8,8 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=436084
<window title="Mozilla Bug 288254"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -58,7 +57,7 @@ var prefs = [
["keyCode.modifier", "char", "none"],
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -76,5 +75,7 @@ function onLoad()
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]></script>
</window>

Просмотреть файл

@ -8,8 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=436084
<window title="Mozilla Bug 288254"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -114,7 +113,7 @@ var prefs = [
["keyCode.modifier", "char", "none"],
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -132,5 +131,7 @@ function onLoad()
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]></script>
</window>

Просмотреть файл

@ -8,8 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=436084
<window title="Mozilla Bug 288254"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
@ -97,7 +96,7 @@ var prefs = [
["keyCode.modifier", "char", "none"],
];
function onLoad()
function runtest()
{
prepareTest(prefs);
@ -115,5 +114,7 @@ function onLoad()
SpatialNavigation.uninit();
}
SimpleTest.waitForFocus(runtest);
]]></script>
</window>