    this.removeChild(child);
                this.appendChild(child);
            }
        }
        class Child extends HTMLElement {
            connectedCallback() { calls++; }
        }
        iteration++;
        let parenter = 'x-parenter' + iteration;
        let child = 'x-child' + iteration;
        customElements.define(parenter, Parenter);
        customElements.define(child, Child);
        return getDocument().then(function (doc) {
            document.documentElement.innerHTML = `<${parenter