| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/custom_frame_view_ash.h" | 5 #include "ash/frame/custom_frame_view_ash.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/frame/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 // Test that the height of the header is correct upon initially displaying | 123 // Test that the height of the header is correct upon initially displaying |
| 124 // the widget. | 124 // the widget. |
| 125 TEST_F(CustomFrameViewAshTest, HeaderHeight) { | 125 TEST_F(CustomFrameViewAshTest, HeaderHeight) { |
| 126 TestWidgetDelegate* delegate = new TestWidgetDelegate; | 126 TestWidgetDelegate* delegate = new TestWidgetDelegate; |
| 127 | 127 |
| 128 scoped_ptr<views::Widget> widget(CreateWidget(delegate)); | 128 scoped_ptr<views::Widget> widget(CreateWidget(delegate)); |
| 129 widget->Show(); | 129 widget->Show(); |
| 130 | 130 |
| 131 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | |
| 132 gfx::ImageSkia* close_button = | |
| 133 rb.GetImageSkiaNamed(IDR_AURA_WINDOW_CONTROL_BACKGROUND_H); | |
| 134 | |
| 135 // The header should have enough room for the window controls. The | 131 // The header should have enough room for the window controls. The |
| 136 // header/content separator line overlays the window controls. | 132 // header/content separator line overlays the window controls. |
| 137 EXPECT_EQ(close_button->height(), | 133 EXPECT_EQ(33, delegate->custom_frame_view()->GetHeaderView()->height()); |
| 138 delegate->custom_frame_view()->GetHeaderView()->height()); | |
| 139 } | 134 } |
| 140 | 135 |
| 141 // Verify that CustomFrameViewAsh returns the correct minimum and maximum frame | 136 // Verify that CustomFrameViewAsh returns the correct minimum and maximum frame |
| 142 // sizes when the client view does not specify any size constraints. | 137 // sizes when the client view does not specify any size constraints. |
| 143 TEST_F(CustomFrameViewAshTest, NoSizeConstraints) { | 138 TEST_F(CustomFrameViewAshTest, NoSizeConstraints) { |
| 144 TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate; | 139 TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate; |
| 145 scoped_ptr<views::Widget> widget(CreateWidget(delegate)); | 140 scoped_ptr<views::Widget> widget(CreateWidget(delegate)); |
| 146 | 141 |
| 147 CustomFrameViewAsh* custom_frame_view = delegate->custom_frame_view(); | 142 CustomFrameViewAsh* custom_frame_view = delegate->custom_frame_view(); |
| 148 gfx::Size min_frame_size = custom_frame_view->GetMinimumSize(); | 143 gfx::Size min_frame_size = custom_frame_view->GetMinimumSize(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 EXPECT_GT(initial.width(), maximize_mode_bounds.width()); | 215 EXPECT_GT(initial.width(), maximize_mode_bounds.width()); |
| 221 Shell::GetInstance()->maximize_mode_controller()-> | 216 Shell::GetInstance()->maximize_mode_controller()-> |
| 222 EnableMaximizeModeWindowManager(false); | 217 EnableMaximizeModeWindowManager(false); |
| 223 delegate->EndFrameCaptionButtonContainerViewAnimations(); | 218 delegate->EndFrameCaptionButtonContainerViewAnimations(); |
| 224 const gfx::Rect after_restore = delegate-> | 219 const gfx::Rect after_restore = delegate-> |
| 225 GetFrameCaptionButtonContainerViewBounds(); | 220 GetFrameCaptionButtonContainerViewBounds(); |
| 226 EXPECT_EQ(initial, after_restore); | 221 EXPECT_EQ(initial, after_restore); |
| 227 } | 222 } |
| 228 | 223 |
| 229 } // namespace ash | 224 } // namespace ash |
| OLD | NEW |