summaryrefslogtreecommitdiffstats
path: root/dom/animation/test/mozilla/test_mainthread_synchronization_pref.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /dom/animation/test/mozilla/test_mainthread_synchronization_pref.html
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/animation/test/mozilla/test_mainthread_synchronization_pref.html')
-rw-r--r--dom/animation/test/mozilla/test_mainthread_synchronization_pref.html42
1 files changed, 42 insertions, 0 deletions
diff --git a/dom/animation/test/mozilla/test_mainthread_synchronization_pref.html b/dom/animation/test/mozilla/test_mainthread_synchronization_pref.html
new file mode 100644
index 0000000000..3653fd9536
--- /dev/null
+++ b/dom/animation/test/mozilla/test_mainthread_synchronization_pref.html
@@ -0,0 +1,42 @@
+<!doctype html>
+<meta charset=utf-8>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../testcommon.js"></script>
+<style>
+.compositable {
+ /* Element needs geometry to be eligible for layerization */
+ width: 100px;
+ height: 100px;
+ background-color: white;
+}
+</style>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+promise_test(async t => {
+ await SpecialPowers.pushPrefEnv({
+ set: [[ 'dom.animations.mainthread-synchronization-with-geometric-animations', false ]]
+ });
+
+ const elemA = addDiv(t, { class: 'compositable' });
+ const elemB = addDiv(t, { class: 'compositable' });
+
+ const animA = elemA.animate({ transform: [ 'translate(0px)',
+ 'translate(100px)' ] },
+ 100 * MS_PER_SEC);
+ const animB = elemB.animate({ marginLeft: [ '0px', '100px' ] },
+ 100 * MS_PER_SEC);
+
+ await waitForPaints();
+
+ assert_true(SpecialPowers.wrap(animA).isRunningOnCompositor,
+ 'Transform animation should not synchronize with margin-left animation ' +
+ 'created within the same tick with disabling the corresponding pref');
+}, 'Transform animation should not synchronize with margin-left animation '
+ + 'created within the same tick with disabling the corresponding pref');
+
+</script>
+</body>