#include "chrome/browser/metrics/usage_scenario/tab_usage_scenario_tracker.h"
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/ukm/content/source_url_recorder.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/visibility.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/web_contents_tester.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace metrics {
namespace {
constexpr base::TimeDelta kInterval = …;
class MockTabUsageScenarioTracker : public TabUsageScenarioTracker { … };
class TabUsageScenarioTrackerTest : public ChromeRenderViewHostTestHarness { … };
}
TEST_F(TabUsageScenarioTrackerTest, NewVisibleTabMeansOneVisibleWindow) { … }
TEST_F(TabUsageScenarioTrackerTest, VisibilityUpdateOnVisibleWindowIsNoop) { … }
TEST_F(TabUsageScenarioTrackerTest, HidingWebContentsMakesWindowInvisible) { … }
TEST_F(TabUsageScenarioTrackerTest, TrackingOfVisibleWebContents) { … }
TEST_F(TabUsageScenarioTrackerTest, TrackingOfOccludedWebContents) { … }
TEST_F(TabUsageScenarioTrackerTest, FullScreenVideoSingleMonitor) { … }
TEST_F(TabUsageScenarioTrackerTest,
FullScreenVideoSingleMonitor_StopPlayingWithTwoMonitors) { … }
TEST_F(TabUsageScenarioTrackerTest,
FullScreenVideoSingleMonitor_NumDisplaysChangeWithoutNotification) { … }
TEST_F(TabUsageScenarioTrackerTest, VideoInVisibleTab) { … }
TEST_F(TabUsageScenarioTrackerTest, VisibleTabPlayingVideoRemoved) { … }
TEST_F(TabUsageScenarioTrackerTest, TabPlayingAudio) { … }
TEST_F(TabUsageScenarioTrackerTest, UKMVisibility1tab) { … }
TEST_F(TabUsageScenarioTrackerTest, UKMVisibility1tabLateNavigation) { … }
TEST_F(TabUsageScenarioTrackerTest, UKMVisibilityMultipleTabs) { … }
TEST_F(TabUsageScenarioTrackerTest, UKMVisibilityMultipleVisibilityEvents) { … }
TEST_F(TabUsageScenarioTrackerTest,
UKMVisibilityMultipleVisibleTabsSameOrigin) { … }
}