(src)
| 332 | } |
| 333 | |
| 334 | export function createServedIframe(src) { |
| 335 | return new Promise(function (resolve, reject) { |
| 336 | const iframe = document.createElement('iframe'); |
| 337 | iframe.name = 'test_' + iframeCount++; |
| 338 | iframe.src = src; |
| 339 | iframe.onload = function () { |
| 340 | const win = iframe.contentWindow; |
| 341 | win.__AMP_TEST_IFRAME = true; |
| 342 | win.__AMP_TEST = true; |
| 343 | installRuntimeServices(win); |
| 344 | resolve({ |
| 345 | win, |
| 346 | doc: win.document, |
| 347 | iframe, |
| 348 | }); |
| 349 | }; |
| 350 | iframe.onerror = reject; |
| 351 | document.body.appendChild(iframe); |
| 352 | }); |
| 353 | } |
| 354 | |
| 355 | const IFRAME_STUB_URL = |
| 356 | '//ads.localhost:8081/test/fixtures/served/iframe-stub.html#'; |
nothing calls this directly
no test coverage detected