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

Unified Diff: ui/gfx/monitor_unittest.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 8 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
Index: ui/gfx/monitor_unittest.cc
diff --git a/ui/gfx/monitor_unittest.cc b/ui/gfx/monitor_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b3a250953b83cde8e8823085158951f63dfd252c
--- /dev/null
+++ b/ui/gfx/monitor_unittest.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 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/monitor.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/insets.h"
+
+namespace {
+
+TEST(MonitorTest, WorkArea) {
+ gfx::Monitor monitor(gfx::Rect(0, 0, 100, 100));
+ EXPECT_EQ("0,0 100x100", monitor.work_area().ToString());
+
+ monitor.set_work_area(gfx::Rect(3, 4, 90, 80));
+ EXPECT_EQ("3,4 90x80", monitor.work_area().ToString());
+
+ monitor.SetBoundsAndUpdateWorkArea(gfx::Rect(10, 20, 50, 50));
+ EXPECT_EQ("13,24 40x30", monitor.work_area().ToString());
+
+ monitor.SetSizeAndUpdateWorkArea(gfx::Size(200, 200));
+ EXPECT_EQ("13,24 190x180", monitor.work_area().ToString());
+
+ monitor.UpdateWorkAreaWithInsets(gfx::Insets(3, 4, 5, 6));
+ EXPECT_EQ("14,23 190x192", monitor.work_area().ToString());
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698