| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "ui/gfx/color_space.h" | 7 #include "ui/gfx/color_space.h" |
| 8 #include "ui/gfx/icc_profile.h" | 8 #include "ui/gfx/icc_profile.h" |
| 9 #include "ui/gfx/test/icc_profiles.h" | 9 #include "ui/gfx/test/icc_profiles.h" |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 ColorSpace color_space_from_sk_color_space = | 38 ColorSpace color_space_from_sk_color_space = |
| 39 ColorSpace::FromSkColorSpace(sk_color_space); | 39 ColorSpace::FromSkColorSpace(sk_color_space); |
| 40 EXPECT_TRUE(color_space == color_space_from_sk_color_space); | 40 EXPECT_TRUE(color_space == color_space_from_sk_color_space); |
| 41 | 41 |
| 42 sk_sp<SkColorSpace> sk_color_space_from_color_space = | 42 sk_sp<SkColorSpace> sk_color_space_from_color_space = |
| 43 color_space.ToSkColorSpace(); | 43 color_space.ToSkColorSpace(); |
| 44 EXPECT_TRUE(SkColorSpace::Equals(sk_color_space.get(), | 44 EXPECT_TRUE(SkColorSpace::Equals(sk_color_space.get(), |
| 45 sk_color_space_from_color_space.get())); | 45 sk_color_space_from_color_space.get())); |
| 46 } | 46 } |
| 47 | 47 |
| 48 TEST(ICCProfile, Equality) { |
| 49 ICCProfile spin_profile = ICCProfileForTestingColorSpin(); |
| 50 ICCProfile adobe_profile = ICCProfileForTestingAdobeRGB(); |
| 51 EXPECT_TRUE(spin_profile == spin_profile); |
| 52 EXPECT_FALSE(spin_profile != spin_profile); |
| 53 EXPECT_FALSE(spin_profile == adobe_profile); |
| 54 EXPECT_TRUE(spin_profile != adobe_profile); |
| 55 |
| 56 gfx::ColorSpace spin_space = spin_profile.GetColorSpace(); |
| 57 gfx::ColorSpace adobe_space = adobe_profile.GetColorSpace(); |
| 58 EXPECT_TRUE(spin_space == spin_space); |
| 59 EXPECT_FALSE(spin_space != spin_space); |
| 60 EXPECT_FALSE(spin_space == adobe_space); |
| 61 EXPECT_TRUE(spin_space != adobe_space); |
| 62 |
| 63 EXPECT_TRUE(spin_profile == ICCProfile::FromColorSpace(spin_space)); |
| 64 EXPECT_FALSE(spin_profile != ICCProfile::FromColorSpace(spin_space)); |
| 65 EXPECT_FALSE(spin_profile == ICCProfile::FromColorSpace(adobe_space)); |
| 66 EXPECT_TRUE(spin_profile != ICCProfile::FromColorSpace(adobe_space)); |
| 67 } |
| 68 |
| 48 } // namespace gfx | 69 } // namespace gfx |
| OLD | NEW |