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/images/script-tests/cmyk-jpeg-with-color-profile.js

Issue 2228333003: Use testharness.js in fast/images/ for border/cmyk tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code changed as per comments. Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/fast/images/script-tests/border.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/images/script-tests/cmyk-jpeg-with-color-profile.js
diff --git a/third_party/WebKit/LayoutTests/fast/images/script-tests/cmyk-jpeg-with-color-profile.js b/third_party/WebKit/LayoutTests/fast/images/script-tests/cmyk-jpeg-with-color-profile.js
deleted file mode 100644
index 9b5ce3492e41af291661ee32cc165c2801731259..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/images/script-tests/cmyk-jpeg-with-color-profile.js
+++ /dev/null
@@ -1,46 +0,0 @@
-description("Test that we can render a CMYK JPEG without color corruption.");
-
-// This is an async test because it has to wait for WebKit to load an image.
-jsTestIsAsync = true;
-
-// The colors used for verifying the test results.
-var red = 0, green = 0, blue = 0, alpha = 0;
-
-// Create a canvas element. This element is used for pasting a CMYK JPEG and
-// reading its pixels.
-var canvas = document.createElement("canvas");
-canvas.width = 64;
-canvas.height = 64;
-
-// Create an image object and load a CMYK JPEG.
-var image = new Image();
-image.onload = function() {
- // Paste the loaded JPEG ('resources/cmyk-jpeg.jpg') to the canvas.
- var context = canvas.getContext("2d");
- context.drawImage(image, 0, 0);
-
- // Read the pixels in the canvas and calculate their avarage values.
- // (DumpRenderTree always allows to read them.)
- var data = context.getImageData(0, 0, canvas.width, canvas.height);
- var pixels = canvas.width * canvas.height;
- for (var i = 0; i < pixels * 4; i += 4) {
- red += data.data[i + 0];
- green += data.data[i + 1];
- blue += data.data[i + 2];
- alpha += data.data[i + 3];
- }
- red /= pixels;
- green /= pixels;
- blue /= pixels;
- alpha /= pixels;
-
- // Even though the output colors depend on color-profiles (i.e. they depend
- // on devices), green must be the most prominent color because the source
- // image only consists of green. So, we test it.
- shouldBeTrue("green > red");
- shouldBeTrue("green > blue");
-
- // Notify this test has been finished.
- finishJSTest();
-}
-image.src = "resources/cmyk-jpeg.jpg";
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/images/script-tests/border.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698