chromium/third_party/blink/web_tests/fast/canvas-api/change-context.html

<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<canvas id="canvas"></canvas><br />

<script>
test(function(t) {

    var canvas = document.getElementById("canvas");
    var ctx1 = canvas.getContext("2d");
    var ctx2 = canvas.getContext("");
    ctx1.save();
    
    canvas.parentNode.removeChild(canvas);
    
    if (window.GCController)
        GCController.collect();
        
    ctx1.save();
    
}, 'This test ensures that changing the context does not crash.');
</script>
</body>