chromium/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar_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/bookmarks/saved_tab_groups/saved_tab_group_bar.h"

#include <memory>
#include <optional>

#include "base/test/scoped_feature_list.h"
#include "base/uuid.h"
#include "chrome/browser/tab_group_sync/tab_group_sync_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_button.h"
#include "chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_overflow_button.h"
#include "chrome/browser/ui/views/frame/test_with_browser_view.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/test_browser_window.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/views/chrome_views_test_base.h"
#include "components/saved_tab_groups/features.h"
#include "components/saved_tab_groups/saved_tab_group_test_utils.h"
#include "components/saved_tab_groups/tab_group_sync_service.h"
#include "components/saved_tab_groups/types.h"
#include "components/tab_groups/tab_group_id.h"
#include "components/tab_groups/tab_group_visual_data.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/view_utils.h"

namespace tab_groups {
namespace {
const std::u16string kNewTitle(u"kNewTitle");

const tab_groups::TabGroupColorId kNewColor =;
}  // anonymous namespace

class SavedTabGroupBarUnitTest : public TestWithBrowserView,
                                 public ::testing::WithParamInterface<bool> {};

class STGEverythingMenuUnitTest : public SavedTabGroupBarUnitTest {};

TEST_P(STGEverythingMenuUnitTest, TabGroupItemsSortedByCreationTime) {}

TEST_P(SavedTabGroupBarUnitTest, AddsButtonFromModelAdd) {}

TEST_P(SavedTabGroupBarUnitTest, EverthingButtonAlwaysVisibleForV2) {}

TEST_P(SavedTabGroupBarUnitTest, OverflowMenuVisibleWhenFifthButtonAdded) {}

// Verifies that when a 5th saved group is removed, the overflow menu is not
// visible.
TEST_P(SavedTabGroupBarUnitTest, OverflowMenuHiddenWhenFifthButtonRemoved) {}

// Verifies that when a 5th saved group is added and the first group is removed,
// the overflow menu is not visible and the 5th button is visible.
TEST_P(SavedTabGroupBarUnitTest, OverflowMenuHiddenWhenFirstButtonRemoved) {}

TEST_P(SavedTabGroupBarUnitTest, BarsWithSameModelsHaveSameButtons) {}

TEST_P(SavedTabGroupBarUnitTest, RemoveButtonFromModelRemove) {}

TEST_P(SavedTabGroupBarUnitTest, UpdatedVisualDataMakesChangeToSpecificView) {}

TEST_P(SavedTabGroupBarUnitTest, MoveButtonFromModelMove) {}

// If the restriction is exactly the expected size all should be visible
TEST_P(SavedTabGroupBarUnitTest, CalculatePreferredWidthRestrictedByExactSize) {}

// If the restriction is more than the expected size all should be visible
TEST_P(SavedTabGroupBarUnitTest,
       CalculatePreferredWidthRestrictedByLargerSize) {}

// If the restriction is 1 less than the size the last button should not be
// visible, and second to last should be visible.
TEST_P(SavedTabGroupBarUnitTest,
       CalculatePreferredWidthRestrictedBySmallerSize) {}

// Verify add pinned tab group will add a button.
TEST_P(SavedTabGroupBarUnitTest, AddPinnedTabGroupButton) {}

// Verify pin an existing tab group will add a button.
TEST_P(SavedTabGroupBarUnitTest, PinTabGroupAddButton) {}

// Verify unpin an existing tab group will remove a button.
TEST_P(SavedTabGroupBarUnitTest, UnpinTabGroupRemoveButton) {}

TEST_P(SavedTabGroupBarUnitTest, PinAndUnpinMultipleTabGroups) {}

TEST_P(SavedTabGroupBarUnitTest, OnlyShowEverthingButtonForV2) {}

TEST_P(SavedTabGroupBarUnitTest, AccessibleProperties) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

}  // namespace tab_groups