chromium/chrome/browser/ui/tabs/organization/tab_organization_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.h"

#include <memory>
#include <string>

#include "base/functional/bind.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/ui/tabs/organization/logging_util.h"
#include "chrome/browser/ui/tabs/organization/metrics.h"
#include "chrome/browser/ui/tabs/organization/tab_data.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_request.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_session.h"
#include "chrome/browser/ui/tabs/tab_enums.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h"
#include "chrome/browser/ui/tabs/test_util.h"
#include "chrome/test/base/testing_profile.h"
#include "components/optimization_guide/core/model_quality/feature_type_map.h"
#include "components/optimization_guide/core/model_quality/model_quality_log_entry.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/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

int kMinimumValidTabs =;

class FakeModelQualityLogEntry
    : public optimization_guide::ModelQualityLogEntry {};

}  // anonymous namespace

class TabOrganizationTest : public testing::Test {};

class SessionObserver : public TabOrganizationSession::Observer {};

// TabData tests.

// The constructor that takes the webcontents and tabstrip model should
// instantiate correctly.
TEST_F(TabOrganizationTest, TabDataTabStripModelConstructor) {}

// Check that TabData isn't updated when the tabstrip updates.
TEST_F(TabOrganizationTest, TabDataTabStripTabUpdatingURL) {}

TEST_F(TabOrganizationTest, TabDataOnTabStripModelDestroyed) {}

TEST_F(TabOrganizationTest, TabDataOnDestroyWebContentsSetToNull) {}

TEST_F(TabOrganizationTest, TabDataOnDestroyWebContentsReplaceUpdatesContents) {}

TEST_F(TabOrganizationTest, TabDataURLChangeIsNotValidForOrganizing) {}

TEST_F(TabOrganizationTest, TabDataWebContentsDeletionIsNotValidForOrganizing) {}

TEST_F(TabOrganizationTest, TabDataObserverTest) {}

TEST_F(TabOrganizationTest, TabDataHttpHttpsOnlyURLs) {}

TEST_F(TabOrganizationTest, TabDataPinnedTabsNotValid) {}

// TabOrganization tests.

TEST_F(TabOrganizationTest, TabOrganizationIDs) {}

TEST_F(TabOrganizationTest, TabOrganizationAddingTabData) {}

TEST_F(TabOrganizationTest, TabOrganizationRemovingTabData) {}

TEST_F(TabOrganizationTest, TabOrganizationChangingCurrentName) {}

TEST_F(TabOrganizationTest, TabOrganizationReject) {}

TEST_F(TabOrganizationTest, TabOrganizationCHECKOnChangingUserChoiceTwice) {}

TEST_F(TabOrganizationTest, TabOrganizationIsValidForOrganizing) {}

TEST_F(TabOrganizationTest, TabOrganizationNoUniqueTabDatas) {}

TEST_F(TabOrganizationTest, TabOrganizationAcceptCreatesGroupToLeft) {}

TEST_F(TabOrganizationTest,
       TabOrganizationAcceptCreatesGroupToRightOfPinnedAndGrouped) {}

// TabOrganizationRequest tests.

TEST_F(TabOrganizationTest, TabOrganizationRequestOnStartRequest) {}

TEST_F(TabOrganizationTest,
       TabOrganizationRequestCHECKOnStartingFromStartedState) {}

TEST_F(TabOrganizationTest, TabOrganizationRequestOnCompleteRequest) {}

TEST_F(TabOrganizationTest, TabOrganizationRequestOnFailRequest) {}

TEST_F(TabOrganizationTest, TabOrganizationRequestOnCancelRequest) {}

TEST_F(TabOrganizationTest, TabOrganizationObserverTest) {}

TEST_F(TabOrganizationTest, TabOrganizationForceInvalidation) {}

// TabOrganizationSession Tests.

TEST_F(TabOrganizationTest, TabOrganizationSessionIDs) {}

TEST_F(TabOrganizationTest,
       TabOrganizationSessionDestructionCancelsRequestIfStarted) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionGetNextTabOrganization) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionInvalidOrganizations) {}

TEST_F(TabOrganizationTest,
       TabOrganizationSessionGetNextTabOrganizationAfterAccept) {}

TEST_F(TabOrganizationTest,
       TabOrganizationSessionGetNextTabOrganizationAfterReject) {}

TEST_F(TabOrganizationTest,
       SessionPopulateOrganizationsFromRequestSetsOrganizationID) {}

TEST_F(TabOrganizationTest,
       TabOrganizationSessionPopulateOrganizationsInvalidTabNotFilled) {}

TEST_F(TabOrganizationTest,
       TabOrganizationSessionPopulateOrganizationsMissingTabIDNotFilled) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionCreation) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionObserverFail) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionObserverCompleteRequest) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionObserverOrganizationUpdate) {}

TEST_F(TabOrganizationTest, TabOrganizationSessionRequestOnLogResultsCalled) {}

// Logging Util

TEST_F(TabOrganizationTest, LoggingUtilAddOrganizationsToModelQuality) {}

TEST_F(TabOrganizationTest, LoggingUtilAddOrganizationsToModelQualityAccepted) {}

TEST_F(TabOrganizationTest, HistogramLogNoOrganization) {}

TEST_F(TabOrganizationTest, HistogramLogNoChoiceOrganization) {}

TEST_F(TabOrganizationTest, HistogramLogRejectOrganization) {}

TEST_F(TabOrganizationTest, HistogramLogAcceptOrganizationNoEntrypoint) {}

TEST_F(TabOrganizationTest,
       HistogramLogAcceptOrganizationTabContextMenuEntryPoint) {}

TEST_F(TabOrganizationTest,
       HistogramLogRejectOrganizationThreeDotMenuEntryPoint) {}

TEST_F(TabOrganizationTest,
       HistogramLogNoChoiceOrganizationProactiveEntryPoint) {}