Commit a3fa9fb1 authored by Yao Xiao's avatar Yao Xiao Committed by Commit Bot

Include image ad in overlay-interstitial-ad detection

Bug: 1032681
Change-Id: Iafad2367d8887afb1df67094aef996a2f2873da2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121657Reviewed-by: default avatarStefan Zager <szager@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755967}
parent 12330139
...@@ -32,8 +32,8 @@ bool IsImageAd(Element* element) { ...@@ -32,8 +32,8 @@ bool IsImageAd(Element* element) {
HTMLImageElement* image_element = DynamicTo<HTMLImageElement>(element); HTMLImageElement* image_element = DynamicTo<HTMLImageElement>(element);
if (!image_element) if (!image_element)
return false; return false;
// TODO(yaoxia): image will be tagged soon.
return false; return image_element->IsAdRelated();
} }
// An overlay interstitial element shouldn't move with scrolling and should be // An overlay interstitial element shouldn't move with scrolling and should be
......
<!DOCTYPE html>
<html>
<head>
<style>
img {
position: fixed;
width: 100%;
height: 100%;
}
</style>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="resources/overlay-interstitial-ad-testharness.js"></script>
</head>
<body>
<img></img>
<script>
if (window.testRunner) {
// Inject a subresource filter to mark 'alpha.png' as a would be disallowed resource.
testRunner.setDisallowedSubresourcePathSuffixes(["alpha.png"], false /* block_subresources */);
}
async_test(t => {
document.getElementsByTagName("img")[0].src = "resources/alpha.png";
verifyInterstitialUseCounterAfter1500ms(t, true);
}, "Test UseCounter for overlay-interstitial-ad when the image has fixed position.");
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment