chromium/third_party/blink/web_tests/editing/execCommand/queryCommandState-01.html

<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<div contenteditable id="sample">foo</div>
<script>
test(() => {
    const sample = document.getElementById('sample');
    const selection = window.getSelection();
    selection.collapse(sample, 0);
    assert_false(document.queryCommandState('insertUnorderedList'), '1 InsertUnorderedList');
    assert_false(document.queryCommandState('insertOrderedList'), '2 insertOrderedList');
    document.execCommand('insertUnorderedList');
    assert_true(document.queryCommandState('insertUnorderedList'), '3 insertUnorderedList');
    assert_false(document.queryCommandState('insertOrderedList'), '4 insertOrderedList');
    document.execCommand('insertUnorderedList');
    document.execCommand('insertOrderedList');
    assert_false(document.queryCommandState('insertUnorderedList'), '5 insertUnorderedList');
    assert_true(document.queryCommandState('insertOrderedList'), '6 insertOrderedList');
}, 'queryCommandState for InsertOrderedList/InsertUnorderedList');
</script>