Bug 593262. The stop/reload button is chasing me. Keep running from it. r=roc a=fix a test

--HG--
rename : layout/style/test/hover_helper.html => layout/style/test/chrome/hover_helper.html
rename : layout/style/test/test_hover.html => layout/style/test/chrome/test_hover.html
This commit is contained in:
Timothy Nikkel 2010-09-03 00:43:26 -05:00
parent ea9f2b9fe9
commit d4615fd0e6
4 changed files with 25 additions and 26 deletions

View File

@ -145,8 +145,6 @@ _TEST_FILES = test_acid3_test46.html \
test_dont_use_document_colors.html \
test_font_face_parser.html \
test_garbage_at_end_of_declarations.html \
test_hover.html \
hover_helper.html \
test_ident_escaping.html \
test_inherit_computation.html \
test_inherit_storage.html \

View File

@ -48,6 +48,8 @@ _CHROME_FILES = \
bug535806-css.css \
bug535806-html.html \
bug535806-xul.xul \
test_hover.html \
hover_helper.html \
$(NULL)
libs:: $(_CHROME_FILES)

View File

@ -2,10 +2,7 @@
<html>
<head>
<title>Test for :hover</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<style type="text/css">
div#one { height: 10px; width: 10px; }
@ -40,7 +37,7 @@
var imports = [ "SimpleTest", "is", "isnot", "ok" ];
for each (var import in imports) {
window[import] = window.opener[import];
window[import] = window.opener.wrappedJSObject[import];
}
var div = document.getElementById("display");
@ -55,9 +52,11 @@ iframe.contentDocument.close();
var moveEvent = { type: "mousemove", clickCount: "0" };
function setResize(str) {
iframe.contentDocument.body.setAttribute("onresize",
"document.body.setAttribute('onresize', 'void(0)');" +
"setTimeout('" + str + "', 100)");
var handler = function() {
iframe.contentWindow.removeEventListener("resize", arguments.callee, false);
setTimeout(str, 100);
};
iframe.contentWindow.addEventListener("resize", handler, false);
}
function step1() {
@ -85,7 +84,7 @@ function step1() {
":hover applies");
/** Test for Bug 302561 **/
setResize("parent.step2()");
setResize("step2();");
is(iframe.contentDocument.body.offsetWidth, 50,
":hover does not apply (iframe body width)");
synthesizeMouse(divtwoparent, 7, 5, moveEvent, window);
@ -101,7 +100,7 @@ function step2() {
":hover applies");
is(iframe.contentDocument.body.offsetWidth, 100,
":hover applies (iframe body width)");
setResize("parent.step3()");
setResize("step3()");
synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
is(iframe.contentDocument.body.offsetWidth, 50,
":hover does not apply (iframe body width)");
@ -118,7 +117,7 @@ function step3() {
}
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
":hover does not apply");
setResize("parent.step4()");
setResize("step4()");
/* expect to get a second resize from the oscillation */
}
@ -137,7 +136,7 @@ var step5called = false;
function step5() {
is(step5called, false, "step5 called only once");
step5called = true;
setResize("parent.step6()");
setResize("step6()");
synthesizeMouse(divtwoparent, 25, 5, moveEvent, window);
}
@ -147,7 +146,7 @@ function step6() {
step6called = true;
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
":hover does not apply");
setResize("parent.step7()");
setResize("step7()");
synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
}
@ -162,7 +161,7 @@ function step7() {
}
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
":hover applies");
setResize("parent.step8()");
setResize("step8()");
/* expect to get a second resize from the oscillation */
}
@ -187,7 +186,7 @@ function step9() {
/* move the mouse out of the way */
synthesizeMouse(divtwoparent, 200, 5, moveEvent, window);
divtwoparent.scrollLeft = 5;
setResize("parent.step10()");
setResize("step10()");
synthesizeMouse(divtwoparent, 2, 5, moveEvent, window);
/* mouse now over 7, 5 */
}
@ -198,7 +197,7 @@ function step10() {
step10called = true;
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
":hover applies");
setResize("parent.step11()");
setResize("step11()");
divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
}
@ -213,7 +212,7 @@ function step11() {
}
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
":hover does not apply");
setResize("parent.step12()");
setResize("step12()");
/* expect to get a second resize from the oscillation */
}
@ -232,7 +231,7 @@ var step13called = false;
function step13() {
is(step13called, false, "step13 called only once");
step13called = true;
setResize("parent.step14()");
setResize("step14()");
divtwoparent.scrollLeft = 25; /* mouse now over 27,5 */
}
@ -242,7 +241,7 @@ function step14() {
step14called = true;
is(getComputedStyle(divtwo, "").backgroundColor, "transparent",
":hover does not apply");
setResize("parent.step15()");
setResize("step15()");
divtwoparent.scrollLeft = 0; /* mouse now over 2,5 */
}
@ -257,7 +256,7 @@ function step15() {
}
is(getComputedStyle(divtwo, "").backgroundColor, "rgb(0, 255, 0)",
":hover applies");
setResize("parent.step16()");
setResize("step16()");
/* expect to get a second resize from the oscillation */
}

View File

@ -2,10 +2,10 @@
<html>
<head>
<title>Test for :hover</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/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 onload="startTest();">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>