Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test transitions/animations? #12120

Closed
emilio opened this issue Jul 1, 2016 · 4 comments
Closed

How to test transitions/animations? #12120

emilio opened this issue Jul 1, 2016 · 4 comments

Comments

@emilio
Copy link
Member

@emilio emilio commented Jul 1, 2016

As animation support increases, it'd be great to have some sort of testing support for it.

We can't test them deteministically right now. Gecko has a "test mode" in their refresh driver that allows them to fake the times, advance the clocks, etc. as well as an API to get the computed style for an element in a given point of time.

We don't have that infra, and though it seems like a good amount of work, I think it's worth doing.

@emilio
Copy link
Member Author

@emilio emilio commented Jul 7, 2016

So the idea I'm thinking about is adding a pref or something as we do to test our crash handler, but adding:

  1. A test mode to the constellation that allows us to trigger animation ticks on-demand.
  2. A pref-guarded API that allows us to "move" the clock by a delta, and trigger an animation tick.

I think that should be enough to be able to write a bunch of animation tests under tests/mozilla.

CC'ing @Ms2ger and @jdm just in case they have thoughts on this or maybe a better way to do it :)

@jdm
Copy link
Member

@jdm jdm commented Jul 7, 2016

No better idea!

@metajack
Copy link
Contributor

@metajack metajack commented Jul 8, 2016

👍

@emilio
Copy link
Member Author

@emilio emilio commented Jul 11, 2016

A potential implementation of this lives in #12392

bors-servo added a commit that referenced this issue Jul 20, 2016
style: Add support to test animations programatically.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #12120

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

r? @SimonSapin for the style changes, @Ms2ger or @jdm for the dom and test changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12392)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.