Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-context-gc-custom-properties.html

Issue 2675763005: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Corrections Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698