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

Side by Side Diff: ui/gfx/color_profile_win_unittest.cc

Issue 1796293003: Image decode color: Push color profile from browser to renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows tests Created 4 years, 9 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 unified diff | Download patch
« ui/gfx/color_profile_win.cc ('K') | « ui/gfx/color_profile_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/gfx/color_profile.h" 5 #include "ui/gfx/color_profile.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace { 9 namespace {
10 10
11 bool TestColorProfileUsingScreenBounds(const gfx::Rect& bounds) { 11 bool TestColorProfileUsingScreenBounds(const gfx::Rect& bounds) {
12 std::vector<char> color_profile; 12 std::vector<char> color_profile;
13 return gfx::GetDisplayColorProfile(bounds, &color_profile); 13 return gfx::GetDisplayColorProfile(bounds, &color_profile);
14 } 14 }
15 15
16 TEST(ColorProfileTest, GetDisplayColorProfile) { 16 TEST(ColorProfileTest, GetDisplayColorProfile) {
17 gfx::UpdateDisplayColorProfileCache();
17 const gfx::Rect in_screen_bounds(10, 10, 100, 100); 18 const gfx::Rect in_screen_bounds(10, 10, 100, 100);
18 EXPECT_TRUE(TestColorProfileUsingScreenBounds(in_screen_bounds)); 19 EXPECT_TRUE(TestColorProfileUsingScreenBounds(in_screen_bounds));
19 } 20 }
20 21
21 TEST(ColorProfileTest, GetDisplayColorProfileForOffScreenBounds) { 22 TEST(ColorProfileTest, GetDisplayColorProfileForOffScreenBounds) {
23 gfx::UpdateDisplayColorProfileCache();
22 const gfx::Rect off_screen_bounds(-100, -100, 10, 10); 24 const gfx::Rect off_screen_bounds(-100, -100, 10, 10);
23 EXPECT_FALSE(TestColorProfileUsingScreenBounds(off_screen_bounds)); 25 EXPECT_FALSE(TestColorProfileUsingScreenBounds(off_screen_bounds));
24 } 26 }
25 27
26 TEST(ColorProfileTest, GetDisplayColorProfileForEmptyBounds) { 28 TEST(ColorProfileTest, GetDisplayColorProfileForEmptyBounds) {
29 gfx::UpdateDisplayColorProfileCache();
27 const gfx::Rect empty_screen_bounds(10, 10, 0, 0); 30 const gfx::Rect empty_screen_bounds(10, 10, 0, 0);
28 EXPECT_TRUE(empty_screen_bounds.IsEmpty()); 31 EXPECT_TRUE(empty_screen_bounds.IsEmpty());
29 EXPECT_FALSE(TestColorProfileUsingScreenBounds(empty_screen_bounds)); 32 EXPECT_FALSE(TestColorProfileUsingScreenBounds(empty_screen_bounds));
30 } 33 }
31 34
32 } // namespace 35 } // namespace
OLDNEW
« ui/gfx/color_profile_win.cc ('K') | « ui/gfx/color_profile_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698