chromium/third_party/blink/web_tests/http/tests/subresource_filter/overlay_popup_ad/overlay-popup-ad-size-too-small.html

<!DOCTYPE html>
<html>
<head>
<style>
div {
  width: 100vw;
  height: 100vh;
}
iframe {
  position: fixed;
  margin-left: 46vw;
  width: 8vw;
  height: 100vh;
  border: 0px;
}
p {
  position: fixed;
}
div.bottom {
  position: absolute;
  top: 10000px;
  left: 0px;
  width: 1px;
  height: 1px;
}
</style>

<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../resources/overlay-interstitial-ad-testharness.js"></script>
</head>
<body marginwidth="0" marginheight="0">

<!-- To trigger the first contentful paint at the very start -->
<p>some content</p>

<!-- To contain the overlay popup iframe -->
<div></div>

<!-- To be positioned further down in the main page to make the page scrollable -->
<div class="bottom"></div>

<script>
promise_test(async function(t) {
  // After 1500ms, force a layout update so that the interstitial detector
  // is aware of the first meaningful paint, and future overlay candidates
  // will be considered for pop-ups rather than for prestitials.
  await timeout(1500);
  await forceLayoutUpdate();

  // Create the overlay pop-up ad.
  appendAdFrameTo(document.getElementsByTagName('div')[0]);

  // Force a layout update, so that the interstitial detector is aware of
  // the overlay candidate.
  await forceLayoutUpdate();

  // Hide the pop-up.
  document.getElementsByTagName('iframe')[0].style.display = 'none';

  // Force a layout update, so that the interstitial detector is aware of
  // the overlay candidate's dismissal.
  await forceLayoutUpdate();

  // Expect that the use counter kOverlayPopupAd is not recorded, as the
  // ad size is too small relative to the viewport size.
  assert_false(internals.isUseCounted(document, kOverlayPopupAd));
}, "Test overlay-popup-ad when the frame itself has a fixed position and the size is less than 10% of the viewport size. In this case, we expect no use counter for kOverlayPopupAd.");

</script>
</body>
</html>