#include "cc/input/browser_controls_offset_manager.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <memory>
#include "base/time/time.h"
#include "cc/input/browser_controls_offset_manager_client.h"
#include "cc/layers/layer_impl.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/vector2d_f.h"
namespace cc {
namespace {
class MockBrowserControlsOffsetManagerClient
: public BrowserControlsOffsetManagerClient { … };
TEST(BrowserControlsOffsetManagerTest, EnsureScrollThresholdApplied) { … }
TEST(BrowserControlsOffsetManagerTest,
EnsureScrollThresholdAppliedWithMinHeight) { … }
TEST(BrowserControlsOffsetManagerTest, PartialShownHideAnimation) { … }
TEST(BrowserControlsOffsetManagerTest,
BottomControlsPartialShownHideAnimation) { … }
TEST(BrowserControlsOffsetManagerTest, PartialShownShowAnimation) { … }
TEST(BrowserControlsOffsetManagerTest,
BottomControlsPartialShownShowAnimation) { … }
TEST(BrowserControlsOffsetManagerTest,
PartialHiddenWithAmbiguousThresholdShows) { … }
TEST(BrowserControlsOffsetManagerTest,
PartialHiddenWithAmbiguousThresholdHides) { … }
TEST(BrowserControlsOffsetManagerTest,
PartialShownWithAmbiguousThresholdHides) { … }
TEST(BrowserControlsOffsetManagerTest,
PartialShownWithAmbiguousThresholdShows) { … }
TEST(BrowserControlsOffsetManagerTest, PinchIgnoresScroll) { … }
TEST(BrowserControlsOffsetManagerTest, PinchBeginStartsAnimationIfNecessary) { … }
TEST(BrowserControlsOffsetManagerTest, HeightIncreaseWhenFullyShownAnimation) { … }
TEST(BrowserControlsOffsetManagerTest, HeightDecreaseWhenFullyShownAnimation) { … }
TEST(BrowserControlsOffsetManagerTest, MinHeightIncreaseWhenHiddenAnimation) { … }
TEST(BrowserControlsOffsetManagerTest,
MinHeightSetToZeroWhenAtMinHeightAnimation) { … }
TEST(BrowserControlsOffsetManagerTest, EnsureNoAnimationCases) { … }
TEST(BrowserControlsOffsetManagerTest,
HeightChangeAnimationJumpsToEndOnScroll) { … }
TEST(BrowserControlsOffsetManagerTest,
HeightChangeMaintainsFullyVisibleControls) { … }
TEST(BrowserControlsOffsetManagerTest,
ShrinkingHeightKeepsBrowserControlsHidden) { … }
TEST(BrowserControlsOffsetManagerTest,
HeightChangeWithAnimateFalseDoesNotTriggerAnimation) { … }
TEST(BrowserControlsOffsetManagerTest,
MinHeightChangeWithAnimateFalseSnapsToNewMinHeight) { … }
TEST(BrowserControlsOffsetManagerTest, ControlsStayAtMinHeightOnHeightChange) { … }
TEST(BrowserControlsOffsetManagerTest, ControlsAdjustToNewHeight) { … }
TEST(BrowserControlsOffsetManagerTest, ScrollByWithZeroHeightControlsIsNoop) { … }
TEST(BrowserControlsOffsetManagerTest, ScrollThenRestoreBottomControls) { … }
TEST(BrowserControlsOffsetManagerTest,
ScrollThenRestoreBottomControlsNoTopControls) { … }
TEST(BrowserControlsOffsetManagerTest, HideAndPeekBottomControls) { … }
TEST(BrowserControlsOffsetManagerTest,
HideAndImmediateShowKeepsControlsVisible) { … }
TEST(BrowserControlsOffsetManagerTest,
ScrollWithMinHeightSetForTopControlsOnly) { … }
TEST(BrowserControlsOffsetManagerTest, ScrollWithMinHeightSetForBothControls) { … }
TEST(BrowserControlsOffsetManagerTest, ChangingBottomHeightFromZeroAnimates) { … }
TEST(BrowserControlsOffsetManagerTest,
ChangingControlsHeightToZeroWithAnimationIsNoop) { … }
TEST(BrowserControlsOffsetManagerTest, OnlyExpandTopControlsAtPageTop) { … }
TEST(BrowserControlsOffsetManagerTest, MinHeightChangeUpdatesAnimation) { … }
TEST(BrowserControlsOffsetManagerTest,
ChangingTopMinHeightFromInitialZeroAnimatesCorrectly) { … }
TEST(BrowserControlsOffsetManagerTest,
ReducingTopHeightAndMinHeightAnimatesCorrectly) { … }
TEST(BrowserControlsOffsetManagerTest,
InterruptedShowAnimationsAreRestartedAfterScroll) { … }
TEST(BrowserControlsOffsetManagerTest,
ShowingControlsDuringScrollStartsAnimationAfterScroll) { … }
TEST(BrowserControlsOffsetManagerTest, MinHeightIncreasedByMoreThanHeight) { … }
}
}