| 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 "base/test/scoped_command_line.h" | 8 #include "base/test/scoped_command_line.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/display/display_switches.h" | 10 #include "ui/display/display_switches.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine(); | 57 base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine(); |
| 58 | 58 |
| 59 Display::ResetForceDeviceScaleFactorForTesting(); | 59 Display::ResetForceDeviceScaleFactorForTesting(); |
| 60 | 60 |
| 61 command_line->AppendSwitch(switches::kForceDeviceScaleFactor); | 61 command_line->AppendSwitch(switches::kForceDeviceScaleFactor); |
| 62 | 62 |
| 63 EXPECT_EQ(1, Display::GetForcedDeviceScaleFactor()); | 63 EXPECT_EQ(1, Display::GetForcedDeviceScaleFactor()); |
| 64 Display::ResetForceDeviceScaleFactorForTesting(); | 64 Display::ResetForceDeviceScaleFactorForTesting(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 TEST(DisplayTest, ForcedDeviceScaleFactor) { |
| 68 Display::SetForceDeviceScaleFactor(2); |
| 69 |
| 70 EXPECT_EQ(2, Display::GetForcedDeviceScaleFactor()); |
| 71 Display::ResetForceDeviceScaleFactorForTesting(); |
| 72 } |
| 73 |
| 67 TEST(DisplayTest, DisplayHDRValues) { | 74 TEST(DisplayTest, DisplayHDRValues) { |
| 68 base::test::ScopedCommandLine scoped_command_line; | 75 base::test::ScopedCommandLine scoped_command_line; |
| 69 base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine(); | 76 base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine(); |
| 70 { | 77 { |
| 71 Display display; | 78 Display display; |
| 72 EXPECT_EQ(24, display.color_depth()); | 79 EXPECT_EQ(24, display.color_depth()); |
| 73 EXPECT_EQ(8, display.depth_per_component()); | 80 EXPECT_EQ(8, display.depth_per_component()); |
| 74 } | 81 } |
| 75 | 82 |
| 76 command_line->AppendSwitch(switches::kEnableHDR); | 83 command_line->AppendSwitch(switches::kEnableHDR); |
| 77 { | 84 { |
| 78 Display display; | 85 Display display; |
| 79 EXPECT_EQ(48, display.color_depth()); | 86 EXPECT_EQ(48, display.color_depth()); |
| 80 EXPECT_EQ(16, display.depth_per_component()); | 87 EXPECT_EQ(16, display.depth_per_component()); |
| 81 } | 88 } |
| 82 } | 89 } |
| 83 | 90 |
| 84 } // namespace display | 91 } // namespace display |
| OLD | NEW |