dStyleSheets = [sheet];
  assert_equals(getComputedStyle(shadowDiv).color, "rgb(0, 0, 0)");
  // Replace the stylesheet text that will color it red.
  sheet.replaceSync(redStyleTexts[0]);
  assert_equals(getComputedStyle(shadowDiv).color, "rgb(255, 0, 0)");
  assert_equals(sheet.cssRules.length, 1);
  assert_equals(sheet.cssRules[0].cssText, redStyleTexts[0]);
  sheet.insertRule(redStyleTexts[1]);
  assert_equals(sheet.cssRules.length, 2);
  assert_equals(sheet.cssRules[0].cssText, redStyleTexts[1]);
}, 'CS