 function makeShadowRootWithSlot(element) {
    ShadyDOM.wrap(element).attachShadow({mode: 'open'});
    ShadyDOM.wrap(ShadyDOM.wrap(element).shadowRoot).appendChild(document.createElement('slot'));
  }

  function afterFlush(fn) {
    if (window.ShadyDOM) {
      ShadyDOM.flush();
      fn();
    } else {
      requestAnimationFrame(fn);
    }
  }

  test('slotchange fires when node added', function(done) {
    var d = document.createElement('div');
    makeShadowRootWithSlot(d);
    var slot = ShadyDOM.wr