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 |
index 9b5ce3492e41af291661ee32cc165c2801731259..a34d339e78090e865fa20ca91192c35607027450 100644 |
--- 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 |
@@ -1,20 +1,14 @@ |
-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; |
- |
+async_test(function(t) { |
// 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() { |
+image.onload = t.step_func_done(function() { |
// Paste the loaded JPEG ('resources/cmyk-jpeg.jpg') to the canvas. |
var context = canvas.getContext("2d"); |
context.drawImage(image, 0, 0); |
@@ -37,10 +31,9 @@ image.onload = function() { |
// 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"); |
+ assert_greater_than(green, red); |
+ assert_greater_than(green, blue); |
- // Notify this test has been finished. |
- finishJSTest(); |
-} |
+}); |
image.src = "resources/cmyk-jpeg.jpg"; |
+}); |