test for bug 807728
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 08 Nov 2012 10:15:42 +1300
changeset 112606 e3c77661d40331e46f86512016cabba408e3a598
parent 112605 f64ee963d915c465adcde555f04eaf73c2e31434
child 112607 b96d1860a248dc063c29dc7f71241ed3e92a4f97
push id23833
push useremorley@mozilla.com
push dateThu, 08 Nov 2012 10:20:57 +0000
treeherdermozilla-central@e0d7b394462b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs807728
milestone19.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
test for bug 807728
dom/plugins/test/reftest/reftest.list
dom/plugins/test/reftest/update-1-ref.html
dom/plugins/test/reftest/update-1.html
--- a/dom/plugins/test/reftest/reftest.list
+++ b/dom/plugins/test/reftest/reftest.list
@@ -21,9 +21,10 @@ random-if(/^Windows\x20NT\x206\.1/.test(
 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
 random-if(!haveTestPlugin) == plugin-transform-1.html plugin-transform-1-ref.html
 fails-if(!haveTestPlugin) == plugin-transform-2.html plugin-transform-2-ref.html
 skip-if(!haveTestPlugin) == shrink-1.html shrink-1-ref.html
+skip-if(!haveTestPlugin) == update-1.html update-1-ref.html
 fails-if(!haveTestPlugin) == windowless-layers.html windowless-layers-ref.html
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/reftest/update-1-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+  <embed id="plugin" type="application/x-test"
+         drawmode="solid" color="FFFF0000" width="30" height="50">
+  </embed>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/reftest/update-1.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+  <title>Test for bug 807728</title>
+  <script>
+function do_test()
+{
+    var plugin = document.getElementById("plugin");
+    var color = "FF000000";
+    var color1 = "FF000001";
+    var color2 = "FF000002";
+    var last_paint_count = 0;
+    // Enough paints to test reusing a surface after it has been
+    // moved from front to back buffer.
+    var paints_required = 10;
+    var final_color = "FFFF0000";
+
+    function wait_for_paints() {
+        var paint_count = plugin.getPaintCount();
+        if (paint_count >= paints_required && color == final_color) {
+            document.documentElement.removeAttribute("class");
+            return;
+        }
+        if (paint_count != last_paint_count) {
+            last_paint_count = paint_count;
+            if (paint_count + 1 >= paints_required) {
+                color = final_color;
+            } else if (color != color1) {
+                color = color1;
+            } else {
+                color = color2;
+            }
+            plugin.setColor(color);
+        }       
+        setTimeout(wait_for_paints, 0);
+    }
+
+    wait_for_paints();
+}
+  </script>
+</head>
+<body onload="do_test()">
+  <embed id="plugin" type="application/x-test"
+         drawmode="solid" color="FF000000" width="30" height="50">
+  </embed>
+</body>
+</html>