chromium/third_party/blink/web_tests/fast/dom/Document/document-open-use-counters-2args.html

<!DOCTYPE html>
<meta charset="utf-8">
<title>document.open UseCounters with two arguments but no replace</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<script>
const DocumentOpenTwoArgs = 2494; // From public/mojom/use_counter/metrics/web_feature.mojom
const DocumentOpenTwoArgsWithReplace = 2495; // From public/mojom/use_counter/metrics/web_feature.mojom
const DocumentOpenThreeArgs = 2496; // From public/mojom/use_counter/metrics/web_feature.mojom

test(() => {
  const frame = document.body.appendChild(document.createElement('iframe'));
  try {
    assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenTwoArgs), "DocumentOpenTwoArgs: before");
    assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenTwoArgsWithReplace), "DocumentOpenTwoArgsWithReplace: before");
    assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenThreeArgs), "DocumentOpenThreeArgs: before");
    frame.contentDocument.open('text/html', '');
    assert_true(internals.isUseCounted(frame.contentDocument, DocumentOpenTwoArgs), "DocumentOpenTwoArgs: after");
    assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenTwoArgsWithReplace), "DocumentOpenTwoArgsWithReplace: after");
    assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenThreeArgs), "DocumentOpenThreeArgs: after");
  } finally {
    frame.remove();
  }
}, 'document.open() with two arguments but no replace');
</script>
</body>