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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-incomplete.html

Issue 2674863003: 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-drawImage-incomplete.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-incomplete.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-incomplete.html
index d5d6221713a4d5c1c920fa0fe850b1ddec0b4cf5..c377ff8e3d0db30d6b44a6289d6297907a6ebbf6 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-incomplete.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-incomplete.html
@@ -1,9 +1,33 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<body>
-<script src="script-tests/canvas-drawImage-incomplete.js"></script>
+<script>
+test(function(t) {
+ var canvas = document.createElement("canvas");
+ var ctx = canvas.getContext('2d');
+ ctx.fillStyle = 'red';
+ ctx.fillRect(0,0,150,150);
+
+ var img = new Image();
+ img.src = '../../http/tests/misc/resources/image-slow.pl';
+
+ var video = document.createElement("video");
+
+ assert_equals(ctx.drawImage(img, 0, 0), undefined);
+
+ var imgdata = ctx.getImageData(0, 0, 1, 1).data;
+ assert_equals(imgdata[0], 255);
+ assert_equals(imgdata[1], 0);
+ assert_equals(imgdata[2], 0);
+ assert_equals(imgdata[3], 255);
+
+ assert_equals(ctx.drawImage(video, 0, 0), undefined);
+
+ imgdata = ctx.getImageData(0, 0, 1, 1).data;
+ assert_equals(imgdata[0], 255);
+ assert_equals(imgdata[1], 0);
+ assert_equals(imgdata[2], 0);
+ assert_equals(imgdata[3], 255);
+}, "Test that drawImage() does nothing with an incomplete image or video");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698