#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/observers/ad_metrics/ad_intervention_browser_test_utils.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 "content/public/test/test_navigation_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
namespace {
const char kAdsInterventionRecordedHistogram[] = …;
}
class OverlayPopupAdViolationBrowserTest
: public subresource_filter::SubresourceFilterBrowserTest { … };
#if BUILDFLAG(IS_CHROMEOS) || (BUILDFLAG(IS_LINUX) && defined(MEMORY_SANITIZER))
#define MAYBE_NoOverlayPopupAd_AdInterventionNotTriggered …
#else
#define MAYBE_NoOverlayPopupAd_AdInterventionNotTriggered …
#endif
IN_PROC_BROWSER_TEST_F(OverlayPopupAdViolationBrowserTest,
MAYBE_NoOverlayPopupAd_AdInterventionNotTriggered) { … }
#if (BUILDFLAG(IS_LINUX) && \
(defined(MEMORY_SANITIZER) || defined(LEAK_SANITIZER))) || \
(BUILDFLAG(IS_CHROMEOS) && !defined(NDEBUG)) || \
(defined(LEAK_SANITIZER) && BUILDFLAG(IS_CHROMEOS) && \
defined(ADDRESS_SANITIZER))
#define MAYBE_OverlayPopupAd_AdInterventionTriggered …
#else
#define MAYBE_OverlayPopupAd_AdInterventionTriggered …
#endif
IN_PROC_BROWSER_TEST_F(OverlayPopupAdViolationBrowserTest,
MAYBE_OverlayPopupAd_AdInterventionTriggered) { … }
class OverlayPopupAdViolationBrowserTestWithoutEnforcement
: public OverlayPopupAdViolationBrowserTest { … };
#if (BUILDFLAG(IS_LINUX) && defined(MEMORY_SANITIZER)) || \
(BUILDFLAG(IS_CHROMEOS) && \
(!defined(NDEBUG) || defined(ADDRESS_SANITIZER) || \
defined(LEAK_SANITIZER)))
#define MAYBE_OverlayPopupAd_NoAdInterventionTriggered …
#else
#define MAYBE_OverlayPopupAd_NoAdInterventionTriggered …
#endif
IN_PROC_BROWSER_TEST_F(OverlayPopupAdViolationBrowserTestWithoutEnforcement,
MAYBE_OverlayPopupAd_NoAdInterventionTriggered) { … }