chromium/content/browser/back_forward_cache_test_util.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/back_forward_cache_test_util.h"

#include "base/ranges/algorithm.h"
#include "content/common/content_navigation_policy.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace content {

namespace {

_;
Each;
ElementsAre;
Not;
UnorderedElementsAreArray;

void AddSampleToBuckets(std::vector<base::Bucket>* buckets,
                        base::HistogramBase::Sample sample) {}

}  // namespace

BackForwardCacheMetricsTestMatcher::BackForwardCacheMetricsTestMatcher() =
    default;
BackForwardCacheMetricsTestMatcher::~BackForwardCacheMetricsTestMatcher() =
    default;

void BackForwardCacheMetricsTestMatcher::DisableCheckingMetricsForAllSites() {}

void BackForwardCacheMetricsTestMatcher::ExpectOutcomeDidNotChange(
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectRestored(
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectNotRestored(
    std::vector<BackForwardCacheMetrics::NotRestoredReason> not_restored,
    std::vector<blink::scheduler::WebSchedulerTrackedFeature> block_listed,
    const std::vector<ShouldSwapBrowsingInstance>& not_swapped,
    const std::vector<BackForwardCache::DisabledReason>&
        disabled_for_render_frame_host,
    const std::vector<uint64_t>& disallow_activation,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectNotRestoredDidNotChange(
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectBlocklistedFeature(
    blink::scheduler::WebSchedulerTrackedFeature feature,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectBrowsingInstanceNotSwappedReason(
    ShouldSwapBrowsingInstance reason,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectEvictedAfterCommitted(
    std::vector<BackForwardCacheMetrics::EvictedAfterDocumentRestoredReason>
        reasons,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectOutcome(
    BackForwardCacheMetrics::HistoryNavigationOutcome outcome,
    std::vector<BackForwardCacheMetrics::NotRestoredReason> not_restored,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectReasons(
    std::vector<BackForwardCacheMetrics::NotRestoredReason> not_restored,
    std::vector<blink::scheduler::WebSchedulerTrackedFeature> block_listed,
    const std::vector<ShouldSwapBrowsingInstance>& not_swapped,
    const std::vector<BackForwardCache::DisabledReason>&
        disabled_for_render_frame_host,
    const std::vector<uint64_t>& disallow_activation,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectNotRestoredReasons(
    std::vector<BackForwardCacheMetrics::NotRestoredReason> reasons,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectBlocklistedFeatures(
    std::vector<blink::scheduler::WebSchedulerTrackedFeature> features,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectDisabledWithReasons(
    const std::vector<BackForwardCache::DisabledReason>& reasons,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::ExpectDisallowActivationReasons(
    const std::vector<uint64_t>& reasons,
    base::Location location) {}

void BackForwardCacheMetricsTestMatcher::
    ExpectBrowsingInstanceNotSwappedReasons(
        const std::vector<ShouldSwapBrowsingInstance>& reasons,
        base::Location location) {}

}  // namespace content