#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 { … };
}
class TabOrganizationTest : public testing::Test { … };
class SessionObserver : public TabOrganizationSession::Observer { … };
TEST_F(TabOrganizationTest, TabDataTabStripModelConstructor) { … }
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) { … }
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) { … }
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) { … }
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) { … }
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) { … }