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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect.html
index 899e664f9b4ed18fdd54f4e69323ea66b0cde8fe..3432b607f5f7e7b3c4bbef160952bad5ddda2c27 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect.html
@@ -1,9 +1,47 @@
-<!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-clearRect.js"></script>
+<script>
+test(function(t) {
+ var ctx = document.createElement('canvas').getContext('2d');
+
+ // Clear rect with height = width = 0.
+ ctx.fillStyle = 'red';
+ ctx.fillRect(0, 0, 1, 1);
+ ctx.clearRect(0, 0, 0, 0);
+
+ var imageData = ctx.getImageData(0, 0, 1, 1);
+ var imgdata = imageData.data;
+ assert_equals(imgdata[0], 255);
+ assert_equals(imgdata[1], 0);
+ assert_equals(imgdata[2], 0);
+
+ ctx.clearRect(0, 0, 1, 1);
+
+ // Clear rect with height = 0, width = 1.
+ ctx.fillStyle = 'red';
+ ctx.fillRect(0, 0, 1, 1);
+ ctx.clearRect(0, 0, 1, 0);
+
+ var imageData = ctx.getImageData(0, 0, 1, 1);
+ var imgdata = imageData.data;
+ assert_equals(imgdata[0], 255);
+ assert_equals(imgdata[1], 0);
+ assert_equals(imgdata[2], 0);
+
+ ctx.clearRect(0, 0, 1, 1);
+
+ // Clear rect with height = 1, width = 0.
+ ctx.fillStyle = 'red';
+ ctx.fillRect(0, 0, 1, 1);
+ ctx.clearRect(0, 0, 0, 1);
+
+ var imageData = ctx.getImageData(0, 0, 1, 1);
+ var imgdata = imageData.data;
+ assert_equals(imgdata[0], 255);
+ assert_equals(imgdata[1], 0);
+ assert_equals(imgdata[2], 0);
+
+}, "Series of tests to ensure correct behavior of canvas.clearRect().");
+</script>
</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-clearRect-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698