Bug 695275 - Add test for ThebesLayer -> ImageLayer conversion. r=roc

This commit is contained in:
Matt Woodrow 2011-10-21 14:23:05 +13:00
parent 7722ff274a
commit ffe61897e1
4 changed files with 49 additions and 0 deletions

View File

@ -65,6 +65,9 @@ _TEST_FILES = \
border_radius_hit_testing_iframe.html \
test_preserve3d_sorting_hit_testing.html \
preserve3d_sorting_hit_testing_iframe.html \
test_image_layers.html \
image_rgrg-256x256.png \
image_rrgg-256x256.png \
bug369950-subframe.xml \
decoration_line_rendering.js \
test_after_paint_pref.html \

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

View File

@ -0,0 +1,46 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that images that are the only item in ThebesLayers get put into ImageLayers</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="changeImage()">
<div>
<img id="image" src="./image_rgrg-256x256.png" style="-moz-transform: translatex(1px)"></img>
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var image = document.getElementById("image");
var lastPaintCount;
function changeImage() {
lastPaintCount = window.mozPaintCount;
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
utils.checkAndClearPaintedState(image);
image.src = "./image_rrgg-256x256.png";
checkDone();
}
function checkDone() {
if (window.mozPaintCount == lastPaintCount) {
setTimeout(checkDone, 30);
return;
}
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
ok(!utils.checkAndClearPaintedState(image), "Should not paint any thebes layers for our image!");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>