chromium/components/performance_manager/user_tuning/tab_revisit_tracker_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 "components/performance_manager/public/user_tuning/tab_revisit_tracker.h"

#include <memory>

#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "components/performance_manager/public/decorators/page_live_state_decorator.h"
#include "components/performance_manager/public/graph/graph.h"
#include "components/performance_manager/public/graph/page_node.h"
#include "components/performance_manager/test_support/graph_test_harness.h"
#include "components/performance_manager/test_support/mock_graphs.h"
#include "components/ukm/test_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"

namespace performance_manager {

// Hard-coding these constants instead of using `static_cast` on the
// `TabRevisitTracker::State` enum to guard against changes to the enum that
// would make it out of sync with the enums.xml entry.
constexpr int64_t kActiveState =;
constexpr int64_t kBackgroundState =;
constexpr int64_t kClosedState =;
constexpr ukm::SourceId kValidSourceId =;

class TabRevisitTrackerTest : public GraphTestHarness {};

TEST_F(TabRevisitTrackerTest, StartsBackgroundedThenRevisited) {}

TEST_F(TabRevisitTrackerTest, CloseInBackgroundRecordsToCloseHistogram) {}

TEST_F(TabRevisitTrackerTest, CloseWhileActiveDoesntRecordClose) {}

TEST_F(TabRevisitTrackerTest, TestSwitchToDiscardedTab) {}

}  // namespace performance_manager