#include "ui/compositor/callback_layer_animation_observer.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/test/layer_animation_observer_test_api.h"
namespace ui {
namespace test {
class TestCallbacks { … };
TestCallbacks::TestCallbacks() { … }
TestCallbacks::~TestCallbacks() { … }
void TestCallbacks::ResetCallbackObservations() { … }
void TestCallbacks::AnimationsStarted(const CallbackLayerAnimationObserver&) { … }
bool TestCallbacks::AnimationsEnded(const CallbackLayerAnimationObserver&) { … }
testing::AssertionResult TestCallbacks::StartedEpochIsBeforeEndedEpoch() { … }
class TestCallbacksThatExplicitlyDeletesObserver : public TestCallbacks { … };
TestCallbacksThatExplicitlyDeletesObserver::
TestCallbacksThatExplicitlyDeletesObserver() { … }
void TestCallbacksThatExplicitlyDeletesObserver::AnimationsStarted(
const CallbackLayerAnimationObserver& observer) { … }
bool TestCallbacksThatExplicitlyDeletesObserver::AnimationsEnded(
const CallbackLayerAnimationObserver& observer) { … }
class TestCallbackLayerAnimationObserver
: public CallbackLayerAnimationObserver { … };
TestCallbackLayerAnimationObserver::TestCallbackLayerAnimationObserver(
AnimationStartedCallback animation_started_callback,
AnimationEndedCallback animation_ended_callback,
bool* destroyed)
: … { … }
TestCallbackLayerAnimationObserver::TestCallbackLayerAnimationObserver(
AnimationStartedCallback animation_started_callback,
bool should_delete_observer,
bool* destroyed)
: … { … }
TestCallbackLayerAnimationObserver::TestCallbackLayerAnimationObserver(
AnimationEndedCallback animation_ended_callback,
bool* destroyed)
: … { … }
TestCallbackLayerAnimationObserver::~TestCallbackLayerAnimationObserver() { … }
class CallbackLayerAnimationObserverTest : public testing::Test { … };
CallbackLayerAnimationObserverTest::CallbackLayerAnimationObserverTest()
: … { … }
CallbackLayerAnimationObserverTest::~CallbackLayerAnimationObserverTest() { … }
LayerAnimationSequence*
CallbackLayerAnimationObserverTest::CreateLayerAnimationSequence() { … }
class CallbackLayerAnimationObserverTestOverwrite
: public CallbackLayerAnimationObserverTest { … };
CallbackLayerAnimationObserverTestOverwrite::
CallbackLayerAnimationObserverTestOverwrite() { … }
void CallbackLayerAnimationObserverTestOverwrite::AnimationStarted(
const CallbackLayerAnimationObserver& observer) { … }
std::unique_ptr<CallbackLayerAnimationObserver>
CallbackLayerAnimationObserverTestOverwrite::CreateAnimationObserver() { … }
TEST(CallbackLayerAnimationObserverDestructionTest, VerifyFalseAutoDelete) { … }
TEST(CallbackLayerAnimationObserverDestructionTest, VerifyTrueAutoDelete) { … }
TEST(CallbackLayerAnimationObserverDestructionTest,
AnimationEndedReturnsFalse) { … }
TEST(CallbackLayerAnimationObserverDestructionTest, AnimationEndedReturnsTrue) { … }
TEST_F(CallbackLayerAnimationObserverTestOverwrite,
VerifyOverwriteOnAnimationStart) { … }
TEST_F(CallbackLayerAnimationObserverTest, VerifyInitialState) { … }
TEST_F(
CallbackLayerAnimationObserverTest,
ExplicitlyDeleteObserverInAnimationStartedCallbackWithNoSequencesAttached) { … }
TEST_F(CallbackLayerAnimationObserverTest,
ExplicitlyDeleteObserverInAnimationStartedCallbackSequencesDetached) { … }
TEST_F(
CallbackLayerAnimationObserverTest,
ExplicitlyDeleteObserverInAnimationStartedCallbackWithSomeSequencesAttached) { … }
TEST_F(CallbackLayerAnimationObserverTest,
IgnoreTrueReturnValueForAnimationEndedCallbackIfExplicitlyDeleted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveWhenNoSequencesWereAttached) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveWhenAllSequencesAreAttachedButNoneWereStarted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveWhenAllSequencesAreAttachedAndOnlySomeWereStarted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveWhenAllSequencesAreAttachedAndOnlySomeWereCompleted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveAfterAllSequencesWereStartedButNoneWereCompleted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveWhenAllSequencesAreStartedAndOnlySomeWereCompleted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveWhenAllSequencesWereCompleted) { … }
TEST_F(CallbackLayerAnimationObserverTest,
SetActiveAgainAfterAllSequencesWereCompleted) { … }
TEST_F(CallbackLayerAnimationObserverTest, DetachBeforeActive) { … }
TEST_F(CallbackLayerAnimationObserverTest, DetachAfterActive) { … }
}
}