Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Issue 11316135: NOT READY FOR REVIEW - Add support for custom animation timers. (Closed)

Created:
8 years, 1 month ago by Ian Vollick
Modified:
7 years, 4 months ago
CC:
chromium-reviews, piman+watch_chromium.org, cc-bugs_chromium.org, jonathan.backer
Visibility:
Public.

Description

NOT READY FOR REVIEW - Add support for custom animation timers. This CL is incomplete, but when fleshed out, I think it will provide a very clean way to advance animations in tests. You can now install your own animation timer which can progress its animations however it wants. This approach seems far superior to my previous approach, which was to grab the last step time and manually call AnimationContainerElement::Step on each of the animations. The main problem being that you don't always have access to these animations, especially if they are created implicitly. BUG=None

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -13 lines) Patch
M ui/compositor/compositor.gyp View 2 chunks +3 lines, -0 lines 0 comments Download
A ui/compositor/layer_animation_timer.h View 1 chunk +26 lines, -0 lines 0 comments Download
M ui/compositor/layer_animator.h View 2 chunks +8 lines, -0 lines 0 comments Download
M ui/compositor/layer_animator.cc View 6 chunks +49 lines, -13 lines 0 comments Download
A ui/compositor/test/test_layer_animation_timer.h View 1 chunk +33 lines, -0 lines 0 comments Download
A ui/compositor/test/test_layer_animation_timer.cc View 1 chunk +41 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Ian Vollick
Denis, what do you think of this approach?
8 years, 1 month ago (2012-11-21 16:03:16 UTC) #1
Denis Kuznetsov (DE-MUC)
This is much cleaner than my draft. However, I had few more things in my ...
8 years, 1 month ago (2012-11-21 21:07:39 UTC) #2
Ian Vollick
8 years, 1 month ago (2012-11-22 02:13:18 UTC) #3
On 2012/11/21 21:07:39, Denis Kuznetsov wrote:
> This is much cleaner than my draft.
> However, I had few more things in my mind:
> 1) Implementation of test timer that follows existing AnimationContainer
> contract (e.g. upon call to Start(AnimationContainerElement* element) we
expect
> SetStartTime to be called on that element) we would have to duplicate most of
> the AnimationContainer class anyway. So I would prefer to keep that changes
> around AnimationContainer class rather than around LayerAnimator.
I'm not against plugging a fake, test timer into the AnimationContainer. With
this CL, I was only thinking of the simplest way to advance time for
LayerAnimators in tests. If this were the only goal, I'd argue that it would be
simpler to swap out the AnimationContainer. For the LayerAnimator, the only
AnimationContainerElement method that matters is ::Step; there is no need for
::SetStartTime to be called at all. So the fake, test controller need only call
Step as required by the test. Also, there's no risk of breaking the
AnimationContainer for its other clients.

> 2) implementing this in AnimationContainer class would ease testability of
other
> (some bitmap?) animations that could be based on it.
This is a very fair point. If you think that your modifications to
AnimationContainer would be broadly useful, that's a good argument for going
that route.

> 3) I would prefer to have some scoped changer for test class, so that tests
that
> use it won't affect other tests in suite that might test "unchanged"
animations.
This could certainly be done with either approach.

Powered by Google App Engine
This is Rietveld 408576698