Skip to content

Commit

Permalink
Remove adLike assertions from amp-video-iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorozco committed Nov 14, 2018
1 parent bf11b71 commit 90d9d9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
20 changes: 8 additions & 12 deletions extensions/amp-video-iframe/0.1/amp-video-iframe.js
Expand Up @@ -31,7 +31,6 @@ import {dev, user} from '../../../src/log';
import {dict} from '../../../src/utils/object';
import {
disableScrollingOnIframe,
isAdLike,
looksLikeTrackingIframe,
} from '../../../src/iframe-helper';
import {getData, listen} from '../../../src/event-helper';
Expand Down Expand Up @@ -122,18 +121,15 @@ class AmpVideoIframe extends AMP.BaseElement {
buildCallback() {
const {element} = this;

// TODO(alanorozco): On integration tests, `getLayoutBox` will returned
// a cached default value, which makes these assertions fail. Move to
// TODO(alanorozco): On integration tests, `getLayoutBox` will return a
// cached default value, which makes this assertion fail. Move to
// `describes.integration` to see if that fixes it.
if (!element.hasAttribute('i-amphtml-integration-test')) {
this.user().assert(!isAdLike(element),
'<amp-video-iframe> does not allow ad iframes. ' +
'Please use amp-ad instead.');

this.user().assert(!looksLikeTrackingIframe(element),
'<amp-video-iframe> does not allow tracking iframes. ' +
'Please use amp-analytics instead.');
}
const isIntegrationTest =
element.hasAttribute('i-amphtml-integration-test');

this.user().assert(isIntegrationTest || !looksLikeTrackingIframe(element),
'<amp-video-iframe> does not allow tracking iframes. ' +
'Please use amp-analytics instead.');

installVideoManagerForDoc(element);
}
Expand Down
14 changes: 0 additions & 14 deletions extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js
Expand Up @@ -129,20 +129,6 @@ describes.realWin('amp-video-iframe', {
expect(dummySpy.withArgs(sinon.match(metadata))).to.have.been.calledOnce;
});

it('rejects ads', () => {
const adSizes = [
[300, 250],
[320, 50],
[300, 50],
[320, 100],
];

adSizes.forEach(size => {
const videoIframe = createVideoIframe(size);
expect(whenLoaded(videoIframe)).to.eventually.be.rejected;
});
});

it('rejects tracking iframes', () => {
const trackingSizes = [
[10, 10],
Expand Down

0 comments on commit 90d9d9f

Please sign in to comment.