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

Side by Side Diff: ash/frame/custom_frame_view_ash_unittest.cc

Issue 2111443002: mash: Migrate SessionStateDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "ash/common/ash_layout_constants.h" 9 #include "ash/common/ash_layout_constants.h"
10 #include "ash/common/wm_shell.h"
10 #include "ash/frame/caption_buttons/frame_caption_button.h" 11 #include "ash/frame/caption_buttons/frame_caption_button.h"
11 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 12 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
12 #include "ash/shell.h" 13 #include "ash/shell.h"
13 #include "ash/test/ash_test_base.h" 14 #include "ash/test/ash_test_base.h"
14 #include "ash/test/test_session_state_delegate.h" 15 #include "ash/test/test_session_state_delegate.h"
15 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 16 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
16 #include "grit/ash_resources.h" 17 #include "grit/ash_resources.h"
17 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/gfx/geometry/rect.h" 19 #include "ui/gfx/geometry/rect.h"
19 #include "ui/gfx/image/image_skia.h" 20 #include "ui/gfx/image/image_skia.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 views::Widget::InitParams params; 103 views::Widget::InitParams params;
103 params.delegate = delegate; 104 params.delegate = delegate;
104 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 105 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
105 params.bounds = gfx::Rect(0, 0, 100, 100); 106 params.bounds = gfx::Rect(0, 0, 100, 100);
106 params.context = CurrentContext(); 107 params.context = CurrentContext();
107 widget->Init(params); 108 widget->Init(params);
108 return widget; 109 return widget;
109 } 110 }
110 111
111 test::TestSessionStateDelegate* GetTestSessionStateDelegate() { 112 test::TestSessionStateDelegate* GetTestSessionStateDelegate() {
112 return static_cast<ash::test::TestSessionStateDelegate*>( 113 return static_cast<test::TestSessionStateDelegate*>(
113 Shell::GetInstance()->session_state_delegate()); 114 WmShell::Get()->GetSessionStateDelegate());
114 } 115 }
115 116
116 private: 117 private:
117 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAshTest); 118 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAshTest);
118 }; 119 };
119 120
120 // Test that the height of the header is correct upon initially displaying 121 // Test that the height of the header is correct upon initially displaying
121 // the widget. 122 // the widget.
122 TEST_F(CustomFrameViewAshTest, HeaderHeight) { 123 TEST_F(CustomFrameViewAshTest, HeaderHeight) {
123 TestWidgetDelegate* delegate = new TestWidgetDelegate; 124 TestWidgetDelegate* delegate = new TestWidgetDelegate;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 Shell::GetInstance() 217 Shell::GetInstance()
217 ->maximize_mode_controller() 218 ->maximize_mode_controller()
218 ->EnableMaximizeModeWindowManager(false); 219 ->EnableMaximizeModeWindowManager(false);
219 delegate->EndFrameCaptionButtonContainerViewAnimations(); 220 delegate->EndFrameCaptionButtonContainerViewAnimations();
220 const gfx::Rect after_restore = 221 const gfx::Rect after_restore =
221 delegate->GetFrameCaptionButtonContainerViewBounds(); 222 delegate->GetFrameCaptionButtonContainerViewBounds();
222 EXPECT_EQ(initial, after_restore); 223 EXPECT_EQ(initial, after_restore);
223 } 224 }
224 225
225 } // namespace ash 226 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698