#include "chrome/browser/metrics/tab_stats/tab_stats_tracker.h"
#include <algorithm>
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/power_monitor_test.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_enums.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/common/pref_names.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/test_browser_window.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.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/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace metrics {
namespace {
TabsStats;
std::string GetHistogramNameWithBatteryStateSuffix(const char* histogram_name) { … }
class TestTabStatsObserver : public TabStatsObserver { … };
class TestTabStatsTracker : public TabStatsTracker { … };
class TestUmaStatsReportingDelegate
: public TestTabStatsTracker::UmaStatsReportingDelegate { … };
class TabStatsTrackerTest : public ChromeRenderViewHostTestHarness { … };
TestTabStatsTracker::TestTabStatsTracker(PrefService* pref_service)
: … { … }
bool CompareHistogramBucket(const base::Bucket& l, const base::Bucket& r) { … }
}
TEST_F(TabStatsTrackerTest, MainFrameCommittedNavigationTriggersUpdate) { … }
TEST_F(TabStatsTrackerTest, OnResume) { … }
TEST_F(TabStatsTrackerTest, StatsGetReportedDaily) { … }
TEST_F(TabStatsTrackerTest, DailyDiscards) { … }
TEST_F(TabStatsTrackerTest, HeartbeatMetrics) { … }
}