Some tests for bug 626602. a=b landing on a CLOSED TREE

This commit is contained in:
Chris Jones 2011-02-16 16:43:31 -06:00
Родитель 80228f74c3
Коммит 13d54d595c
15 изменённых файлов: 484 добавлений и 1 удалений

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

@ -1458,7 +1458,7 @@ asserts(5) == 528038-2.html 528038-2-ref.html # bug 512749
== 539880-1-dynamic.html 539880-1-ref.html
== 539949-1.html#test2 539949-1-ref.html#test2
== 541382-1.html 541382-1-ref.html
random-if(!haveTestPlugin) == 541406-1.html 541406-1-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||!haveTestPlugin) == 541406-1.html 541406-1-ref.html
needs-focus != 542116-1.html 542116-1-ref.html
needs-focus != 542116-2.html 542116-2-ref.html
needs-focus != 542116-3.html 542116-3-ref.html

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

@ -0,0 +1,109 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style type="text/css">
#one {
position:absolute;
left:0px; top:0px;
z-index:4;
}
#two {
position:absolute;
top:100px; left:100px;
background-color:rgb(0,0,0,0);
z-index:3;
}
#three {
position:absolute;
left:100px; top:100px;
width:200px; height:200px;
background-color: rgb(255,0,0);
opacity:0.6;
z-index:2;
}
#four {
position:absolute;
top:100px; left:100px;
z-index:1;
}
</style>
<script type="text/javascript">
var plugin, div, canvas;
function start() {
plugin = document.getElementById("four");
div = document.getElementById("three");
canvas = document.getElementById("two");
paintCanvas();
mozRequestAnimationFrame(moveSomething);
}
function paintCanvas() {
var ctx = canvas.getContext("2d");
ctx.fillStyle = "rgba(255,0,0, 0.6)";
ctx.fillRect(0,0, 200,200);
}
var i = 0, numLoops = 20;
var pluginIn = true, divIn = true, canvasIn = true;
function moveSomething() {
var didSomething = (0 === (i % 2)) ? moveSomethingOut() : moveSomethingIn();
if (!didSomething && ++i >= numLoops) {
return finish();
}
mozRequestAnimationFrame(moveSomething);
}
function finish() {
document.documentElement.removeAttribute("class");
}
function moveSomethingOut() {
if (pluginIn) {
plugin.style.left = "400px";
pluginIn = false;
} else if (divIn) {
div.style.left = "400px";
divIn = false;
} else if (canvasIn) {
canvas.style.left = "400px";
canvasIn = false;
} else {
return false;
}
return true;
}
function moveSomethingIn() {
if (!pluginIn) {
plugin.style.left = "100px";
pluginIn = true;
} else if (!divIn) {
div.style.left = "100px";
divIn = true;
} else if (!canvasIn) {
canvas.style.left = "100px";
canvasIn = true;
} else {
return false;
}
return true;
}
function reset() {
}
</script>
</style>
</head>
<body onload="start();">
<embed id="four" type="application/x-test" width="200" height="200"
drawmode="solid" color="FFFF0000"></embed>
<div id="three"></div>
<canvas id="two" width="200" height="200"></canvas>
<embed id="one" type="application/x-test" width="400" height="400"
drawmode="solid" color="9900FF00"></embed>
</body>
</html>

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

@ -9,3 +9,4 @@ load 570884.html
# Plugin arch is going to change anyway with OOP content so skipping
# this test for now is OK.
skip-if(browserIsRemote||!haveTestPlugin||http.platform!="X11"||!testPluginIsOOP()) load 598862.html
load 626602-1.html

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<link rel="stylesheet" type="text/css" href="plugin-background.css"></link>
<script type="text/javascript">
var NUM_STEPS = 1;
</script>
<script type="text/javascript" src="plugin-background.js"></script>
</head>
<body>
<div id="bad">Test some plugin stuff.</div>
<div id="good"></div>
<embed id="plugin" type="application/x-test" width="199" height="199"
drawmode="solid" color="330000FF"></embed>
<div id="topbar"></div>
<div id="leftbar"></div>
<div id="rightbar"></div>
<div id="bottombar"></div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<link rel="stylesheet" type="text/css" href="plugin-background.css"></link>
<script type="text/javascript">
var NUM_STEPS = 10;
</script>
<script type="text/javascript" src="plugin-background.js"></script>
</head>
<body>
<div id="bad">Test some plugin stuff.</div>
<div id="good"></div>
<embed id="plugin" type="application/x-test" width="199" height="199"
drawmode="solid" color="330000FF"></embed>
<div id="topbar"></div>
<div id="leftbar"></div>
<div id="rightbar"></div>
<div id="bottombar"></div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<link rel="stylesheet" type="text/css" href="plugin-background.css"></link>
<script type="text/javascript">
var NUM_STEPS = 2;
</script>
<script type="text/javascript" src="plugin-background.js"></script>
</head>
<body>
<div id="bad">Test some plugin stuff.</div>
<div id="good"></div>
<embed id="plugin" type="application/x-test" width="199" height="199"
drawmode="solid" color="330000FF"></embed>
<div id="topbar"></div>
<div id="leftbar"></div>
<div id="rightbar"></div>
<div id="bottombar"></div>
</body>
</html>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<link rel="stylesheet" type="text/css" href="plugin-background.css"></link>
<script type="text/javascript">
var NUM_STEPS = 5;
</script>
<script type="text/javascript" src="plugin-background.js"></script>
</head>
<body>
<div id="bad">Test some plugin stuff.</div>
<div id="good"></div>
<embed id="plugin" type="application/x-test" width="199" height="199"
drawmode="solid" color="330000FF"></embed>
<div id="topbar"></div>
<div id="leftbar"></div>
<div id="rightbar"></div>
<div id="bottombar"></div>
</body>
</html>

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

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="plugin-background.css"></link>
</head>
<body>
<div id="bad">Test some plugin stuff.</div>
<div id="good"></div>
<div id="plugin"></div>
<div id="topbar"></div>
<div id="leftbar"></div>
<div id="rightbar"></div>
<div id="bottombar"></div>
</body>
</html>

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

@ -0,0 +1,58 @@
div {
position: absolute;
}
#bad {
left:220px; top:0px;
z-index: 0;
}
#good {
left:0px; top:0px;
width:220px; height:220px;
background-color: rgba(0,255,0, 0.6);
z-index: 0;
}
#topbar {
left:0px; top:0px;
width:220px; height:20px;
background-color: rgb(0,0,0);
z-index: 2;
}
#topbar {
left:0px; top:0px;
width:220px; height:20px;
background-color: rgb(0,0,0);
z-index: 2;
}
#leftbar {
left:0px; top:0px;
width:20px; height:220px;
background-color: rgb(0,0,0);
z-index: 2;
}
#rightbar {
left:200px; top:0px;
width:20px; height:220px;
background-color: rgb(0,0,0);
z-index: 2;
}
#bottombar {
left:0px; top:200px;
width:220px; height:20px;
background-color: rgb(0,0,0);
z-index: 2;
}
div#plugin {
position: absolute;
left:1px; top:1px;
width:199px; height:199px;
background-color: rgba(0,0,255, 0.2);
z-index: 1;
}
embed#plugin {
position: absolute;
left:1px; top:1px;
z-index: 1;
}

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

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="plugin-background.css"></link>
</head>
<body>
<div id="bad">Test some plugin stuff.</div>
<div id="good"></div>
<embed id="plugin" type="application/x-test" width="199" height="199"
drawmode="solid" color="330000FF"></embed>
<div id="topbar"></div>
<div id="leftbar"></div>
<div id="rightbar"></div>
<div id="bottombar"></div>
</body>
</html>

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

@ -0,0 +1,75 @@
// The including script sets this for us
//var NUM_STEPS;
var plugin;
var left = 1, top = 1, width = 199, height = 199;
function movePluginTo(x, y, w, h) {
left = x; top = y; width = w; height = h;
plugin.width = w;
plugin.height = h;
plugin.style.left = left + "px";
plugin.style.top = top + "px";
}
function deltaInBounds(dx,dy, dw,dh) {
var l = dx + left;
var r = l + width + dw;
var t = dy + top;
var b = t + height + dh;
return (0 <= l && l <= 20 &&
0 <= t && t <= 20 &&
200 <= r && r <= 220 &&
200 <= b && b <= 220);
}
var initialFrame;
function start() {
window.removeEventListener("MozReftestInvalidate", start, false);
window.addEventListener("MozAfterPaint", step, false);
window.addEventListener("MozPaintWaitFinished", step, false);
initialFrame = window.mozPaintCount;
plugin = document.getElementById("plugin");
movePluginTo(0,0, 200,200);
}
var steps = 0;
var which = "move"; // or "grow"
var dx = 1, dy = 1, dw = 1, dh = 1;
function step() {
if (++steps >= NUM_STEPS) {
window.removeEventListener("MozAfterPaint", step, false);
window.removeEventListener("MozPaintWaitFinished", step, false);
return finish();
}
var didSomething = false;
if (which == "grow") {
if (deltaInBounds(0,0, dw,dh)) {
movePluginTo(left,top, width+dw, height+dh);
didSomething = true;
} else {
dw = -dw; dh = -dh;
}
} else {
// "move"
if (deltaInBounds(dx,dy, 0,0)) {
movePluginTo(left+dx,top+dy, width, height);
didSomething = true;
} else {
dx = -dx; dy = -dy;
}
}
which = (which == "grow") ? "move" : "grow";
if (!didSomething) {
step();
}
}
function finish() {
document.documentElement.removeAttribute("class");
}
window.addEventListener("MozReftestInvalidate", start, false);

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

@ -0,0 +1,49 @@
<!doctype html>
<html>
<head>
<style type="text/css">
#one {
position:absolute;
left:0px; top:0px;
z-index:4;
}
#two {
position:absolute;
top:100px; left:100px;
background-color:rgb(0,0,0,0);
z-index:3;
}
#three {
position:absolute;
left:100px; top:100px;
width:200px; height:200px;
background-color: rgb(255,0,0);
opacity:0.6;
z-index:2;
}
#four {
position:absolute;
top:100px; left:100px;
z-index:1;
}
</style>
<script type="text/javascript">
function paintCanvas() {
var canvas = document.getElementById("two");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "rgba(255,0,0, 0.6)";
ctx.fillRect(0,0, 200,200);
}
</script>
</style>
</head>
<body onload="paintCanvas();">
<embed id="four" type="application/x-test" width="200" height="200"
drawmode="solid" color="FFFF0000"></embed>
<div id="three"></div>
<canvas id="two" width="200" height="200"></canvas>
<embed id="one" type="application/x-test" width="400" height="400"
drawmode="solid" color="9900FF00"></embed>
</body>
</html>

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

@ -0,0 +1,34 @@
<!doctype html>
<html>
<head>
<style type="text/css">
#one {
position:absolute;
left:0px; top:0px;
z-index:1;
}
#two {
position:absolute;
top:100px; left:100px;
// Set these using the canvas API
// width:200px; height:200px;
// background-color: rgb(255,0,0);
z-index:0;
}
</style>
<script type="text/javascript">
function paintCanvas() {
var canvas = document.getElementById("two");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "rgb(255,0,0)";
ctx.fillRect(0,0, 200,200);
}
</script>
</style>
</head>
<body onload="paintCanvas();">
<canvas width="200" height="200" id="two"></canvas>
<embed id="one" type="application/x-test" width="400" height="400" drawmode="solid" color="9900FF00"></embed>
</body>
</html>

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

@ -0,0 +1,26 @@
<!doctype html>
<html>
<head>
<style type="text/css">
#one {
position:absolute;
left:0px; top:0px;
z-index:1;
}
#two {
position:absolute;
top:0px; left:0px;
width:200px; height:200px;
z-index:0;
background-color: rgb(255,0,0);
-moz-transform-origin: 0 0;
-moz-transform: translate(100px,100px);
}
</style>
</head>
<body>
<div id="two"></div>
<embed id="one" type="application/x-test" width="400" height="400" drawmode="solid" color="9900FF00"></embed>
</body>
</html>

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

@ -9,3 +9,11 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) =
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == border-padding-3.html border-padding-3-ref.html # bug 629430
random-if(cocoaWidget||d2d) fails-if(!haveTestPlugin) skip-if(!testPluginIsOOP()) == pluginproblemui-direction-1.html pluginproblemui-direction-1-ref.html
fails-if(!haveTestPlugin) skip-if(!testPluginIsOOP()) == pluginproblemui-direction-2.html pluginproblemui-direction-2-ref.html
fails-if(!haveTestPlugin) == plugin-canvas-alpha-zindex.html div-alpha-zindex.html
fails-if(!haveTestPlugin) == plugin-transform-alpha-zindex.html div-alpha-zindex.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-busy-alpha-zindex.html div-alpha-zindex.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background.html plugin-background-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-1-step.html plugin-background-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-2-step.html plugin-background-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-5-step.html plugin-background-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(!haveTestPlugin) == plugin-background-10-step.html plugin-background-ref.html