#include "cc/animation/scroll_timeline.h"
#include <limits>
#include <vector>
#include "cc/trees/property_tree.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/point_f.h"
namespace cc {
namespace {
static constexpr double time_error_ms = …;
#define EXPECT_SCROLL_TIMELINE_TIME_NEAR(expected, value) …
#define EXPECT_SCROLL_TIMELINE_BEFORE_START(value) …
#define EXPECT_SCROLL_TIMELINE_AFTER_END(value, duration) …
void SetScrollOffset(PropertyTrees* property_trees,
ElementId scroller_id,
gfx::PointF offset) { … }
void CreateScrollingElement(PropertyTrees* property_trees,
ElementId scroller_id,
gfx::Size content_size,
gfx::Size container_size) { … }
base::TimeTicks CalculateCurrentTime(double current_scroll_offset,
double start_scroll_offset) { … }
double ToDouble(std::optional<base::TimeTicks> time_ticks) { … }
}
class ScrollTimelineTest : public ::testing::Test,
public ProtectedSequenceSynchronizer { … };
TEST_F(ScrollTimelineTest, BasicCurrentTimeCalculations) { … }
TEST_F(ScrollTimelineTest, ActiveTimeIsSetOnlyAfterPromotion) { … }
TEST_F(ScrollTimelineTest, CurrentTimeIsAdjustedForPixelSnapping) { … }
TEST_F(ScrollTimelineTest, CurrentTimeHandlesStartScrollOffset) { … }
TEST_F(ScrollTimelineTest, CurrentTimeHandlesEndScrollOffset) { … }
TEST_F(ScrollTimelineTest, CurrentTimeHandlesCombinedStartAndEndScrollOffset) { … }
TEST_F(ScrollTimelineTest,
DISABLED_CurrentTimeHandlesEqualStartAndEndScrollOffset) { … }
TEST_F(ScrollTimelineTest,
DISABLED_CurrentTimeHandlesStartOffsetLargerThanEndScrollOffset) { … }
TEST_F(ScrollTimelineTest, CurrentTimeHandlesScrollOffsets) { … }
TEST_F(ScrollTimelineTest, Activeness) { … }
}