Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Voytenko committed Mar 2, 2021
1 parent 2783ddb commit 3ecbd26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/a4a.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2>A4A ad: doubleclick</h2>
width="300">
</amp-ad>

<h2>A4A ad: adsense</h2>
<h2>AdSense (may or may not be A4A)</h2>
<amp-ad
width="300"
height="250"
Expand Down
1 change: 0 additions & 1 deletion extensions/amp-a4a/0.1/amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ import {
} from '../../../src/utils/intersection';
import {isAdPositionAllowed} from '../../../src/ad-helper';
import {isArray, isEnumValue, isObject} from '../../../src/types';

import {listenOnce} from '../../../src/event-helper';
import {
observeWithSharedInOb,
Expand Down
15 changes: 12 additions & 3 deletions extensions/amp-a4a/0.1/test/test-amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ if (NO_SIGNING_RTV) {
});

it('should set the correct sandbox features', async () => {
env.sandbox.stub(Services.platformFor(env.win), 'isSafari').returns(false);
env.sandbox
.stub(Services.platformFor(env.win), 'isSafari')
.returns(false);
await a4a.buildCallback();
a4a.onLayoutMeasure();
await a4a.layoutCallback();
Expand Down Expand Up @@ -183,7 +185,10 @@ if (NO_SIGNING_RTV) {
await a4a.layoutCallback();
const fie = doc.body.querySelector('iframe[srcdoc]');
const violationSpy = env.sandbox.spy();
fie.contentWindow.addEventListener('securitypolicyviolation', violationSpy);
fie.contentWindow.addEventListener(
'securitypolicyviolation',
violationSpy
);
const fakePolyfill = doc.createElement('script');
fakePolyfill.src = 'https://cdn.ampproject.org/rtv/some-polyfill.js';
fie.contentDocument.head.appendChild(fakePolyfill);
Expand All @@ -198,7 +203,10 @@ if (NO_SIGNING_RTV) {
await a4a.layoutCallback();
const fie = doc.body.querySelector('iframe[srcdoc]');
const violationSpy = env.sandbox.spy();
fie.contentWindow.addEventListener('securitypolicyviolation', violationSpy);
fie.contentWindow.addEventListener(
'securitypolicyviolation',
violationSpy
);
const fakePolyfill = doc.createElement('script');
fakePolyfill.src = 'https://www.cats.example';
fie.contentDocument.head.appendChild(fakePolyfill);
Expand Down Expand Up @@ -312,6 +320,7 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
let getResourceStub;

beforeEach(() => {
// TODO(ccordry): remove with no-signing launch or similar.
env.sandbox.stub(AmpA4A.prototype, 'isInNoSigningExp').returns(false);

fetchMock = null;
Expand Down

0 comments on commit 3ecbd26

Please sign in to comment.