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_controller.h" | 5 #include "ash/display/display_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_layout_store.h" | 9 #include "ash/display/display_layout_store.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 UpdateDisplay("400x500*2,300x300"); | 648 UpdateDisplay("400x500*2,300x300"); |
649 EXPECT_EQ(1, observer.CountAndReset()); | 649 EXPECT_EQ(1, observer.CountAndReset()); |
650 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 650 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
651 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 651 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
652 ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); | 652 ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays()); |
653 EXPECT_EQ("0,0 200x250", GetPrimaryDisplay().bounds().ToString()); | 653 EXPECT_EQ("0,0 200x250", GetPrimaryDisplay().bounds().ToString()); |
654 EXPECT_EQ("0,250 300x300", GetSecondaryDisplay().bounds().ToString()); | 654 EXPECT_EQ("0,250 300x300", GetSecondaryDisplay().bounds().ToString()); |
655 | 655 |
656 // No change | 656 // No change |
657 UpdateDisplay("400x500*2,300x300"); | 657 UpdateDisplay("400x500*2,300x300"); |
658 // We still call into Pre/PostDisplayConfigurationChange(). | 658 EXPECT_EQ(0, observer.CountAndReset()); |
659 EXPECT_EQ(1, observer.CountAndReset()); | |
660 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 659 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
661 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); | 660 EXPECT_EQ(0, observer.GetActivationChangedCountAndReset()); |
662 | 661 |
663 // Rotation | 662 // Rotation |
664 observer.GetRotationChangedCountAndReset(); // we only want to reset. | 663 observer.GetRotationChangedCountAndReset(); // we only want to reset. |
665 int64 primary_id = GetPrimaryDisplay().id(); | 664 int64 primary_id = GetPrimaryDisplay().id(); |
666 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90); | 665 display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90); |
667 EXPECT_EQ(1, observer.GetRotationChangedCountAndReset()); | 666 EXPECT_EQ(1, observer.GetRotationChangedCountAndReset()); |
668 EXPECT_EQ(1, observer.CountAndReset()); | 667 EXPECT_EQ(1, observer.CountAndReset()); |
669 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); | 668 EXPECT_EQ(0, observer.GetFocusChangedCountAndReset()); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); | 1334 EXPECT_EQ("aura_root_x", GetXWindowName(secondary->GetHost())); |
1336 | 1335 |
1337 // Switching back to single display. | 1336 // Switching back to single display. |
1338 UpdateDisplay("300x400"); | 1337 UpdateDisplay("300x400"); |
1339 EXPECT_EQ("aura_root_0", GetXWindowName( | 1338 EXPECT_EQ("aura_root_0", GetXWindowName( |
1340 Shell::GetPrimaryRootWindow()->GetHost())); | 1339 Shell::GetPrimaryRootWindow()->GetHost())); |
1341 } | 1340 } |
1342 #endif | 1341 #endif |
1343 | 1342 |
1344 } // namespace ash | 1343 } // namespace ash |
OLD | NEW |