chromium/ui/views/animation/bubble_slide_animator_unittest.cc

// Copyright 2021 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/bubble_slide_animator.h"

#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/animation/animation_test_api.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/flex_layout_view.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"

namespace views {

namespace {

constexpr base::TimeDelta kSlideDuration =;
constexpr base::TimeDelta kHalfSlideDuration =;

// This will be the size of the three horizontally-oriented anchor views as well
// as the target size for the floating view.
constexpr gfx::Size kTestViewSize(100, 100);
// Make this big enough that even if we anchor to a third view horizontally, no
// mirroring should happen.
constexpr gfx::Rect kAnchorWidgetRect(50, 50, 400, 250);

class TestBubbleView : public BubbleDialogDelegateView {};

class TestBubbleSlideAnimator : public BubbleSlideAnimator {};

}  // namespace

class BubbleSlideAnimatorTest : public test::WidgetTest {};

TEST_F(BubbleSlideAnimatorTest, InitiateSlide) {}

TEST_F(BubbleSlideAnimatorTest, SlideProgresses) {}

TEST_F(BubbleSlideAnimatorTest, SnapToAnchorView) {}

TEST_F(BubbleSlideAnimatorTest, SlideCallbacksCalled) {}

TEST_F(BubbleSlideAnimatorTest, SnapCallbacksCalled) {}

TEST_F(BubbleSlideAnimatorTest, InterruptingWithSlideCallsCorrectCallbacks) {}

TEST_F(BubbleSlideAnimatorTest, InterruptingWithSnapCallsCorrectCallbacks) {}

TEST_F(BubbleSlideAnimatorTest, CancelAnimation) {}

TEST_F(BubbleSlideAnimatorTest, MultipleSlidesInSequence) {}

TEST_F(BubbleSlideAnimatorTest, SlideBackToStartingPosition) {}

TEST_F(BubbleSlideAnimatorTest, InterruptingSlide) {}

TEST_F(BubbleSlideAnimatorTest, WidgetClosedDuringSlide) {}

TEST_F(BubbleSlideAnimatorTest, AnimatorDestroyedDuringSlide) {}

TEST_F(BubbleSlideAnimatorTest, AnimationSetsAnchorView) {}

TEST_F(BubbleSlideAnimatorTest, SnapSetsAnchorView) {}

TEST_F(BubbleSlideAnimatorTest, CancelDoesntSetAnchorView) {}

}  // namespace views