exts[1]);
  assert_equals(sheet.cssRules.length, 1);
  assert_equals(redStyleTexts[1], sheet.cssRules[0].cssText);
}, 'CSSStyleSheet.replaceSync replaces stylesheet text synchronously');

test(() => {
  // Attach a div inside a shadow root with the class ".red".
  const span = document.createElement("span");
  thirdSection.appendChild(span);
  const shadowDiv = attachShadowDiv(span);
  shadowDiv.classList.add("red");
  // Create empty stylesheet.
  const sheet = new CSSStyleSheet();
  span.shadowRoot.adopte