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/display/display.h" | 5 #include "ui/display/display.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/display/display_switches.h" |
9 #include "ui/gfx/geometry/insets.h" | 10 #include "ui/gfx/geometry/insets.h" |
10 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
12 #include "ui/gfx/switches.h" | |
13 | 13 |
14 namespace display { | 14 namespace display { |
15 | 15 |
16 TEST(DisplayTest, WorkArea) { | 16 TEST(DisplayTest, WorkArea) { |
17 Display display(0, gfx::Rect(0, 0, 100, 100)); | 17 Display display(0, gfx::Rect(0, 0, 100, 100)); |
18 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); | 18 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); |
19 EXPECT_EQ("0,0 100x100", display.work_area().ToString()); | 19 EXPECT_EQ("0,0 100x100", display.work_area().ToString()); |
20 | 20 |
21 display.set_work_area(gfx::Rect(3, 4, 90, 80)); | 21 display.set_work_area(gfx::Rect(3, 4, 90, 80)); |
22 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); | 22 EXPECT_EQ("0,0 100x100", display.bounds().ToString()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Look ma, no value! | 57 // Look ma, no value! |
58 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 58 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
59 switches::kForceDeviceScaleFactor); | 59 switches::kForceDeviceScaleFactor); |
60 | 60 |
61 EXPECT_EQ(1, Display::GetForcedDeviceScaleFactor()); | 61 EXPECT_EQ(1, Display::GetForcedDeviceScaleFactor()); |
62 Display::ResetForceDeviceScaleFactorForTesting(); | 62 Display::ResetForceDeviceScaleFactorForTesting(); |
63 } | 63 } |
64 | 64 |
65 } // namespace display | 65 } // namespace display |
OLD | NEW |