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

Unified Diff: ui/views/mus/screen_mus_unittest.cc

Issue 1903003002: mus/views: Fix creating gfx::Display in high-dpi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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/views/mus/screen_mus.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/screen_mus_unittest.cc
diff --git a/ui/views/mus/screen_mus_unittest.cc b/ui/views/mus/screen_mus_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fe80a72baa52da4eee32b9dd3c859d08f5faa3e8
--- /dev/null
+++ b/ui/views/mus/screen_mus_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/mus/screen_mus.h"
+
+#include "base/command_line.h"
+#include "ui/gfx/screen.h"
+#include "ui/gfx/switches.h"
+#include "ui/views/mus/window_manager_connection.h"
+#include "ui/views/test/scoped_views_test_helper.h"
+#include "ui/views/test/views_test_base.h"
+
+namespace views {
+namespace {
+
+TEST(ScreenMusTest, ConsistentDisplayInHighDPI) {
+ base::MessageLoop message_loop(base::MessageLoop::TYPE_UI);
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kForceDeviceScaleFactor, "2");
+ ScopedViewsTestHelper test_helper;
+ gfx::Screen* screen = gfx::Screen::GetScreen();
+ std::vector<gfx::Display> displays = screen->GetAllDisplays();
+ ASSERT_FALSE(displays.empty());
+ for (const gfx::Display& display : displays) {
+ EXPECT_EQ(2.f, display.device_scale_factor());
+ EXPECT_EQ(display.work_area(), display.bounds());
+ }
+}
+
+} // namespace
+} // namespace views
« no previous file with comments | « ui/views/mus/screen_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698