MCPcopy
hub / github.com/ampproject/amphtml / fetchAdContent

Function fetchAdContent

test/integration/test-amphtml-ads.js:479–488  ·  view source on GitHub ↗

* Returns a promise that fetches the content of the AMP ad at the amp4test url. * This somewhat simulates rendering an ad by getting its content from an ad * server.

()

Source from the content-addressed store, hash-verified

477 * server.
478 */
479function fetchAdContent() {
480 const url = '//localhost:9876/amp4test/a4a/' + RequestBank.getBrowserId();
481 return xhrServiceForTesting(window)
482 .fetchText(url, {
483 method: 'GET',
484 ampCors: false,
485 credentials: 'omit',
486 })
487 .then((res) => res.text());
488}
489
490/**
491 * Write the HTML page into the provided iframe then add it to the document.

Callers 1

Calls 5

xhrServiceForTestingFunction · 0.90
getBrowserIdMethod · 0.80
fetchTextMethod · 0.80
thenMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected