chromium/cc/input/browser_controls_offset_manager_unittest.cc

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

#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) {}

// Tests that if the min-height changes while we're animating to the previous
// min-height, the animation gets updated to end at the new value.
TEST(BrowserControlsOffsetManagerTest, MinHeightChangeUpdatesAnimation) {}

// Tests that setting a top height and min-height with animation when both were
// 0 doesn't cause invalid |TopControlsMinHeightOffset| values.
// See: https://crbug.com/1184902.
TEST(BrowserControlsOffsetManagerTest,
     ChangingTopMinHeightFromInitialZeroAnimatesCorrectly) {}

// Tests that reducing both height and min-height with animation doesn't cause
// invalid |TopControlsMinHeightOffset| values.
TEST(BrowserControlsOffsetManagerTest,
     ReducingTopHeightAndMinHeightAnimatesCorrectly) {}

// Tests that a "show" animation that's interrupted by a scroll is restarted
// when the gesture completes.
TEST(BrowserControlsOffsetManagerTest,
     InterruptedShowAnimationsAreRestartedAfterScroll) {}

// If chrome tries to animate in browser controls during a scroll gesture, it
// should animate them in after the scroll completes.
TEST(BrowserControlsOffsetManagerTest,
     ShowingControlsDuringScrollStartsAnimationAfterScroll) {}

TEST(BrowserControlsOffsetManagerTest, MinHeightIncreasedByMoreThanHeight) {}

}  // namespace
}  // namespace cc