the popover.');

  assert_false(popover.togglePopover(/*force=*/false),
    'togglePopover(false) should return false.');
  assert_false(popover.matches(':popover-open'),
    'togglePopover(false) should close the popover.');
}, 'togglePopover should toggle the popover and return true or false as specified.');

test(() => {
  const popover = document.getElementById('popover2');
  popover.addEventListener('beforetoggle', event => event.preventDefault(), {once: true});
  assert_false(popover.togglePopover(/*f