Skip to content

Commit

Permalink
❄️ Fix flaky amp-a4a tests (#40049)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg authored Jun 7, 2024
1 parent fa1cf9e commit f14d0fe
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions extensions/amp-a4a/0.1/test/test-amp-a4a.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
a4a.onLayoutMeasure();
await a4a.layoutCallback();
verifyCachedContentIframeRender(a4aElement, TEST_URL, true);
expect(a4a.iframe.getAttribute('allow')).to.equal("sync-xhr 'none';");
expect(a4a.iframe.getAttribute('allow')).to.include("sync-xhr 'none';");
});

it('should set feature policy for attribution-reporting when supported', async () => {
Expand All @@ -929,8 +929,9 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
a4a.onLayoutMeasure();
await a4a.layoutCallback();
verifyCachedContentIframeRender(a4aElement, TEST_URL, true);
expect(a4a.iframe.getAttribute('allow')).to.equal(
"sync-xhr 'none';attribution-reporting 'src';"
expect(a4a.iframe.getAttribute('allow')).to.include("sync-xhr 'none';");
expect(a4a.iframe.getAttribute('allow')).to.include(
"attribution-reporting 'src';"
);
});

Expand All @@ -942,7 +943,10 @@ describes.realWin('amp-a4a', {amp: true}, (env) => {
a4a.onLayoutMeasure();
await a4a.layoutCallback();
verifyCachedContentIframeRender(a4aElement, TEST_URL, true);
expect(a4a.iframe.getAttribute('allow')).to.equal("sync-xhr 'none';");
expect(a4a.iframe.getAttribute('allow')).to.include("sync-xhr 'none';");
expect(a4a.iframe.getAttribute('allow')).to.not.include(
"attribution-reporting 'src';"
);
});
});

Expand Down

0 comments on commit f14d0fe

Please sign in to comment.