OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/display.h" | 5 #include "ui/gfx/display.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/gfx/insets.h" | 8 #include "ui/gfx/geometry/insets.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 TEST(DisplayTest, WorkArea) { | 12 TEST(DisplayTest, WorkArea) { |
13 gfx::Display display(0, gfx::Rect(0, 0, 100, 100)); | 13 gfx::Display display(0, gfx::Rect(0, 0, 100, 100)); |
14 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); | 14 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); |
15 EXPECT_EQ("0,0 100x100", display.work_area().ToString()); | 15 EXPECT_EQ("0,0 100x100", display.work_area().ToString()); |
16 | 16 |
17 display.set_work_area(gfx::Rect(3, 4, 90, 80)); | 17 display.set_work_area(gfx::Rect(3, 4, 90, 80)); |
18 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); | 18 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); |
(...skipping 21 matching lines...) Expand all Loading... |
40 EXPECT_EQ("0,0 70x70", display.bounds().ToString()); | 40 EXPECT_EQ("0,0 70x70", display.bounds().ToString()); |
41 EXPECT_EQ("10,10 50x50", display.work_area().ToString()); | 41 EXPECT_EQ("10,10 50x50", display.work_area().ToString()); |
42 | 42 |
43 // Scale it back to 1x | 43 // Scale it back to 1x |
44 display.SetScaleAndBounds(1.0f, gfx::Rect(0, 0, 100, 100)); | 44 display.SetScaleAndBounds(1.0f, gfx::Rect(0, 0, 100, 100)); |
45 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); | 45 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); |
46 EXPECT_EQ("10,10 80x80", display.work_area().ToString()); | 46 EXPECT_EQ("10,10 80x80", display.work_area().ToString()); |
47 } | 47 } |
48 | 48 |
49 } | 49 } |
OLD | NEW |