* 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.
()
| 477 | * server. |
| 478 | */ |
| 479 | function 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. |
no test coverage detected