Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: ash/display/display_controller_unittest.cc

Issue 23724024: Refactor TransformPoint{,Reverse}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and resolve conflicts. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 ScreenAsh::GetSecondaryDisplay().bounds().ToString()); 884 ScreenAsh::GetSecondaryDisplay().bounds().ToString());
885 885
886 generator.MoveMouseToInHost(30, 20); 886 generator.MoveMouseToInHost(30, 20);
887 EXPECT_EQ("30,20", event_handler.GetLocationAndReset()); 887 EXPECT_EQ("30,20", event_handler.GetLocationAndReset());
888 888
889 // Make sure the root window transformer uses correct scale 889 // Make sure the root window transformer uses correct scale
890 // factor when swapping display. Test crbug.com/253690. 890 // factor when swapping display. Test crbug.com/253690.
891 UpdateDisplay("400x300*2,600x400/o"); 891 UpdateDisplay("400x300*2,600x400/o");
892 root_windows = Shell::GetAllRootWindows(); 892 root_windows = Shell::GetAllRootWindows();
893 gfx::Point point; 893 gfx::Point point;
894 Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(point); 894 Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(&point);
895 EXPECT_EQ("15,10", point.ToString()); 895 EXPECT_EQ("15,10", point.ToString());
896 896
897 display_controller->SwapPrimaryDisplay(); 897 display_controller->SwapPrimaryDisplay();
898 point.SetPoint(0, 0); 898 point.SetPoint(0, 0);
899 Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(point); 899 Shell::GetAllRootWindows()[1]->GetRootTransform().TransformPoint(&point);
900 EXPECT_EQ("15,10", point.ToString()); 900 EXPECT_EQ("15,10", point.ToString());
901 901
902 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); 902 Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
903 } 903 }
904 904
905 TEST_F(DisplayControllerTest, Rotate) { 905 TEST_F(DisplayControllerTest, Rotate) {
906 if (!SupportsMultipleDisplays()) 906 if (!SupportsMultipleDisplays())
907 return; 907 return;
908 908
909 DisplayController* display_controller = 909 DisplayController* display_controller =
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 EXPECT_EQ("aura_root_0", GetXWindowName(primary)); 1123 EXPECT_EQ("aura_root_0", GetXWindowName(primary));
1124 EXPECT_EQ("aura_root_x", GetXWindowName(secondary)); 1124 EXPECT_EQ("aura_root_x", GetXWindowName(secondary));
1125 1125
1126 // Switching back to single display. 1126 // Switching back to single display.
1127 UpdateDisplay("300x400"); 1127 UpdateDisplay("300x400");
1128 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow())); 1128 EXPECT_EQ("aura_root_0", GetXWindowName(Shell::GetPrimaryRootWindow()));
1129 } 1129 }
1130 #endif 1130 #endif
1131 1131
1132 } // namespace ash 1132 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698