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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-p3.html

Issue 2674933002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Corrections 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-getImageData-p3.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-p3.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-p3.html
index 73e48fd5aeea2d507fec59acf71e6730e7e3f6cb..955f9896a1264e7adf1668eefec22ae861448fc0 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-p3.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-getImageData-p3.html
@@ -7,38 +7,37 @@ test(drawThenGetImageData, 'verifies that getImageData works on P3 canvases.');
test(putThenGetImageData, 'verifies that putImageData works on P3 canvases.');
function drawThenGetImageData() {
- var canvas = document.createElement('canvas');
- canvas.width = 10;
- canvas.height = 10;
- var ctx = canvas.getContext('2d', {colorSpace: 'p3'})
- ctx.fillStyle = 'rgb(50, 100, 150)';
- ctx.fillRect(0, 0, 10, 10);
- var pixel = ctx.getImageData(5, 5, 1, 1).data;
- // Note: the color specified as as fillStyle is converted from srgb to linear
- // when drawn and the the results of getImageData are re-converted to sRGB
- assert_equals(pixel[0], 50, "Red component retrieved by getImageData is the color that was drawn." );
- assert_equals(pixel[1], 100, "Green component retrieved by getImageData is the color that was drawn." );
- assert_equals(pixel[2], 150, "Blue component retrieved by getImageData is the color that was drawn." );
- assert_equals(pixel[3], 255, "Alpha component retrieved by getImageData is the color that was drawn." );
+ var canvas = document.createElement('canvas');
+ canvas.width = 10;
+ canvas.height = 10;
+ var ctx = canvas.getContext('2d', {colorSpace: 'p3'})
+ ctx.fillStyle = 'rgb(50, 100, 150)';
+ ctx.fillRect(0, 0, 10, 10);
+ var pixel = ctx.getImageData(5, 5, 1, 1).data;
+ // Note: the color specified as as fillStyle is converted from srgb to linear
+ // when drawn and the the results of getImageData are re-converted to sRGB
+ assert_equals(pixel[0], 50, "Red component retrieved by getImageData is the color that was drawn." );
+ assert_equals(pixel[1], 100, "Green component retrieved by getImageData is the color that was drawn." );
+ assert_equals(pixel[2], 150, "Blue component retrieved by getImageData is the color that was drawn." );
+ assert_equals(pixel[3], 255, "Alpha component retrieved by getImageData is the color that was drawn." );
}
function putThenGetImageData() {
- var canvas = document.createElement('canvas');
- canvas.width = 10;
- canvas.height = 10;
- var ctx = canvas.getContext('2d', {colorSpace: 'p3'})
- var initialData = ctx.createImageData(1, 1);
- initialData.data[0] = 50;
- initialData.data[1] = 100;
- initialData.data[2] = 150;
- initialData.data[3] = 255;
- ctx.putImageData(initialData, 5, 5);
- var pixel = ctx.getImageData(5, 5, 1, 1).data;
- assert_equals(pixel[0], 50, "Red component retrieved by getImageData is the color that was put." );
- assert_equals(pixel[1], 100, "Green component retrieved by getImageData is the color that was put." );
- assert_equals(pixel[2], 150, "Blue component retrieved by getImageData is the color that was put." );
- assert_equals(pixel[3], 255, "Alpha component retrieved by getImageData is the color that was put." );
+ var canvas = document.createElement('canvas');
+ canvas.width = 10;
+ canvas.height = 10;
+ var ctx = canvas.getContext('2d', {colorSpace: 'p3'})
+ var initialData = ctx.createImageData(1, 1);
+ initialData.data[0] = 50;
+ initialData.data[1] = 100;
+ initialData.data[2] = 150;
+ initialData.data[3] = 255;
+ ctx.putImageData(initialData, 5, 5);
+ var pixel = ctx.getImageData(5, 5, 1, 1).data;
+ assert_equals(pixel[0], 50, "Red component retrieved by getImageData is the color that was put." );
+ assert_equals(pixel[1], 100, "Green component retrieved by getImageData is the color that was put." );
+ assert_equals(pixel[2], 150, "Blue component retrieved by getImageData is the color that was put." );
+ assert_equals(pixel[3], 255, "Alpha component retrieved by getImageData is the color that was put." );
}
-
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698