blob: ca1a938a125c2543938c111e4dd330ee67a5e93e [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>document.open UseCounters with three arguments</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<script>
const DocumentOpenTwoArgs = 2494; // From public/mojom/web_feature/web_feature.mojom
const DocumentOpenTwoArgsWithReplace = 2495; // From public/mojom/web_feature/web_feature.mojom
const DocumentOpenThreeArgs = 2496; // From public/mojom/web_feature/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('about:blank', '_blank', '');
assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenTwoArgs), "DocumentOpenTwoArgs: after");
assert_false(internals.isUseCounted(frame.contentDocument, DocumentOpenTwoArgsWithReplace), "DocumentOpenTwoArgsWithReplace: after");
assert_true(internals.isUseCounted(frame.contentDocument, DocumentOpenThreeArgs), "DocumentOpenThreeArgs: after");
} finally {
frame.remove();
}
}, 'document.open() with three arguments');
</script>
</body>