OLD | NEW |
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 "ash/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 EXPECT_EQ(1u, changed().size()); | 367 EXPECT_EQ(1u, changed().size()); |
368 EXPECT_EQ(display2_id, changed()[0].id()); | 368 EXPECT_EQ(display2_id, changed()[0].id()); |
369 | 369 |
370 reset(); | 370 reset(); |
371 display_manager()->SetOverscanInsets(display2_id, gfx::Insets(0, 0, 0, 0)); | 371 display_manager()->SetOverscanInsets(display2_id, gfx::Insets(0, 0, 0, 0)); |
372 EXPECT_EQ(1u, changed().size()); | 372 EXPECT_EQ(1u, changed().size()); |
373 EXPECT_EQ(display2_id, changed()[0].id()); | 373 EXPECT_EQ(display2_id, changed()[0].id()); |
374 } | 374 } |
375 | 375 |
376 TEST_F(DisplayManagerTest, TestDeviceScaleOnlyChange) { | 376 TEST_F(DisplayManagerTest, TestDeviceScaleOnlyChange) { |
| 377 if (!SupportsHostWindowResize()) |
| 378 return; |
| 379 |
377 UpdateDisplay("1000x600"); | 380 UpdateDisplay("1000x600"); |
378 EXPECT_EQ(1, | 381 EXPECT_EQ(1, |
379 Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor()); | 382 Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor()); |
380 EXPECT_EQ("1000x600", | 383 EXPECT_EQ("1000x600", |
381 Shell::GetPrimaryRootWindow()->bounds().size().ToString()); | 384 Shell::GetPrimaryRootWindow()->bounds().size().ToString()); |
382 UpdateDisplay("1000x600*2"); | 385 UpdateDisplay("1000x600*2"); |
383 EXPECT_EQ(2, | 386 EXPECT_EQ(2, |
384 Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor()); | 387 Shell::GetPrimaryRootWindow()->compositor()->device_scale_factor()); |
385 EXPECT_EQ("500x300", | 388 EXPECT_EQ("500x300", |
386 Shell::GetPrimaryRootWindow()->bounds().size().ToString()); | 389 Shell::GetPrimaryRootWindow()->bounds().size().ToString()); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 UpdateDisplay("400x600/o,600x800/o"); | 998 UpdateDisplay("400x600/o,600x800/o"); |
996 EXPECT_FALSE(display_observer.changed_and_reset()); | 999 EXPECT_FALSE(display_observer.changed_and_reset()); |
997 EXPECT_EQ("400x600", test_api.GetRootWindow()->bounds().size().ToString()); | 1000 EXPECT_EQ("400x600", test_api.GetRootWindow()->bounds().size().ToString()); |
998 EXPECT_EQ("600x800", GetMirroredDisplay().size().ToString()); | 1001 EXPECT_EQ("600x800", GetMirroredDisplay().size().ToString()); |
999 | 1002 |
1000 Shell::GetScreen()->RemoveObserver(&display_observer); | 1003 Shell::GetScreen()->RemoveObserver(&display_observer); |
1001 } | 1004 } |
1002 | 1005 |
1003 } // namespace internal | 1006 } // namespace internal |
1004 } // namespace ash | 1007 } // namespace ash |
OLD | NEW |