chromium/chrome/browser/page_load_metrics/observers/ad_metrics/ad_density_intervention_browsertest.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 <memory>

#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobar_delegate.h"
#include "components/infobars/core/infobar_manager.h"
#include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h"
#include "components/subresource_filter/core/common/common_features.h"
#include "components/subresource_filter/core/common/test_ruleset_utils.h"
#include "components/subresource_filter/core/mojom/subresource_filter.mojom.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace {

const char kAdsInterventionRecordedHistogram[] =;

// Gets the body height of the document embedded in |web_contents|.
int GetDocumentHeight(content::WebContents* web_contents) {}

}  // namespace

class AdDensityViolationBrowserTest
    : public subresource_filter::SubresourceFilterBrowserTest {};

// TODO(crbug.com/40916871): Fix this test on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_DesktopPageAdDensityByHeightAbove30_AdInterventionNotTriggered
#else
#define MAYBE_DesktopPageAdDensityByHeightAbove30_AdInterventionNotTriggered
#endif
// TODO(crbug.com/40727827): Replace this heavy-weight browsertest with
// a unit test.
IN_PROC_BROWSER_TEST_F(
    AdDensityViolationBrowserTest,
    MAYBE_DesktopPageAdDensityByHeightAbove30_AdInterventionNotTriggered) {}