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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.html

Issue 2694703004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: 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-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>

Powered by Google App Engine
This is Rietveld 408576698