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

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: Addressing comments 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..585be398a011fb67a18a90955e51e21f4720256b 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,38 @@
-<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");
+ assert_equals(context.customProperty, "value");
context = null;
gc();
context = canvas.getContext("2d");
- shouldBeEqualToString("context.customProperty", "value");
- finishJSTest();
+ assert_equals(context.customProperty, "value");
}
-window.onload = runTest;
+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>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698