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

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

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.js
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.js b/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.js
deleted file mode 100644
index 1b2a756ea2e0b365a56b82aa7e1d08d0753806af..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-longlived-context.js
+++ /dev/null
@@ -1,40 +0,0 @@
-description("This test ensures that Canvas and CanvasRenderingContext2D work correctly if the rendering context outlives the canvas element");
-
-function dataToArray(data) {
- var result = new Array(data.length)
- for (var i = 0; i < data.length; i++)
- result[i] = data[i];
- return result;
-}
-
-function getPixel(x, y) {
- var data = context.getImageData(x,y,1,1);
- if (!data) // getImageData failed, which should never happen
- return [-1,-1,-1,-1];
- return dataToArray(data.data);
-}
-
-function pixelShouldBe(x, y, colour) {
- shouldBe("getPixel(" + [x, y] +")", "["+colour+"]");
-}
-
-function prepareCanvas() {
- var context = document.createElement("canvas").getContext("2d");
- context.fillStyle = "green";
- context.fillRect(0,0,100,100);
- return context;
-}
-
-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);
-}
-
-function test() {
- context = prepareCanvas();
- clobberGC(40);
- pixelShouldBe(50, 50, [0, 128, 0, 255]);
-}
-test();

Powered by Google App Engine
This is Rietveld 408576698