OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <Cocoa/Cocoa.h> | 5 #include <Cocoa/Cocoa.h> |
| 6 #include <stddef.h> |
6 | 7 |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/macros.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
11 #include "ui/gfx/image/image_png_rep.h" | 13 #include "ui/gfx/image/image_png_rep.h" |
12 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
13 #include "ui/gfx/image/image_skia_util_mac.h" | 15 #include "ui/gfx/image/image_skia_util_mac.h" |
14 #include "ui/gfx/image/image_unittest_util.h" | 16 #include "ui/gfx/image/image_unittest_util.h" |
15 | 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 // Returns true if the structure of |ns_image| matches the structure | 20 // Returns true if the structure of |ns_image| matches the structure |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 gfx::ImageSkia image_skia = gfx::ImageSkiaFromNSImage(ns_image); | 201 gfx::ImageSkia image_skia = gfx::ImageSkiaFromNSImage(ns_image); |
200 EXPECT_TRUE(gt::ArePNGBytesCloseToBitmap( | 202 EXPECT_TRUE(gt::ArePNGBytesCloseToBitmap( |
201 bytes1x, image_skia.GetRepresentation(1.0f).sk_bitmap(), | 203 bytes1x, image_skia.GetRepresentation(1.0f).sk_bitmap(), |
202 gt::MaxColorSpaceConversionColorShift())); | 204 gt::MaxColorSpaceConversionColorShift())); |
203 EXPECT_TRUE(gt::ArePNGBytesCloseToBitmap(bytes2x, | 205 EXPECT_TRUE(gt::ArePNGBytesCloseToBitmap(bytes2x, |
204 image_skia.GetRepresentation(2.0f).sk_bitmap(), | 206 image_skia.GetRepresentation(2.0f).sk_bitmap(), |
205 gt::MaxColorSpaceConversionColorShift())); | 207 gt::MaxColorSpaceConversionColorShift())); |
206 } | 208 } |
207 | 209 |
208 } // namespace | 210 } // namespace |
OLD | NEW |