// Copyright 2011 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "base/run_loop.h" #include "base/test/task_environment.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/animation/test_animation_delegate.h" #include "ui/gfx/switches.h" #if BUILDFLAG(IS_WIN) #include <windows.h> #endif namespace gfx { class AnimationTest : public testing::Test { … }; namespace { /////////////////////////////////////////////////////////////////////////////// // RunAnimation class RunAnimation : public LinearAnimation { … }; /////////////////////////////////////////////////////////////////////////////// // CancelAnimation class CancelAnimation : public LinearAnimation { … }; /////////////////////////////////////////////////////////////////////////////// // EndAnimation class EndAnimation : public LinearAnimation { … }; /////////////////////////////////////////////////////////////////////////////// // DeletingAnimationDelegate // AnimationDelegate implementation that deletes the animation in ended. class DeletingAnimationDelegate : public TestAnimationDelegate { … }; } // namespace /////////////////////////////////////////////////////////////////////////////// // LinearCase TEST_F(AnimationTest, RunCase) { … } TEST_F(AnimationTest, CancelCase) { … } // Lets an animation run, invoking End part way through and make sure we get the // right delegate methods invoked. TEST_F(AnimationTest, EndCase) { … } // Runs an animation with a delegate that deletes the animation in end. TEST_F(AnimationTest, DeleteFromEnd) { … } TEST_F(AnimationTest, ShouldRenderRichAnimation) { … } // Test that current value is always 0 after Start() is called. TEST_F(AnimationTest, StartState) { … } /////////////////////////////////////////////////////////////////////////////// // PrefersReducedMotion tests TEST_F(AnimationTest, PrefersReducedMotionRespectsOverrideFlag) { … } } // namespace gfx