| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/wm/window_util.h" | 5 #include "ash/wm/window_util.h" |
| 6 | 6 |
| 7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 "210,60 100x100", | 69 "210,60 100x100", |
| 70 GetAdjustedBounds(visible_bounds_right, gfx::Rect(210, 60, 150, 150))); | 70 GetAdjustedBounds(visible_bounds_right, gfx::Rect(210, 60, 150, 150))); |
| 71 EXPECT_EQ("125,50 100x100", | 71 EXPECT_EQ("125,50 100x100", |
| 72 GetAdjustedBounds(visible_bounds_right, gfx::Rect(0, 0, 150, 150))); | 72 GetAdjustedBounds(visible_bounds_right, gfx::Rect(0, 0, 150, 150))); |
| 73 EXPECT_EQ("275,50 100x100", GetAdjustedBounds(visible_bounds_right, | 73 EXPECT_EQ("275,50 100x100", GetAdjustedBounds(visible_bounds_right, |
| 74 gfx::Rect(300, 20, 150, 150))); | 74 gfx::Rect(300, 20, 150, 150))); |
| 75 EXPECT_EQ( | 75 EXPECT_EQ( |
| 76 "125,125 100x100", | 76 "125,125 100x100", |
| 77 GetAdjustedBounds(visible_bounds_right, gfx::Rect(-100, 150, 150, 150))); | 77 GetAdjustedBounds(visible_bounds_right, gfx::Rect(-100, 150, 150, 150))); |
| 78 | 78 |
| 79 // Make sure that the window smaller than minimum visibility is fully visible. |
| 80 EXPECT_EQ("200,140 20x10", GetAdjustedBounds(visible_bounds_right, |
| 81 gfx::Rect(-100, 150, 20, 10))); |
| 82 |
| 79 const gfx::Rect visible_bounds_left(-200, -50, 100, 100); | 83 const gfx::Rect visible_bounds_left(-200, -50, 100, 100); |
| 80 EXPECT_EQ( | 84 EXPECT_EQ( |
| 81 "-190,-40 90x90", | 85 "-190,-40 90x90", |
| 82 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-190, -40, 90, 90))); | 86 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-190, -40, 90, 90))); |
| 83 EXPECT_EQ( | 87 EXPECT_EQ( |
| 84 "-190,-40 100x100", | 88 "-190,-40 100x100", |
| 85 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-190, -40, 150, 150))); | 89 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-190, -40, 150, 150))); |
| 86 EXPECT_EQ( | 90 EXPECT_EQ( |
| 87 "-250,-40 100x100", | 91 "-250,-40 100x100", |
| 88 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-250, -40, 150, 150))); | 92 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-250, -40, 150, 150))); |
| 89 EXPECT_EQ( | 93 EXPECT_EQ( |
| 90 "-275,-50 100x100", | 94 "-275,-50 100x100", |
| 91 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-400, -60, 150, 150))); | 95 GetAdjustedBounds(visible_bounds_left, gfx::Rect(-400, -60, 150, 150))); |
| 92 EXPECT_EQ("-125,0 100x100", | 96 EXPECT_EQ("-125,0 100x100", |
| 93 GetAdjustedBounds(visible_bounds_left, gfx::Rect(0, 0, 150, 150))); | 97 GetAdjustedBounds(visible_bounds_left, gfx::Rect(0, 0, 150, 150))); |
| 98 |
| 99 // Make sure that the window smaller than minimum visibility is fully visible. |
| 100 EXPECT_EQ("-120,40 20x10", GetAdjustedBounds(visible_bounds_left, |
| 101 gfx::Rect(-100, 150, 20, 10))); |
| 94 } | 102 } |
| 95 | 103 |
| 96 } // namespace ash | 104 } // namespace ash |
| OLD | NEW |