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

Unified Diff: ui/aura/test/aura_test_helper.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 | « no previous file | ui/views/mus/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/aura_test_helper.cc
diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc
index 2d679e59f184c7f2248e374f1e65832776bb6b06..10c45ca333b9ed6be2460f55055a3180c0b51db4 100644
--- a/ui/aura/test/aura_test_helper.cc
+++ b/ui/aura/test/aura_test_helper.cc
@@ -67,9 +67,12 @@ void AuraTestHelper::SetUp(ui::ContextFactory* context_factory) {
ui::InitializeInputMethodForTesting();
- gfx::Size host_size(800, 600);
+ gfx::Screen* screen = gfx::Screen::GetScreen();
+ gfx::Size host_size(screen ? screen->GetPrimaryDisplay().GetSizeInPixel()
+ : gfx::Size(800, 600));
test_screen_.reset(TestScreen::Create(host_size));
- gfx::Screen::SetScreenInstance(test_screen_.get());
+ if (!screen)
+ gfx::Screen::SetScreenInstance(test_screen_.get());
host_.reset(test_screen_->CreateHostForPrimaryDisplay());
focus_client_.reset(new TestFocusClient);
« no previous file with comments | « no previous file | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698