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

Unified Diff: ui/gfx/color_profile_win_unittest.cc

Issue 312723003: ui/gfx/color_profile: implement GetDisplayColorProfile on win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor code name changes. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_profile_win.cc ('k') | ui/ui_unittests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_profile_win_unittest.cc
diff --git a/ui/gfx/color_profile_win_unittest.cc b/ui/gfx/color_profile_win_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f6104f7c5f89ce23588c64aa9a032418b5930320
--- /dev/null
+++ b/ui/gfx/color_profile_win_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/color_profile.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+bool TestColorProfileUsingScreenBounds(const gfx::Rect& bounds) {
+ std::vector<char> color_profile;
+ return gfx::GetDisplayColorProfile(bounds, &color_profile);
+}
+
+TEST(ColorProfileTest, GetDisplayColorProfile) {
+ const gfx::Rect in_screen_bounds(10, 10, 100, 100);
sky 2014/06/10 15:58:59 How do you know any of the bounds you're using in
+ EXPECT_TRUE(TestColorProfileUsingScreenBounds(in_screen_bounds));
+}
+
+TEST(ColorProfileTest, GetDisplayColorProfileForOffScreenBounds) {
+ const gfx::Rect off_screen_bounds(-100, -100, 10, 10);
+ EXPECT_FALSE(TestColorProfileUsingScreenBounds(off_screen_bounds));
+}
+
+TEST(ColorProfileTest, GetDisplayColorProfileForEmptyBounds) {
+ const gfx::Rect empty_screen_bounds(10, 10, 0, 0);
+ EXPECT_TRUE(empty_screen_bounds.IsEmpty());
+ EXPECT_FALSE(TestColorProfileUsingScreenBounds(empty_screen_bounds));
+}
+
+} // namespace
« no previous file with comments | « ui/gfx/color_profile_win.cc ('k') | ui/ui_unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698