chromium/chrome/browser/metrics/usage_scenario/tab_usage_scenario_tracker_unittest.cc

// Copyright 2021 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/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 {};

// Inherit from ChromeRenderViewHostTestHarness for access to test profile.
class TabUsageScenarioTrackerTest : public ChromeRenderViewHostTestHarness {};

}  // namespace

TEST_F(TabUsageScenarioTrackerTest, NewVisibleTabMeansOneVisibleWindow) {}

TEST_F(TabUsageScenarioTrackerTest, VisibilityUpdateOnVisibleWindowIsNoop) {}

TEST_F(TabUsageScenarioTrackerTest, HidingWebContentsMakesWindowInvisible) {}

TEST_F(TabUsageScenarioTrackerTest, TrackingOfVisibleWebContents) {}

TEST_F(TabUsageScenarioTrackerTest, TrackingOfOccludedWebContents) {}

TEST_F(TabUsageScenarioTrackerTest, FullScreenVideoSingleMonitor) {}

// Regression test for crbug.com/1273251.
TEST_F(TabUsageScenarioTrackerTest,
       FullScreenVideoSingleMonitor_StopPlayingWithTwoMonitors) {}

// Regression test for crbug.com/341488142.
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) {}

}  // namespace metrics