12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // Copyright (c) 2020 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #ifndef ASH_SHELF_TEST_WIDGET_ANIMATION_SMOOTHNESS_INSPECTOR_H_
- #define ASH_SHELF_TEST_WIDGET_ANIMATION_SMOOTHNESS_INSPECTOR_H_
- #include "ui/compositor/layer_animation_observer.h"
- namespace views {
- class Widget;
- }
- namespace ash {
- // TOOD(manucornet): This class will perform its intended purpose only after
- // the new API for layer aimation sequence observers lands.
- class WidgetAnimationSmoothnessInspector : ui::LayerAnimationObserver {
- public:
- explicit WidgetAnimationSmoothnessInspector(views::Widget* widget);
- ~WidgetAnimationSmoothnessInspector() override;
- // Returns whether the animation had at least |min_steps| steps (including
- // the initial and final steps), going smoothly from the initial state
- // to the final state.
- bool CheckAnimation(unsigned int min_steps) const;
- // ui::LayerAnimationObserver:
- void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override;
- void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override;
- void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) override;
- // TOOD(manucornet): Make this an override once the new API for layer
- // aimation sequence observers is in.
- void OnLayerAnimationProgressed(const ui::LayerAnimationSequence* sequence);
- private:
- // Unowned
- views::Widget* widget_;
- std::vector<gfx::Rect> bound_history_;
- };
- } // namespace ash
- #endif // ASH_SHELF_TEST_WIDGET_ANIMATION_SMOOTHNESS_INSPECTOR_H_
|