chromium/chrome/browser/ui/views/tabs/tab_strip_scroll_session_unittest.cc

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

#include "chrome/browser/ui/views/tabs/tab_strip_scroll_session.h"

#include <memory>

#include "base/test/scoped_feature_list.h"
#include "base/timer/mock_timer.h"
#include "chrome/browser/ui/tabs/features.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
#include "chrome/test/views/chrome_views_test_base.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/view.h"

_;
AtLeast;
DoAll;
Return;
SaveArg;

// Mock class for scroll_manager
class MockTabDragWithScrollManager : public TabDragWithScrollManager {};

class TabStripScrollSessionWithTimerTestBase : public ChromeViewsTestBase {};

class TabStripScrollSessionTestWithConstantSpeed
    : public TabStripScrollSessionWithTimerTestBase {};

// When the tab scroll direction is `kNoScroll` then do not start the scroll
// session
TEST_F(TabStripScrollSessionTestWithConstantSpeed,
       GivenNoScrollWhenScrollSessionMaybeStartThenTimerDoesNotRun) {}

// If there is no attached context to the `drag_controller_`, then do not run
// the timer.
TEST_F(TabStripScrollSessionTestWithConstantSpeed,
       GivenNoAttachedContextWhenScrollSessionMaybeStartThenTimerDoesNotRun) {}

// When scroll session starts with correct arguments, timer callback is invoked
TEST_F(TabStripScrollSessionTestWithConstantSpeed,
       GivenScrollSessionWhenMaybeStartThenTimerCallback) {}

// When scroll is started with one direction but in the callback check,
// the direction calculation is different, stop the timer.
TEST_F(TabStripScrollSessionTestWithConstantSpeed,
       GivenScrollingTowardsRightWhenShouldScrollToLeftThenStopTimer) {}

class TabStripScrollSessionTestWithVariableSpeed
    : public TabStripScrollSessionWithTimerTestBase {};

// When scroll session starts with correct arguments, timer callback is invoked
TEST_F(TabStripScrollSessionTestWithVariableSpeed,
       GivenScrollSessionWhenMaybeStartThenTimerCallback) {}