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

Unified Diff: ui/display/display_unittest.cc

Issue 2742383006: Display: set color_depth and depth_per_component value based on kEnableHDROutput (Closed)
Patch Set: rebase Created 3 years, 9 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
« no previous file with comments | « ui/display/display_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/display_unittest.cc
diff --git a/ui/display/display_unittest.cc b/ui/display/display_unittest.cc
index 62f6b58dfcf8074a470ca3327a99af5e3a0bae3c..dee754b4d96ecee7153a82b64290f65decd9c0b9 100644
--- a/ui/display/display_unittest.cc
+++ b/ui/display/display_unittest.cc
@@ -5,6 +5,7 @@
#include "ui/display/display.h"
#include "base/command_line.h"
+#include "base/test/scoped_command_line.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/display_switches.h"
#include "ui/gfx/geometry/insets.h"
@@ -52,14 +53,32 @@ TEST(DisplayTest, Scale) {
// https://crbug.com/517944
TEST(DisplayTest, ForcedDeviceScaleFactorByCommandLine) {
+ base::test::ScopedCommandLine scoped_command_line;
+ base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine();
+
Display::ResetForceDeviceScaleFactorForTesting();
- // Look ma, no value!
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kForceDeviceScaleFactor);
+ command_line->AppendSwitch(switches::kForceDeviceScaleFactor);
EXPECT_EQ(1, Display::GetForcedDeviceScaleFactor());
Display::ResetForceDeviceScaleFactorForTesting();
}
+TEST(DisplayTest, DisplayHDRValues) {
+ base::test::ScopedCommandLine scoped_command_line;
+ base::CommandLine* command_line = scoped_command_line.GetProcessCommandLine();
+ {
+ Display display;
+ EXPECT_EQ(24, display.color_depth());
+ EXPECT_EQ(8, display.depth_per_component());
+ }
+
+ command_line->AppendSwitch(switches::kEnableHDR);
+ {
+ Display display;
+ EXPECT_EQ(48, display.color_depth());
+ EXPECT_EQ(16, display.depth_per_component());
+ }
+}
+
} // namespace display
« no previous file with comments | « ui/display/display_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698