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

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

Issue 14142011: Round near zero value in rotation matrix to zero (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/display/display_controller.cc ('k') | no next file » | 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/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
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
OLDNEW
« no previous file with comments | « ash/display/display_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698