diff --git a/extensions/amp-video-iframe/0.1/amp-video-iframe.js b/extensions/amp-video-iframe/0.1/amp-video-iframe.js index d9bbd30485d8..687e7f1298f9 100644 --- a/extensions/amp-video-iframe/0.1/amp-video-iframe.js +++ b/extensions/amp-video-iframe/0.1/amp-video-iframe.js @@ -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'; @@ -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), - ' does not allow ad iframes. ' + - 'Please use amp-ad instead.'); - - this.user().assert(!looksLikeTrackingIframe(element), - ' does not allow tracking iframes. ' + - 'Please use amp-analytics instead.'); - } + const isIntegrationTest = + element.hasAttribute('i-amphtml-integration-test'); + + this.user().assert(isIntegrationTest || !looksLikeTrackingIframe(element), + ' does not allow tracking iframes. ' + + 'Please use amp-analytics instead.'); installVideoManagerForDoc(element); } diff --git a/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js b/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js index 32de3e848551..7336e7a05aa4 100644 --- a/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js +++ b/extensions/amp-video-iframe/0.1/test/test-amp-video-iframe.js @@ -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],