Skip to content

Commit

Permalink
Bug 1840603 - Enable preferences in dom/animation/test/chrome.ini for…
Browse files Browse the repository at this point in the history
… motion path. r=hiro

Enable the necessary preferences for motion path.

Also, add some more tests to cover most offset-* properties and values.

Differential Revision: https://phabricator.services.mozilla.com/D182240
  • Loading branch information
BorisChiou committed Jun 27, 2023
1 parent 6484688 commit cc7cd4e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dom/animation/test/chrome.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ prefs =
gfx.omta.background-color=true
layout.css.individual-transform.enabled=true
layout.css.motion-path.enabled=true
layout.css.motion-path-basic-shapes.enabled=true
layout.css.motion-path-coord-box.enabled=true
layout.css.motion-path-offset-position.enabled=true
layout.css.motion-path-ray.enabled=true
support-files =
testcommon.js
../../imptests/testharness.js
Expand All @@ -15,14 +19,14 @@ support-files =
[chrome/test_animate_xrays.html]
# file_animate_xrays.html needs to go in mochitest.ini since it is served
# over HTTP
[chrome/test_keyframe_effect_xrays.html]
[chrome/test_animation_observers_async.html]
[chrome/test_animation_observers_sync.html]
[chrome/test_animation_performance_warning.html]
[chrome/test_animation_properties.html]
[chrome/test_animation_properties_display.html]
[chrome/test_cssanimation_missing_keyframes.html]
[chrome/test_generated_content_getAnimations.html]
[chrome/test_keyframe_effect_xrays.html]
[chrome/test_mutation_observer_for_element_removal_in_shadow_tree.html]
[chrome/test_running_on_compositor.html]
[chrome/test_simulate_compute_values_failure.html]
Expand Down
49 changes: 49 additions & 0 deletions dom/animation/test/chrome/test_running_on_compositor.html
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,32 @@
'offset-path:polygon() animation should be running on the compositor');
}, 'offset-path:polygon() animation runs on the compositor');

promise_test(async t => {
const div = addDiv(t);
const animation = div.animate({ offsetPath: ['padding-box',
'padding-box'] },
100 * MS_PER_SEC);

await waitForAnimationReadyToRestyle(animation);
await waitForPaints();

assert_animation_is_running_on_compositor(animation,
'offset-path:padding-box animation should be running on the compositor');
}, 'offset-path:padding-box animation runs on the compositor');

promise_test(async t => {
const div = addDiv(t);
const animation = div.animate({ offsetPath: ['content-box',
'content-box'] },
100 * MS_PER_SEC);

await waitForAnimationReadyToRestyle(animation);
await waitForPaints();

assert_animation_is_running_on_compositor(animation,
'offset-path:content-box animation should be running on the compositor');
}, 'offset-path:content-box animation runs on the compositor');

promise_test(async t => {
const div = addDiv(t);
const animation = div.animate({ offsetDistance: ['0%', '100%'] },
Expand Down Expand Up @@ -1290,6 +1316,29 @@
'new added offset-path animation should be running on the compositor');
}, 'offset-anchor animation runs on the compositor');

promise_test(async t => {
const div = addDiv(t);
const animation = div.animate({ offsetPosition: ['0% 0%', '100% 100%'] },
100 * MS_PER_SEC);

await waitForAnimationReadyToRestyle(animation);
await waitForPaints();

assert_animation_is_not_running_on_compositor(animation,
'offset-position animation is not running on the compositor because ' +
'offset-path is none');

const newAnim = div.animate({ offsetPath: ['None', 'None'] },
100 * MS_PER_SEC);
await waitForAnimationReadyToRestyle(newAnim);
await waitForPaints();

assert_animation_is_running_on_compositor(animation,
'offset-position animation should be running on the compositor');
assert_animation_is_running_on_compositor(newAnim,
'new added offset-path animation should be running on the compositor');
}, 'offset-position animation runs on the compositor');

promise_test(async t => {
const div = addDiv(t);
const animation = div.animate({ translate: ['0px', '100px'],
Expand Down

0 comments on commit cc7cd4e

Please sign in to comment.