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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 | 886 |
887 MoveMouseToInHostCoord(root_windows[0], 0, 0); | 887 MoveMouseToInHostCoord(root_windows[0], 0, 0); |
888 EXPECT_EQ("0,449", event_handler.GetLocationAndReset()); | 888 EXPECT_EQ("0,449", event_handler.GetLocationAndReset()); |
889 MoveMouseToInHostCoord(root_windows[0], 599, 0); | 889 MoveMouseToInHostCoord(root_windows[0], 599, 0); |
890 EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); | 890 EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); |
891 MoveMouseToInHostCoord(root_windows[0], 599, 399); | 891 MoveMouseToInHostCoord(root_windows[0], 599, 399); |
892 EXPECT_EQ("299,0", event_handler.GetLocationAndReset()); | 892 EXPECT_EQ("299,0", event_handler.GetLocationAndReset()); |
893 MoveMouseToInHostCoord(root_windows[0], 0, 399); | 893 MoveMouseToInHostCoord(root_windows[0], 0, 399); |
894 EXPECT_EQ("299,449", event_handler.GetLocationAndReset()); | 894 EXPECT_EQ("299,449", event_handler.GetLocationAndReset()); |
895 | 895 |
| 896 UpdateDisplay("600x400*2/u@1.5"); |
| 897 display1 = Shell::GetScreen()->GetPrimaryDisplay(); |
| 898 root_windows = Shell::GetAllRootWindows(); |
| 899 EXPECT_EQ("0,0 450x300", display1.bounds().ToString()); |
| 900 EXPECT_EQ("0,0 450x300", root_windows[0]->bounds().ToString()); |
| 901 EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); |
| 902 |
| 903 MoveMouseToInHostCoord(root_windows[0], 0, 0); |
| 904 EXPECT_EQ("449,299", event_handler.GetLocationAndReset()); |
| 905 MoveMouseToInHostCoord(root_windows[0], 599, 0); |
| 906 EXPECT_EQ("0,299", event_handler.GetLocationAndReset()); |
| 907 MoveMouseToInHostCoord(root_windows[0], 599, 399); |
| 908 EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); |
| 909 MoveMouseToInHostCoord(root_windows[0], 0, 399); |
| 910 EXPECT_EQ("449,0", event_handler.GetLocationAndReset()); |
| 911 |
| 912 UpdateDisplay("600x400*2/l@1.5"); |
| 913 display1 = Shell::GetScreen()->GetPrimaryDisplay(); |
| 914 root_windows = Shell::GetAllRootWindows(); |
| 915 EXPECT_EQ("0,0 300x450", display1.bounds().ToString()); |
| 916 EXPECT_EQ("0,0 300x450", root_windows[0]->bounds().ToString()); |
| 917 EXPECT_EQ(1.5f, GetStoredUIScale(display1.id())); |
| 918 |
| 919 MoveMouseToInHostCoord(root_windows[0], 0, 0); |
| 920 EXPECT_EQ("299,0", event_handler.GetLocationAndReset()); |
| 921 MoveMouseToInHostCoord(root_windows[0], 599, 0); |
| 922 EXPECT_EQ("299,449", event_handler.GetLocationAndReset()); |
| 923 MoveMouseToInHostCoord(root_windows[0], 599, 399); |
| 924 EXPECT_EQ("0,449", event_handler.GetLocationAndReset()); |
| 925 MoveMouseToInHostCoord(root_windows[0], 0, 399); |
| 926 EXPECT_EQ("0,0", event_handler.GetLocationAndReset()); |
| 927 |
896 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 928 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
897 } | 929 } |
898 | 930 |
899 } // namespace test | 931 } // namespace test |
900 } // namespace ash | 932 } // namespace ash |
OLD | NEW |