| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
| 6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
| 8 #include "ui/aura/test/test_window_delegate.h" | 8 #include "ui/aura/test/test_window_delegate.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 &delegate, 1, gfx::Rect(200, 200, 100, 100))); | 35 &delegate, 1, gfx::Rect(200, 200, 100, 100))); |
| 36 | 36 |
| 37 ASSERT_NE(win1->GetRootWindow(), win2->GetRootWindow()); | 37 ASSERT_NE(win1->GetRootWindow(), win2->GetRootWindow()); |
| 38 | 38 |
| 39 EXPECT_EQ(win1.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint( | 39 EXPECT_EQ(win1.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint( |
| 40 gfx::Point(50, 60))); | 40 gfx::Point(50, 60))); |
| 41 EXPECT_EQ(win2.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint( | 41 EXPECT_EQ(win2.get(), display::Screen::GetScreen()->GetWindowAtScreenPoint( |
| 42 gfx::Point(250, 260))); | 42 gfx::Point(250, 260))); |
| 43 } | 43 } |
| 44 | 44 |
| 45 TEST_F(ScreenAshTest, TestSetDeviceScaleFactorForTest) { |
| 46 if (!SupportsMultipleDisplays()) |
| 47 return; |
| 48 UpdateDisplay("800x500"); |
| 49 display::Screen* screen = display::Screen::GetScreen(); |
| 50 screen->SetDeviceScaleFactorForTest(2.0f); |
| 51 |
| 52 EXPECT_EQ(gfx::Size(400, 250), screen->GetPrimaryDisplay().size()); |
| 53 |
| 54 display::Display::ResetForceDeviceScaleFactorForTesting(); |
| 55 } |
| 56 |
| 45 } // namespace ash | 57 } // namespace ash |
| OLD | NEW |