summaryrefslogtreecommitdiffstats
path: root/layout/generic/test/test_invalidate_during_plugin_paint.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/generic/test/test_invalidate_during_plugin_paint.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/generic/test/test_invalidate_during_plugin_paint.html')
-rw-r--r--layout/generic/test/test_invalidate_during_plugin_paint.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/layout/generic/test/test_invalidate_during_plugin_paint.html b/layout/generic/test/test_invalidate_during_plugin_paint.html
new file mode 100644
index 000000000..5894968b5
--- /dev/null
+++ b/layout/generic/test/test_invalidate_during_plugin_paint.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test handling plugins invalidating during paint</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script type="text/javascript" src="plugin-utils.js"></script>
+ <script type="text/javascript">
+ setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
+ </script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+ <style>
+ embed { width:200px; height:200px; display:block; }
+ </style>
+</head>
+<body>
+<p id="display"></p>
+<div id="content" style="display: block">
+ <embed id="p1" type="application/x-test" drawmode="solid" color="80808080"></embed>
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+var p1 = document.getElementById("p1");
+var initialPaintCount;
+
+function checkEnded() {
+ var paints = p1.getPaintCount() - initialPaintCount;
+ if (paints > 20) {
+ ok(true, "Got " + paints + " paints");
+ SimpleTest.finish();
+ return;
+ }
+
+ setTimeout(checkEnded, 30);
+}
+
+function doTest() {
+ initialPaintCount = p1.getPaintCount();
+
+ // Tell the plugin to invalidate every time it paints
+ p1.setInvalidateDuringPaint(true);
+ // Trigger an invalidation to get painting started
+ p1.setColor("FFFFFFFF");
+ // Now we should have an infinite cycle of painting and invalidations.
+
+ // Poll for more than 20 paints to happen.
+ checkEnded();
+}
+
+// Need to run 'doTest' after painting is unsuppressed, or we'll set clip
+// regions to empty.
+addLoadEvent(doTest);
+SimpleTest.waitForExplicitFinish();
+SimpleTest.requestFlakyTimeout("untriaged");
+
+</script>
+</pre>
+</body>
+</html>