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/wm/caption_buttons/frame_caption_button_container_view.h" | 5 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/wm/caption_buttons/frame_caption_button.h" | 9 #include "ash/wm/caption_buttons/frame_caption_button.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 widget->Init(params); | 62 widget->Init(params); |
63 return widget; | 63 return widget; |
64 } | 64 } |
65 | 65 |
66 // Sets |container| to use arbitrary images for the buttons. Setting the | 66 // Sets |container| to use arbitrary images for the buttons. Setting the |
67 // images causes the buttons to have non-empty sizes. | 67 // images causes the buttons to have non-empty sizes. |
68 void SetMockImages(FrameCaptionButtonContainerView* container) { | 68 void SetMockImages(FrameCaptionButtonContainerView* container) { |
69 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { | 69 for (int icon = 0; icon < CAPTION_BUTTON_ICON_COUNT; ++icon) { |
70 container->SetButtonImages( | 70 container->SetButtonImages( |
71 static_cast<CaptionButtonIcon>(icon), | 71 static_cast<CaptionButtonIcon>(icon), |
72 IDR_AURA_WINDOW_CLOSE, | 72 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE, |
73 IDR_AURA_WINDOW_CLOSE_H, | 73 IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I, |
74 IDR_AURA_WINDOW_CLOSE_P); | 74 IDR_AURA_WINDOW_CONTROL_BACKGROUND_H, |
| 75 IDR_AURA_WINDOW_CONTROL_BACKGROUND_P); |
75 } | 76 } |
76 } | 77 } |
77 | 78 |
78 // Tests that |leftmost| and |rightmost| are at |container|'s edges. | 79 // Tests that |leftmost| and |rightmost| are at |container|'s edges. |
79 bool CheckButtonsAtEdges(FrameCaptionButtonContainerView* container, | 80 bool CheckButtonsAtEdges(FrameCaptionButtonContainerView* container, |
80 const ash::FrameCaptionButton& leftmost, | 81 const ash::FrameCaptionButton& leftmost, |
81 const ash::FrameCaptionButton& rightmost) { | 82 const ash::FrameCaptionButton& rightmost) { |
82 gfx::Rect expected(container->GetPreferredSize()); | 83 gfx::Rect expected(container->GetPreferredSize()); |
83 | 84 |
84 gfx::Rect container_size(container->GetPreferredSize()); | 85 gfx::Rect container_size(container->GetPreferredSize()); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 container.Layout(); | 205 container.Layout(); |
205 FrameCaptionButtonContainerView::TestApi t(&container); | 206 FrameCaptionButtonContainerView::TestApi t(&container); |
206 EXPECT_TRUE(t.minimize_button()->visible()); | 207 EXPECT_TRUE(t.minimize_button()->visible()); |
207 EXPECT_TRUE(t.size_button()->visible()); | 208 EXPECT_TRUE(t.size_button()->visible()); |
208 EXPECT_TRUE(t.close_button()->visible()); | 209 EXPECT_TRUE(t.close_button()->visible()); |
209 EXPECT_TRUE(CheckButtonsAtEdges( | 210 EXPECT_TRUE(CheckButtonsAtEdges( |
210 &container, *t.minimize_button(), *t.close_button())); | 211 &container, *t.minimize_button(), *t.close_button())); |
211 } | 212 } |
212 | 213 |
213 } // namespace ash | 214 } // namespace ash |
OLD | NEW |