#include "chrome/browser/ui/tabs/organization/tab_organization_service.h"
#include <memory>
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_observer.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_session.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_utils.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_profile.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "tab_organization_service_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/ui_base_features.h"
namespace {
constexpr char kValidURL[] = …;
constexpr char kInvalidURL[] = …;
}
class TabOrganizationServiceTest : public BrowserWithTestWindowTest { … };
class MockTabOrganizationObserver : public TabOrganizationObserver { … };
TEST_F(TabOrganizationServiceTest, DifferentSessionPerProfile) { … }
TEST_F(TabOrganizationServiceTest, NoIncognito) { … }
TEST_F(TabOrganizationServiceTest, DoesntAddSessionOnTriggerIfExists) { … }
TEST_F(TabOrganizationServiceTest, EachBrowserHasADistinctSession) { … }
TEST_F(TabOrganizationServiceTest, ObserverShowTriggerUICalled) { … }
TEST_F(TabOrganizationServiceTest, SessionFromBrowserPopulatesRequest) { … }
TEST_F(TabOrganizationServiceTest,
TabOrganizationSessionCreateSessionForBrowserNoInvalidTabDatas) { … }
TEST_F(TabOrganizationServiceTest,
TabOrganizationSessionResetSessionForBrowser) { … }
TEST_F(TabOrganizationServiceTest, SecondRequestAfterCompletionDoesntCrash) { … }
TEST_F(TabOrganizationServiceTest, SecondRequestAfterStartingDoesntCrash) { … }
TEST_F(TabOrganizationServiceTest, CreateSessionForBrowserOnTab) { … }
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(TabOrganizationServiceTest, CanStartRequest) { … }
#endif
TEST_F(TabOrganizationServiceTest, TabStripAddRemoveDestroysSession) { … }
TEST_F(TabOrganizationServiceTest, TabGroupAddDestroysSession) { … }
TEST_F(TabOrganizationServiceTest,
RemoveAllTabsWhileMultiplePendingOrganizationsDoesntCrash) { … }