| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/frame/caption_buttons/frame_caption_button_container_view.h" | 5 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 6 | 6 |
| 7 #include "ash/frame/caption_buttons/frame_caption_button.h" | 7 #include "ash/frame/caption_buttons/frame_caption_button.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 return widget; | 69 return widget; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Sets |container| to use arbitrary images for the buttons. Setting the | 72 // Sets |container| to use arbitrary images for the buttons. Setting the |
| 73 // images causes the buttons to have non-empty sizes. | 73 // images causes the buttons to have non-empty sizes. |
| 74 void SetMockImages(FrameCaptionButtonContainerView* container) { | 74 void SetMockImages(FrameCaptionButtonContainerView* container) { |
| 75 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { | 75 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { |
| 76 container->SetButtonImages( | 76 container->SetButtonImages( |
| 77 static_cast<CaptionButtonIcon>(icon), | 77 static_cast<CaptionButtonIcon>(icon), |
| 78 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, | 78 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, |
| 79 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I, | |
| 80 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, | 79 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, |
| 81 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); | 80 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); |
| 82 } | 81 } |
| 83 } | 82 } |
| 84 | 83 |
| 85 // Tests that |leftmost| and |rightmost| are at |container|'s edges. | 84 // Tests that |leftmost| and |rightmost| are at |container|'s edges. |
| 86 bool CheckButtonsAtEdges(FrameCaptionButtonContainerView* container, | 85 bool CheckButtonsAtEdges(FrameCaptionButtonContainerView* container, |
| 87 const ash::FrameCaptionButton& leftmost, | 86 const ash::FrameCaptionButton& leftmost, |
| 88 const ash::FrameCaptionButton& rightmost) { | 87 const ash::FrameCaptionButton& rightmost) { |
| 89 gfx::Rect expected(container->GetPreferredSize()); | 88 gfx::Rect expected(container->GetPreferredSize()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 EXPECT_TRUE(test.size_button()->visible()); | 202 EXPECT_TRUE(test.size_button()->visible()); |
| 204 EXPECT_TRUE(test.close_button()->visible()); | 203 EXPECT_TRUE(test.close_button()->visible()); |
| 205 EXPECT_EQ(initial_minimize_button_bounds, test.minimize_button()->bounds()); | 204 EXPECT_EQ(initial_minimize_button_bounds, test.minimize_button()->bounds()); |
| 206 EXPECT_EQ(initial_size_button_bounds, test.size_button()->bounds()); | 205 EXPECT_EQ(initial_size_button_bounds, test.size_button()->bounds()); |
| 207 EXPECT_EQ(initial_close_button_bounds, test.close_button()->bounds()); | 206 EXPECT_EQ(initial_close_button_bounds, test.close_button()->bounds()); |
| 208 EXPECT_EQ(container.GetPreferredSize().width(), | 207 EXPECT_EQ(container.GetPreferredSize().width(), |
| 209 initial_container_bounds.width()); | 208 initial_container_bounds.width()); |
| 210 } | 209 } |
| 211 | 210 |
| 212 } // namespace ash | 211 } // namespace ash |
| OLD | NEW |