| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="../../resources/gc.js"></script> |
| <script> |
| |
| function runTest() { |
| canvas = document.createElement("canvas"); |
| context = canvas.getContext("2d"); |
| context.customProperty = "value"; |
| assert_equals(context.customProperty, "value"); |
| context = null; |
| gc(); |
| context = canvas.getContext("2d"); |
| assert_equals(context.customProperty, "value"); |
| } |
| |
| async_test(t => { |
| window.onload = function() { |
| t.step(runTest); |
| t.done(); |
| } |
| }, 'Verify that the custom properties on a Canvas 2D rendering context object are retained across GCs.'); |
| |
| </script> |