chromium/ui/views/animation/bounds_animator_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/animation/bounds_animator.h"

#include <algorithm>
#include <memory>
#include <utility>

#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/icu_test_util.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/animation/test_animation_delegate.h"
#include "ui/views/view.h"

Animation;
SlideAnimation;
TestAnimationDelegate;

namespace views {
namespace {

class OwnedDelegate : public gfx::AnimationDelegate {};

// static
bool OwnedDelegate::deleted_ =;
bool OwnedDelegate::canceled_ =;

class TestView : public View {};

BEGIN_METADATA()

class RTLAnimationTestDelegate : public gfx::AnimationDelegate {};

}  // namespace

class BoundsAnimatorTest : public testing::Test {};

// Checks animate view to.
TEST_F(BoundsAnimatorTest, AnimateViewTo) {}

// Make sure that removing/deleting a child view while animating stops the
// view's animation and will not result in a crash.
TEST_F(BoundsAnimatorTest, DeleteWhileAnimating) {}

// Make sure an AnimationDelegate is deleted when canceled.
TEST_F(BoundsAnimatorTest, DeleteDelegateOnCancel) {}

// Make sure that the AnimationDelegate of the running animation is deleted when
// a new animation is scheduled.
TEST_F(BoundsAnimatorTest, DeleteDelegateOnNewAnimate) {}

// Make sure that the duplicate animation request does not interrupt the running
// animation.
TEST_F(BoundsAnimatorTest, HandleDuplicateAnimation) {}

// Make sure that a duplicate animation request that specifies a different
// delegate swaps out that delegate.
TEST_F(BoundsAnimatorTest, DuplicateAnimationsCanReplaceDelegate) {}

// Makes sure StopAnimating works.
TEST_F(BoundsAnimatorTest, StopAnimating) {}

// Make sure Complete completes in-progress animations.
TEST_F(BoundsAnimatorTest, CompleteAnimation) {}

// Verify that transform is used when the animation target bounds have the
// same size with the current bounds' meanwhile having the transform option
// enabled.
TEST_F(BoundsAnimatorTest, UseTransformsAnimateViewTo) {}

// Verify that transform is not used when the animation target bounds have the
// different size from the current bounds' even if transform is preferred.
TEST_F(BoundsAnimatorTest, NoTransformForScalingAnimation) {}

// Tests that the transforms option does not crash when a view's bounds start
// off empty.
TEST_F(BoundsAnimatorTest, UseTransformsAnimateViewToEmptySrc) {}

// Tests that when using the transform option on the bounds animator, cancelling
// the animation part way results in the correct bounds applied.
TEST_F(BoundsAnimatorTest, UseTransformsCancelAnimation) {}

// Test that when using the transform option on the bounds animator, cancelling
// the animation part way under RTL results in the correct bounds applied.
TEST_F(BoundsAnimatorTest, UseTransformsCancelAnimationRTL) {}

// Verify that the bounds animation which updates the transform of views work
// as expected under RTL (https://crbug.com/1067033).
TEST_F(BoundsAnimatorTest, VerifyBoundsAnimatorUnderRTL) {}

}  // namespace views