chromium/chrome/test/data/printing/on_before_after_events.html

<!doctype html>
<html>
<script>
let firedBeforePrint = false;
let firedAfterPrint = false;
window.addEventListener('beforeprint', function (_) {
  firedBeforePrint = true;
});
window.addEventListener('afterprint', function (_) {
  firedAfterPrint = true;
});
</script>
</html>