Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: chrome/test/data/extensions/activity_log/ad_injection/content_script.js

Issue 292313006: Improve activity log ad metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/activity_log/uma_policy.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/activity_log/ad_injection/content_script.js
diff --git a/chrome/test/data/extensions/activity_log/ad_injection/content_script.js b/chrome/test/data/extensions/activity_log/ad_injection/content_script.js
index 8d983d042df404c4e3a52a09507809641739bfdd..12ce7889af1ba2022f208903c79c9c59c34fa157 100644
--- a/chrome/test/data/extensions/activity_log/ad_injection/content_script.js
+++ b/chrome/test/data/extensions/activity_log/ad_injection/content_script.js
@@ -309,6 +309,24 @@ functions.push(function NewAnchorLikelyAd() {
return INJECTION_LIKELY_NEW_AD;
});
+// Test that an extension adding an element is not considered likely ad
+// injection if the element has a local resource.
+functions.push(function LocalResourceNotConsideredAd() {
+ var anchor = document.createElement('a');
+ document.body.appendChild(anchor).href = chrome.extension.getURL('foo.html');
+ return NO_AD_INJECTION;
+});
+
+// Test that an extension adding an element with the same host as the current
+// page is not considered ad injection.
+functions.push(function SamePageUrlNotConsideredAd() {
+ var anchor = document.createElement('a');
+ // This source is something like 'http://127.0.0.1:49725/foo.html'.
+ document.body.appendChild(anchor).href = document.URL + 'foo.html';
+ return NO_AD_INJECTION;
+});
+
+
functions.push(function ModifyExistingAnchorToAdNetwork() {
var anchor = $('non-ad-anchor');
anchor.href = kAdNetwork;
« no previous file with comments | « chrome/browser/extensions/activity_log/uma_policy.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698