chromium/chrome/browser/ui/tabs/organization/tab_organization_service_unittest.cc

// Copyright 2023 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/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[] =;

}  // anonymous namespace

class TabOrganizationServiceTest : public BrowserWithTestWindowTest {};

class MockTabOrganizationObserver : public TabOrganizationObserver {};

// Service Factory tests.

TEST_F(TabOrganizationServiceTest, DifferentSessionPerProfile) {}

TEST_F(TabOrganizationServiceTest, NoIncognito) {}

// Service tests.

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

// Session Creation Tests
TEST_F(TabOrganizationServiceTest, CreateSessionForBrowserOnTab) {}

// The signin flow is not used on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(TabOrganizationServiceTest, CanStartRequest) {}
#endif  // !BUILDFLAG(IS_CHROMEOS)

TEST_F(TabOrganizationServiceTest, TabStripAddRemoveDestroysSession) {}

TEST_F(TabOrganizationServiceTest, TabGroupAddDestroysSession) {}

TEST_F(TabOrganizationServiceTest,
       RemoveAllTabsWhileMultiplePendingOrganizationsDoesntCrash) {}