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/display/display_info.h" | 7 #include "ash/display/display_info.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/launcher/launcher.h" | 9 #include "ash/launcher/launcher.h" |
10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 EXPECT_EQ("5,15", event_handler.GetLocationAndReset()); | 746 EXPECT_EQ("5,15", event_handler.GetLocationAndReset()); |
747 | 747 |
748 display_controller->ClearCustomOverscanInsets(display1.id()); | 748 display_controller->ClearCustomOverscanInsets(display1.id()); |
749 EXPECT_EQ("0,0 120x200", root_windows[0]->bounds().ToString()); | 749 EXPECT_EQ("0,0 120x200", root_windows[0]->bounds().ToString()); |
750 EXPECT_EQ("120,0 150x200", | 750 EXPECT_EQ("120,0 150x200", |
751 ScreenAsh::GetSecondaryDisplay().bounds().ToString()); | 751 ScreenAsh::GetSecondaryDisplay().bounds().ToString()); |
752 | 752 |
753 generator.MoveMouseToInHost(30, 20); | 753 generator.MoveMouseToInHost(30, 20); |
754 EXPECT_EQ("30,20", event_handler.GetLocationAndReset()); | 754 EXPECT_EQ("30,20", event_handler.GetLocationAndReset()); |
755 | 755 |
| 756 |
| 757 // Make sure the root window transformer uses correct scale |
| 758 // factor when swapping display. Test crbug.com/253690. |
| 759 UpdateDisplay("400x300*2,600x400/o"); |
| 760 root_windows = Shell::GetAllRootWindows(); |
| 761 gfx::Point point; |
| 762 Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(point); |
| 763 EXPECT_EQ("15,10", point.ToString()); |
| 764 |
| 765 display_controller->SwapPrimaryDisplay(); |
| 766 point.SetPoint(0, 0); |
| 767 Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(point); |
| 768 EXPECT_EQ("15,10", point.ToString()); |
| 769 |
756 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 770 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
757 } | 771 } |
758 | 772 |
759 TEST_F(DisplayControllerTest, Rotate) { | 773 TEST_F(DisplayControllerTest, Rotate) { |
760 if (!SupportsMultipleDisplays()) | 774 if (!SupportsMultipleDisplays()) |
761 return; | 775 return; |
762 | 776 |
763 DisplayController* display_controller = | 777 DisplayController* display_controller = |
764 Shell::GetInstance()->display_controller(); | 778 Shell::GetInstance()->display_controller(); |
765 internal::DisplayManager* display_manager = | 779 internal::DisplayManager* display_manager = |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 EXPECT_EQ("aura_root_x", GetXWindowName(secondary)); | 992 EXPECT_EQ("aura_root_x", GetXWindowName(secondary)); |
979 | 993 |
980 // Switching back to single display. | 994 // Switching back to single display. |
981 UpdateDisplay("300x400"); | 995 UpdateDisplay("300x400"); |
982 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow())); | 996 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow())); |
983 } | 997 } |
984 #endif | 998 #endif |
985 | 999 |
986 } // namespace test | 1000 } // namespace test |
987 } // namespace ash | 1001 } // namespace ash |
OLD | NEW |