Bug 695275 - Add test for ThebesLayer -> ImageLayer conversion. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 26 Oct 2011 16:26:24 +1300
changeset 79232 d7f3bfc7cd46924ea858469d11162846d9901776
parent 79231 715363a6428becc3fec330f47dd7149333384017
child 79233 a2cb1c0671d5004423e564c1b43dbc854a707858
push id21380
push userbmo@edmorley.co.uk
push dateWed, 26 Oct 2011 23:31:27 +0000
treeherderautoland@16a8d2ab5240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs695275
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 695275 - Add test for ThebesLayer -> ImageLayer conversion. r=roc
layout/base/tests/Makefile.in
layout/base/tests/image_rgrg-256x256.png
layout/base/tests/image_rrgg-256x256.png
layout/base/tests/test_image_layers.html
--- a/layout/base/tests/Makefile.in
+++ b/layout/base/tests/Makefile.in
@@ -60,16 +60,19 @@ SIMPLE_PROGRAMS += $(BARE_UNIT_TESTS:.cp
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -D_IMPL_NS_LAYOUT
 
 _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 \
 		test_border_radius_hit_testing.html \
 		test_bug66619.html \
 		test_bug93077-1.html \
 		test_bug93077-2.html \
 		test_bug93077-3.html \
new file mode 100644
index 0000000000000000000000000000000000000000..e6fba3daa5dfc788eaeedb73636e82abfedc8ae5
GIT binary patch
literal 131
zc%17D@N?(olHy`uVBq!ia0y~yU}OMcMrI(Dw#P~pNU;U@gt#*N2SSF6v%S^<MJzmB
z978hhy}h6)#K6FDc*EcSmmj2C#;jUAYvm=7ei)Ex)JNjkG_!VPet7g?k%<wA>*?y}
Jvd$@?2>{esAxZ!M
new file mode 100644
index 0000000000000000000000000000000000000000..7f6351565473f4b8db1fa69530700491f7c88a54
GIT binary patch
literal 120
zc%17D@N?(olHy`uVBq!ia0y~yU}OMcMrI(Dw#P~pNU;U@gt#*N2SSF6v%S^<MRYw~
z978hhy*;&&mw|zUdBMN`TjpIjxZ|MDvJM4~CKx(o2vo{o6K${h;gSC5>uw;Pr>mdK
II;Vst0P+qZp#T5?
new file mode 100644
--- /dev/null
+++ b/layout/base/tests/test_image_layers.html
@@ -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>