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

Side by Side Diff: ui/gfx/display_unittest.cc

Issue 1563183008: Added capability on Windows to get the physical dimensions of your attached monitors. Also added th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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 "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/gfx/geometry/insets.h" 9 #include "ui/gfx/geometry/insets.h"
10 #include "ui/gfx/switches.h" 10 #include "ui/gfx/switches.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Display::ResetForceDeviceScaleFactorForTesting(); 55 Display::ResetForceDeviceScaleFactorForTesting();
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 TEST(DisplayTest, PhysicalSize) {
66 Display display;
67 EXPECT_FALSE(display.IsPhysicalSizeAvailable());
68 display.SetPhysicalSizeMm(gfx::Size(420, 69));
69 EXPECT_TRUE(display.IsPhysicalSizeAvailable());
70 gfx::Size size = display.GetPhysicalSizeMm();
71 EXPECT_EQ(420, size.width());
72 EXPECT_EQ(69, size.height());
73 }
74
65 } // namespace 75 } // namespace
66 76
67 } // namespace gfx 77 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698