Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html |
| index 2ec7253bbbf6ac041c8203b2d5052885302036d1..9ce4a69acefbeecd2ac45170800f4ba01f8f909f 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html |
| @@ -1,31 +1,34 @@ |
| -<html> |
| -<head> |
| -<script src="../../resources/js-test.js"></script> |
| -</head> |
| -<body> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| <script> |
| -description("Verify that the custom properties on a Canvas 2D rendering context object are retained across GCs."); |
| - |
| -window.jsTestIsAsync = true; |
| - |
| -if (window.testRunner) { |
| - testRunner.dumpAsText(); |
| - testRunner.waitUntilDone(); |
| +function gc() { |
| + if (typeof GCController !== "undefined") |
| + GCController.collectAll(); |
| + else { |
| + var gcRec = function (n) { |
| + if (n < 1) |
| + return {}; |
| + var temp = {i: "ab" + i + (i / 100000)}; |
| + temp += "foo"; |
| + gcRec(n-1); |
| + }; |
| + for (var i = 0; i < 1000; i++) |
| + gcRec(10); |
| + } |
| } |
| function runTest() { |
| - canvas = document.createElement("canvas"); |
| - context = canvas.getContext("2d"); |
| - context.customProperty = "value"; |
| - shouldBeEqualToString("context.customProperty", "value"); |
| - context = null; |
| - gc(); |
| - context = canvas.getContext("2d"); |
| - shouldBeEqualToString("context.customProperty", "value"); |
| - finishJSTest(); |
| + test(function(t) { |
|
Justin Novosad
2017/02/08 18:23:33
Are you sure this works as expected? I am concerne
zakerinasab
2017/02/08 19:57:49
Done.
|
| + 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"); |
| + }, 'Verify that the custom properties on a Canvas 2D rendering context object are retained across GCs.'); |
| } |
| window.onload = runTest; |
| </script> |
| -</body> |
| -</html> |