Chromium Code Reviews| 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 12ce7889af1ba2022f208903c79c9c59c34fa157..6f38cab2923c0440c35dcd2ee5797168532f7903 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 |
| @@ -31,8 +31,6 @@ |
| var kBodyHtml = |
| '<iframe id="ad-iframe" src="http://www.known-ads.adnetwork"></iframe>' + |
| '<iframe id="non-ad-iframe" src="http://www.not-ads.adnetwork"></iframe>' + |
| - '<embed id="ad-embed" src="http://www.known-ads.adnetwork"><embed>' + |
| - '<embed id="non-ad-embed" src="http://www.not-ads.adnetwork"><embed>' + |
| '<a id="ad-anchor" href="http://www.known-ads.adnetwork"></a>' + |
| '<a id="non-ad-anchor" href="http://www.not-ads.adnetwork"></a>' + |
| '<div id="empty-div"></div>'; |
| @@ -43,8 +41,8 @@ var kBodyHtml = |
| * - Signal the C++ test that we're going to do page setup, and we shouldn't |
| * record any ad-injector events (as some of the page setup could qualify). |
| * - Do the page setup, which involves creating a 'playground' for ad injectors |
| - * of iframes, embeds, etc. See also ad_injectors.html. We do this set up for |
| - * each test, so that none of the tests conflicts with each other. |
| + * of iframes, etc. See also ad_injectors.html. We do this set up for each |
| + * test, so that none of the tests conflicts with each other. |
| * - Signal that we are done with page setup, and should start recording events. |
| * - Run the next test. |
| * - Signal that the test is done, and we should check for the result. |
| @@ -180,18 +178,6 @@ var getIframeAd = function() { |
| return kIframeAdTemplate.cloneNode(true); |
| }; |
| -// Creates an embed ad, like so: |
| -// <embed src="http://www.known-ads.adnetwork"></embed> |
| -var kEmbedAdTemplate = document.createElement('embed'); |
| -kEmbedAdTemplate.src = kAdNetwork; |
| - |
| -/** |
| - * @return An embed element which will count as ad injection in the tests. |
| - */ |
| -var getEmbedAd = function() { |
| - return kEmbedAdTemplate.cloneNode(true); |
| -}; |
| - |
| // Creates an anchor ad, like so: |
| // <a href="http://www.known-ads.adnetwork"></a> |
| var kAnchorAdTemplate = document.createElement('a'); |
| @@ -241,12 +227,10 @@ var functions = []; |
| functions.push(function NoAdInjection() { |
| var div = document.createElement('div'); |
| var iframe = document.createElement('iframe'); |
| - var embed = document.createElement('embed'); |
| var anchor = document.createElement('anchor'); |
| var span = document.createElement('span'); |
| span.textContent = 'Hello, world'; |
| div.appendChild(iframe); |
| - div.appendChild(embed); |
| div.appendChild(anchor); |
| div.appendChild(span); |
| document.body.appendChild(div); |
| @@ -275,28 +259,6 @@ functions.push(function ModifyExistingIframeToAdNetwork() { |
| return INJECTION_NEW_AD; |
| }); |
| -// Add a new embed element which serves ads. |
| -functions.push(function NewEmbedAdNetwork() { |
| - document.body.appendChild(getEmbedAd()); |
| - return INJECTION_NEW_AD; |
| -}); |
| - |
| -// Add a new embed element which does not serve ads. We should not record |
| -// anything. |
| -functions.push(function NewEmbedLikelyAdNetwork() { |
| - var embed = document.createElement('embed'); |
| - document.body.appendChild(embed).src = kMaybeAdNetwork; |
| - return INJECTION_LIKELY_NEW_AD; |
| -}); |
| - |
| -// Modify an embed which is currently in the DOM, switching the src to an |
| -// ad network. |
| -functions.push(function ModifyExistingEmbedToAdNetwork() { |
| - var embed = $('non-ad-embed'); |
| - embed.src = kAdNetwork; |
| - return INJECTION_NEW_AD; |
| -}); |
| - |
| // Add a new anchor element which serves ads. |
| functions.push(function NewAnchorAd() { |
| document.body.appendChild(getAnchorAd()); |
| @@ -340,12 +302,6 @@ functions.push(function NewNestedAd() { |
| return INJECTION_NEW_AD; |
| }); |
| -// Switch an existing embed ad to a new ad network. |
| -functions.push(function ReplaceEmbedAd() { |
| - $('ad-embed').src = kAdNetwork2; |
| - return INJECTION_REPLACED_AD; |
| -}); |
| - |
| // Switch an existing iframe ad to a new ad network. |
| functions.push(function ReplaceIframeAd() { |
| $('ad-iframe').src = kAdNetwork2; |
| @@ -358,22 +314,6 @@ functions.push(function ReplaceAnchorAd() { |
| return INJECTION_REPLACED_AD; |
| }); |
| -// Remove an existing embed ad by setting it's src to a non-ad network. |
| -functions.push(function RemoveAdBySettingSrc() { |
|
Devlin
2014/07/15 17:21:52
These don't work anymore?
pmarch
2014/07/16 10:34:17
Yes, there is no tracking for embed elements by Ac
|
| - $('ad-embed').src = kMaybeAdNetwork; |
| - return INJECTION_REMOVED_AD; |
| -}); |
| - |
| -// Ensure that we flag actions that look a lot like ad injection, even if we're |
| -// not sure. |
| -functions.push(function LikelyReplacedAd() { |
| - // Switching from one valid url src to another valid url src is very |
| - // suspicious behavior, and should be relatively rare. This helps us determine |
| - // the effectiveness of our ad network recognition. |
| - $('non-ad-embed').src = 'http://www.thismightbeanadnetwork.ads'; |
| - return INJECTION_LIKELY_REPLACED_AD; |
| -}); |
| - |
| // Verify that we do not enter the javascript world when we check for ad |
| // injection. |
| functions.push(function VerifyNoAccess() { |