<script>
if (window.testRunner)
    testRunner.dumpAsText();
</script>
This document was
<div id=test>not printed</div>
<script>
var mediaQueryList = window.matchMedia("print");
mediaQueryList.addListener((e) => {
    if (e.matches)
        test.innerHTML = "printed";
});

if (window.internals)
    window.internals.setPrinting(500,500);
</script>
