| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.html
|
| index 86c0aae3b67656030279b143696bb2558e439968..aa1aacad269bfd5891ad58d98c4f5b3e1d7281c5 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.html
|
| @@ -1,3 +1,22 @@
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +test(function(t) {
|
|
|
| -<script src="../../resources/js-test.js"></script>
|
| -<script src="canvas-longlived-context.js"></script>
|
| + var context = document.createElement("canvas").getContext("2d");
|
| + context.fillStyle = "green";
|
| + context.fillRect(0,0,100,100);
|
| +
|
| + function clobberGC(count) {
|
| + for (var i = 0; i < 5000; ++i)
|
| + ({a: i*i*i*0.5+"str", b: i/Math.sqrt(i)});
|
| + if (count > 0)
|
| + clobberGC(count-1);
|
| + }
|
| +
|
| + clobberGC(40);
|
| + assert_array_equals(context.getImageData(50, 50, 1, 1).data, [0, 128, 0, 255]);
|
| +
|
| +}, 'This test ensures that Canvas and CanvasRenderingContext2D work correctly if the rendering context outlives the canvas element.');
|
| +
|
| +</script>
|
|
|