Fix testGetVisitedHistoryCallbackAfterDestroy
[chromium-blink-merge.git] / ui / gfx / color_profile_win_unittest.cc
blob604ee36201b291e0a7a196466acf2e2dcec7774f
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
3 // found in the LICENSE file.
5 #include "ui/gfx/color_profile.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 namespace {
11 bool TestColorProfileUsingScreenBounds(const gfx::Rect& bounds) {
12 std::vector<char> color_profile;
13 return gfx::GetDisplayColorProfile(bounds, &color_profile);
16 TEST(ColorProfileTest, GetDisplayColorProfile) {
17 const gfx::Rect in_screen_bounds(10, 10, 100, 100);
18 EXPECT_TRUE(TestColorProfileUsingScreenBounds(in_screen_bounds));
21 TEST(ColorProfileTest, GetDisplayColorProfileForOffScreenBounds) {
22 const gfx::Rect off_screen_bounds(-100, -100, 10, 10);
23 EXPECT_FALSE(TestColorProfileUsingScreenBounds(off_screen_bounds));
26 TEST(ColorProfileTest, GetDisplayColorProfileForEmptyBounds) {
27 const gfx::Rect empty_screen_bounds(10, 10, 0, 0);
28 EXPECT_TRUE(empty_screen_bounds.IsEmpty());
29 EXPECT_FALSE(TestColorProfileUsingScreenBounds(empty_screen_bounds));
32 } // namespace