assert_false(isTopLayer(A), 'A is no longer top layer');
  await document.exitFullscreen();
  assert_equals(document.fullscreenElement, null, 'Both closed');
  assert_false(isTopLayer(A), 'A is no longer top layer');
  assert_false(isTopLayer(B), 'B is no longer top layer');
}, 'Requesting fullscreen on A, then B, then A');
</script>
