* Returns a promise for when an element has been added to the given * window. This is for use in tests to wait until after the * attachment of an element to the DOM should have been registered. * @param {!Window} win * @return {!Promise }
(win)
| 597 | * @return {!Promise<undefined>} |
| 598 | */ |
| 599 | function onInsert(win) { |
| 600 | return new Promise((resolve) => { |
| 601 | const observer = new win.MutationObserver(() => { |
| 602 | observer.disconnect(); |
| 603 | resolve(); |
| 604 | }); |
| 605 | observer.observe(win.document.documentElement, { |
| 606 | childList: true, |
| 607 | subtree: true, |
| 608 | }); |
| 609 | }); |
| 610 | } |
| 611 | |
| 612 | /** |
| 613 | * Takes a HTML document that is pointing to unminified JS and HTML binaries and |
no test coverage detected