#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h"
#include <memory>
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/tab_group_sync/tab_group_sync_tab_state.h"
#include "chrome/browser/tab_group_sync/tab_group_sync_utils.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_web_contents_listener.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_profile.h"
#include "components/saved_tab_groups/features.h"
#include "components/saved_tab_groups/types.h"
#include "components/saved_tab_groups/utils.h"
#include "components/sync_device_info/fake_device_info_tracker.h"
#include "components/tab_groups/tab_group_color.h"
#include "components/tab_groups/tab_group_id.h"
#include "components/tab_groups/tab_group_visual_data.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/ui_base_types.h"
namespace tab_groups {
class SavedTabGroupKeyedServiceUnitTest : public BrowserWithTestWindowTest { … };
TEST_F(SavedTabGroupKeyedServiceUnitTest, GetBrowserWithTabGroupId) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
UngroupingStopsListeningToWebContents) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, AddedTabIsListenedTo) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, PauseResumeTracking) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, ResumeTrackingValidatesConsistency) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, AlreadyOpenedGroupIsFocused) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
ActiveTabInAlreadyOpenedGroupIsFocused) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
RestoredGroupWithoutSavedGuidIsDiscarded) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
KeyedServiceLinksTabIdsToGuidsWhenModelIsLoaded) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
KeyedServiceUpdatesOpenTabGroupOnSyncUpdates) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
KeyedServiceUpdatesRestoredGroupWithOneLessTabToMatchSavedGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
KeyedServiceUpdatesRestoredGroupWithExtraTabToMatchSavedGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, NewTabFromSyncOpensInLocalGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
NavigateTabFromSyncNavigatesLocalTab) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, SimulateLocalThenSyncTabNavigations) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, SimulateSyncThenLocalTabNavigations) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, RemoveTabFromSyncRemovesLocalTab) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
RemoveLastTabFromSyncRemovesLocalTabAndLocalGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
RemoveGroupFromSyncRemovesLocalTabAndLocalGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
ReorderTabLocallyUpdatesSavedTabGroupTabOrder) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, ReorderTabFromSyncReordersLocalTab) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
DiscardingATabDoesntCrashWhenReordering) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
NewBadTabFromSyncOpensInLocalGroupOnNewTabPage) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
NavigateTabFromSyncWithBadURLDoesntNavigateLocalTab) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, AddedBadTabIsNTPInstead) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
TabLocalNavigationToBadURLDoesntUpdateModel) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
RedirectAfterDeleteRequestDoesntUpdateModel) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, SaveGroupIsPinned) { … }
class SavedTabGroupKeyedServiceUnitTestV2 : public BrowserWithTestWindowTest { … };
TEST_F(SavedTabGroupKeyedServiceUnitTestV2, LastTabRemoveFromSyncClosesGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTestV2,
GroupRemovedFromSyncClosesOpenGroup) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, CreateTabStateOnSyncNavigations) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, TabStateClearedOnUserInput) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest,
TabStateNotClearedOnForwardBackwardNavigations) { … }
TEST_F(SavedTabGroupKeyedServiceUnitTest, TabStateNotClearedOnReload) { … }
}