#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 = …;
}
class PageAdDensityTrackerTestPeer { … };
TEST(PageAdDensityTrackerTest, MultipleRects_MaxDensity) { … }
TEST(PageAdDensityTrackerTest, RemoveRectTwice_SecondRemoveIgnored) { … }
TEST(PageAdDensityTrackerTest, SeperateRects_SameDimensions) { … }
TEST(PageAdDensityTrackerTest, TwoRectsOverflowTotalAreaAndHeight) { … }
TEST(PageAdDensityTrackerTest, OverflowTotalAreaAndHeight) { … }
TEST(PageAdDensityTrackerTest, RectAtSpecialPosition) { … }
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) { … }
}