chromium/third_party/blink/web_tests/shadow-dom/slotted-pseudo-element-dynamic-attribute-change.html

<!DOCTYPE html>
<div id="host">
  <div id="child">I should be green.</div>
</div>
<script>
if (window.testRunner)
    testRunner.waitUntilDone();

var shadowRoot = document.getElementById('host').attachShadow({mode: 'open'});
shadowRoot.innerHTML = '<style>slot::slotted(.selected) { ' +
    'background: green; }</style>' +
    '<slot></slot>';

setTimeout(function() {
    document.getElementById('child').classList.add('selected');
    if (window.testRunner)
        testRunner.notifyDone();
}, 0);
</script>