chromium/third_party/blink/web_tests/external/wpt/shadow-dom/focus/delegatesFocus-tabindex-change.html

<!DOCTYPE html>
<link rel=author href="mailto:[email protected]">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<body>
<script>
test(() => {
  const host = document.createElement('div');
  document.body.appendChild(host);

  const shadowRoot = host.attachShadow({mode: 'open', delegatesFocus: true});

  const shadowInput = document.createElement('input');
  shadowRoot.appendChild(shadowInput);

  host.focus();
  assert_equals(document.activeElement, host, 'The shadow host should be focused.');

  host.setAttribute('tabindex', '0');
  assert_equals(document.activeElement, host, 'The shadow host should remain focused after changing tabindex.');
}, 'Setting tabindex on the shadow host of a focused element with delegatesFocus should not change focus.');
</script>