chromium/components/page_load_metrics/browser/observers/ad_metrics/page_ad_density_tracker_unittest.cc

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

#include <limits>

#include "base/test/task_environment.h"
#include "components/page_load_metrics/browser/observers/ad_metrics/page_ad_density_tracker.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"

namespace page_load_metrics {

namespace {

RectId;
RectType;

const RectId kRectId1 =;
const RectId kRectId2 =;
const RectId kRectId3 =;

}  // namespace

// Only for test purpose.
class PageAdDensityTrackerTestPeer {};

TEST(PageAdDensityTrackerTest, MultipleRects_MaxDensity) {}

// Remove a rect that was added twice, the second RemoveRect is
// ignored as it is no longer being tracked.
TEST(PageAdDensityTrackerTest, RemoveRectTwice_SecondRemoveIgnored) {}

// Ensures that two rects with the same dimensions hash to different
// values in the density tracker's frame set.
TEST(PageAdDensityTrackerTest, SeperateRects_SameDimensions) {}

// Create 2 rects whose total area overflow an int.
TEST(PageAdDensityTrackerTest, TwoRectsOverflowTotalAreaAndHeight) {}

// Add a main frame rect whose area overflow an int.
TEST(PageAdDensityTrackerTest, OverflowTotalAreaAndHeight) {}

// Regression test for crbug.com/1241038 (i.e. potential DCHECK failure if a
// line segment starts at position -1).
TEST(PageAdDensityTrackerTest, RectAtSpecialPosition) {}

// Add a viewport rect whose area overflow an int.
TEST(PageAdDensityTrackerTest, ViewportAdDensity_OverflowViewportArea) {}

TEST(PageAdDensityTrackerTest, ViewportAdDensity_RectSameSize) {}

TEST(PageAdDensityTrackerTest, ViewportAdDensity_RectHalfSize) {}

TEST(PageAdDensityTrackerTest, ViewportAdDensity_RectOutOfViewport) {}

TEST(PageAdDensityTrackerTest, ViewportAdDensity_RectClipsViewport) {}

TEST(PageAdDensityTrackerTest, ViewportAdDensity_TwoRectsClipViewport) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_NoTimeLapseSincePageLoad) {}

TEST(PageAdDensityTrackerTest, AverageViewportAdDensity_NoViewportRectUpdate) {}

TEST(PageAdDensityTrackerTest, AverageViewportAdDensity_NoAdRectUpdate) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_CalculateInOneSecondAndImmediateQuery) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_CalculateInOneSecondAndQueryLater) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_ViewportRect_SizeUpdate) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_ViewportRect_OffsetUpdate) {}

TEST(PageAdDensityTrackerTest, AverageViewportAdDensity_AdRectUpdate) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_RectRemovedAndRecalculateDensity) {}

TEST(PageAdDensityTrackerTest, AverageViewportAdDensity_ImageAdRects_Simple) {}

TEST(PageAdDensityTrackerTest, AverageViewportAdDensity_ImageAdRects_Removal) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_ImageAdRects_MixedWithIframeRects) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_MultipleUnequalTimePeriods) {}

TEST(PageAdDensityTrackerTest,
     AverageViewportAdDensity_MultipleRectsInViewportRect) {}

TEST(PageAdDensityTrackerTest, RectEvent_CheckTopAndBottomIterator) {}

}  // namespace page_load_metrics