chromium/third_party/blink/renderer/core/animation/scroll_timeline_test.cc

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

#include "third_party/blink/renderer/core/animation/scroll_timeline.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_scroll_timeline_options.h"
#include "third_party/blink/renderer/core/animation/animation_clock.h"
#include "third_party/blink/renderer/core/animation/animation_test_helpers.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/animation/keyframe_effect.h"
#include "third_party/blink/renderer/core/animation/keyframe_effect_model.h"
#include "third_party/blink/renderer/core/animation/pending_animations.h"
#include "third_party/blink/renderer/core/animation/timing_calculations.h"
#include "third_party/blink/renderer/core/animation/view_timeline.h"
#include "third_party/blink/renderer/core/css/css_numeric_literal_value.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/dom/dom_token_list.h"
#include "third_party/blink/renderer/core/dom/events/native_event_listener.h"
#include "third_party/blink/renderer/core/page/page_animator.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"

namespace blink {

namespace {

static constexpr double percent_precision =;

#define EXPECT_CURRENT_TIME_AS_PERCENT_NEAR(expected, animation)

Animation* CreateTestAnimation(AnimationTimeline* timeline) {}

Animation* CreateCompositableTestAnimation(Element* target,
                                           AnimationTimeline* timeline) {}

}  // namespace

class ScrollTimelineTest : public RenderingTest {};

class TestScrollTimeline : public ScrollTimeline {};

class TestViewTimeline : public ViewTimeline {};

class TestDeferredTimeline : public DeferredTimeline {};

TEST_F(ScrollTimelineTest, CurrentTimeIsNullIfSourceIsNotScrollable) {}

TEST_F(ScrollTimelineTest,
       UsingDocumentScrollingElementShouldCorrectlyResolveToDocument) {}

TEST_F(ScrollTimelineTest,
       ChangingDocumentScrollingElementShouldNotImpactScrollTimeline) {}

TEST_F(ScrollTimelineTest, AttachOrDetachAnimationWithNullSource) {}

TEST_F(ScrollTimelineTest, AnimationIsGarbageCollectedWhenScrollerIsRemoved) {}

TEST_F(ScrollTimelineTest, AnimationPersistsWhenFinished) {}

TEST_F(ScrollTimelineTest, AnimationPersistsWhenSourceBecomesNonScrollable) {}

TEST_F(ScrollTimelineTest, ScheduleFrameOnlyWhenScrollOffsetChanges) {}

// This test verifies scenario when scroll timeline is updated as a result of
// layout run. In this case the expectation is that at the end of paint
// lifecycle phase scroll timeline schedules a new frame that runs animations
// update.
TEST_F(ScrollTimelineTest, ScheduleFrameWhenScrollerLayoutChanges) {}

TEST_F(ScrollTimelineTest,
       TimelineInvalidationWhenScrollerDisplayPropertyChanges) {}

// Verify that scroll timeline current time is updated once upon construction
// and at the top of every animation frame.
TEST_F(ScrollTimelineTest, CurrentTimeUpdateAfterNewAnimationFrame) {}

TEST_F(ScrollTimelineTest, FinishedAnimationPlaysOnReversedScrolling) {}

TEST_F(ScrollTimelineTest, CancelledAnimationDetachedFromTimeline) {}

class AnimationEventListener final : public NativeEventListener {};

TEST_F(ScrollTimelineTest,
       FiringAnimationEventsByFinishedAnimationOnReversedScrolling) {}

TEST_F(ScrollTimelineTest, WeakReferences) {}

TEST_F(ScrollTimelineTest, WeakViewTimelines) {}

TEST_F(ScrollTimelineTest, ScrollTimelineOffsetZoom) {}

TEST_F(ScrollTimelineTest, ViewTimelineOffsetZoom) {}

TEST_F(ScrollTimelineTest, ScrollTimelineGetTimelineRange) {}

TEST_F(ScrollTimelineTest, ViewTimelineGetTimelineRange) {}

TEST_F(ScrollTimelineTest, ScrollTimelineCalculateIntrinsicIterationDuration) {}

TEST_F(ScrollTimelineTest, CompositedDeferredTimelineReattachment) {}

}  //  namespace blink