OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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. |
| 4 |
| 5 #include "ui/gfx/monitor.h" |
| 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/gfx/insets.h" |
| 9 |
| 10 namespace { |
| 11 |
| 12 TEST(MonitorTest, WorkArea) { |
| 13 gfx::Monitor monitor(0, gfx::Rect(0, 0, 100, 100)); |
| 14 EXPECT_EQ("0,0 100x100", monitor.work_area().ToString()); |
| 15 |
| 16 monitor.set_work_area(gfx::Rect(3, 4, 90, 80)); |
| 17 EXPECT_EQ("3,4 90x80", monitor.work_area().ToString()); |
| 18 |
| 19 monitor.SetBoundsAndUpdateWorkArea(gfx::Rect(10, 20, 50, 50)); |
| 20 EXPECT_EQ("13,24 40x30", monitor.work_area().ToString()); |
| 21 |
| 22 monitor.SetSizeAndUpdateWorkArea(gfx::Size(200, 200)); |
| 23 EXPECT_EQ("13,24 190x180", monitor.work_area().ToString()); |
| 24 |
| 25 monitor.UpdateWorkAreaWithInsets(gfx::Insets(3, 4, 5, 6)); |
| 26 EXPECT_EQ("14,23 190x192", monitor.work_area().ToString()); |
| 27 } |
| 28 |
| 29 } |
OLD | NEW |