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/shelf/shelf_widget.h" | 5 #include "ash/shelf/shelf_widget.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | |
7 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
8 #include "ash/shelf/shelf.h" | 9 #include "ash/shelf/shelf.h" |
9 #include "ash/shelf/shelf_delegate.h" | 10 #include "ash/shelf/shelf_delegate.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
11 #include "ash/shelf/shelf_view.h" | 12 #include "ash/shelf/shelf_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_md_test_base.h" |
14 #include "ash/test/ash_test_helper.h" | 15 #include "ash/test/ash_test_helper.h" |
15 #include "ash/test/shelf_test_api.h" | 16 #include "ash/test/shelf_test_api.h" |
16 #include "ash/test/shelf_view_test_api.h" | 17 #include "ash/test/shelf_view_test_api.h" |
17 #include "ash/test/test_shell_delegate.h" | 18 #include "ash/test/test_shell_delegate.h" |
18 #include "ash/wm/window_util.h" | 19 #include "ash/wm/window_util.h" |
19 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_event_dispatcher.h" |
20 #include "ui/display/display.h" | 21 #include "ui/display/display.h" |
21 #include "ui/display/screen.h" | 22 #include "ui/display/screen.h" |
22 #include "ui/events/event_utils.h" | 23 #include "ui/events/event_utils.h" |
23 #include "ui/views/view.h" | 24 #include "ui/views/view.h" |
24 #include "ui/views/widget/widget.h" | 25 #include "ui/views/widget/widget.h" |
25 | 26 |
26 namespace ash { | 27 namespace ash { |
27 | 28 |
28 namespace { | 29 namespace { |
29 | 30 |
30 ShelfWidget* GetShelfWidget() { | 31 ShelfWidget* GetShelfWidget() { |
31 return Shelf::ForPrimaryDisplay()->shelf_widget(); | 32 return Shelf::ForPrimaryDisplay()->shelf_widget(); |
32 } | 33 } |
33 | 34 |
34 ShelfLayoutManager* GetShelfLayoutManager() { | 35 ShelfLayoutManager* GetShelfLayoutManager() { |
35 return GetShelfWidget()->shelf_layout_manager(); | 36 return GetShelfWidget()->shelf_layout_manager(); |
36 } | 37 } |
37 | 38 |
38 } // namespace | 39 } // namespace |
39 | 40 |
40 typedef test::AshTestBase ShelfWidgetTest; | 41 using ShelfWidgetTest = test::AshMDTestBase; |
42 | |
43 // Note: First argument is optional and intentionally left blank. | |
44 // (it's a prefix for the generated test cases) | |
45 INSTANTIATE_TEST_CASE_P( | |
46 , | |
47 ShelfWidgetTest, | |
48 testing::Values(MaterialDesignController::NON_MATERIAL, | |
49 MaterialDesignController::MATERIAL_NORMAL, | |
50 MaterialDesignController::MATERIAL_EXPERIMENTAL)); | |
41 | 51 |
42 void TestLauncherAlignment(aura::Window* root, | 52 void TestLauncherAlignment(aura::Window* root, |
43 ShelfAlignment alignment, | 53 ShelfAlignment alignment, |
44 const std::string& expected) { | 54 const std::string& expected) { |
45 Shelf::ForWindow(root)->SetAlignment(alignment); | 55 Shelf::ForWindow(root)->SetAlignment(alignment); |
46 display::Screen* screen = display::Screen::GetScreen(); | 56 display::Screen* screen = display::Screen::GetScreen(); |
47 EXPECT_EQ(expected, | 57 EXPECT_EQ(expected, |
48 screen->GetDisplayNearestWindow(root).work_area().ToString()); | 58 screen->GetDisplayNearestWindow(root).work_area().ToString()); |
49 } | 59 } |
50 | 60 |
51 #if defined(OS_WIN) && !defined(USE_ASH) | |
52 // TODO(msw): Broken on Windows. http://crbug.com/584038 | 61 // TODO(msw): Broken on Windows. http://crbug.com/584038 |
53 #define MAYBE_TestAlignment DISABLED_TestAlignment | 62 #if defined(OS_CHROMEOS) |
54 #else | 63 TEST_P(ShelfWidgetTest, TestAlignment) { |
55 #define MAYBE_TestAlignment TestAlignment | 64 // Note that for a left- and right-aligned shelf, this offset must be |
56 #endif | 65 // applied to a maximized window's width rather than its height. |
57 TEST_F(ShelfWidgetTest, MAYBE_TestAlignment) { | 66 const int offset = GetMdMaximizedWindowHeightOffset(); |
67 const int kShelfSize = GetShelfConstant(SHELF_SIZE); | |
58 UpdateDisplay("400x400"); | 68 UpdateDisplay("400x400"); |
59 { | 69 { |
60 SCOPED_TRACE("Single Bottom"); | 70 SCOPED_TRACE("Single Bottom"); |
61 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM, | 71 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_BOTTOM, |
62 "0,0 400x353"); | 72 gfx::Rect(0, 0, 400, 353 + offset).ToString()); |
63 } | 73 } |
64 { | 74 { |
65 SCOPED_TRACE("Single Locked"); | 75 SCOPED_TRACE("Single Locked"); |
66 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), | 76 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), |
67 SHELF_ALIGNMENT_BOTTOM_LOCKED, "0,0 400x353"); | 77 SHELF_ALIGNMENT_BOTTOM_LOCKED, |
78 gfx::Rect(0, 0, 400, 353 + offset).ToString()); | |
68 } | 79 } |
69 { | 80 { |
70 SCOPED_TRACE("Single Right"); | 81 SCOPED_TRACE("Single Right"); |
71 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_RIGHT, | 82 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_RIGHT, |
72 "0,0 353x400"); | 83 gfx::Rect(0, 0, 353 + offset, 400).ToString()); |
73 } | 84 } |
74 { | 85 { |
75 SCOPED_TRACE("Single Left"); | 86 SCOPED_TRACE("Single Left"); |
76 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_LEFT, | 87 TestLauncherAlignment( |
77 "47,0 353x400"); | 88 Shell::GetPrimaryRootWindow(), SHELF_ALIGNMENT_LEFT, |
89 gfx::Rect(kShelfSize, 0, 353 + offset, 400).ToString()); | |
78 } | 90 } |
79 if (!SupportsMultipleDisplays()) | 91 if (!SupportsMultipleDisplays()) |
80 return; | 92 return; |
81 | 93 |
82 UpdateDisplay("300x300,500x500"); | 94 UpdateDisplay("300x300,500x500"); |
83 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 95 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
84 { | 96 { |
85 SCOPED_TRACE("Primary Bottom"); | 97 SCOPED_TRACE("Primary Bottom"); |
86 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_BOTTOM, | 98 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_BOTTOM, |
87 "0,0 300x253"); | 99 gfx::Rect(0, 0, 300, 253 + offset).ToString()); |
88 } | 100 } |
89 { | 101 { |
90 SCOPED_TRACE("Primary Locked"); | 102 SCOPED_TRACE("Primary Locked"); |
91 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_BOTTOM_LOCKED, | 103 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_BOTTOM_LOCKED, |
92 "0,0 300x253"); | 104 gfx::Rect(0, 0, 300, 253 + offset).ToString()); |
93 } | 105 } |
94 { | 106 { |
95 SCOPED_TRACE("Primary Right"); | 107 SCOPED_TRACE("Primary Right"); |
96 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_RIGHT, | 108 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_RIGHT, |
97 "0,0 253x300"); | 109 gfx::Rect(0, 0, 253 + offset, 300).ToString()); |
98 } | 110 } |
99 { | 111 { |
100 SCOPED_TRACE("Primary Left"); | 112 SCOPED_TRACE("Primary Left"); |
101 TestLauncherAlignment(root_windows[0], SHELF_ALIGNMENT_LEFT, | 113 TestLauncherAlignment( |
102 "47,0 253x300"); | 114 root_windows[0], SHELF_ALIGNMENT_LEFT, |
115 gfx::Rect(kShelfSize, 0, 253 + offset, 300).ToString()); | |
103 } | 116 } |
104 { | 117 { |
105 SCOPED_TRACE("Secondary Bottom"); | 118 SCOPED_TRACE("Secondary Bottom"); |
106 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_BOTTOM, | 119 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_BOTTOM, |
107 "300,0 500x453"); | 120 gfx::Rect(300, 0, 500, 453 + offset).ToString()); |
108 } | 121 } |
109 { | 122 { |
110 SCOPED_TRACE("Secondary Locked"); | 123 SCOPED_TRACE("Secondary Locked"); |
111 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_BOTTOM_LOCKED, | 124 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_BOTTOM_LOCKED, |
112 "300,0 500x453"); | 125 gfx::Rect(300, 0, 500, 453 + offset).ToString()); |
113 } | 126 } |
114 { | 127 { |
115 SCOPED_TRACE("Secondary Right"); | 128 SCOPED_TRACE("Secondary Right"); |
116 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_RIGHT, | 129 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_RIGHT, |
117 "300,0 453x500"); | 130 gfx::Rect(300, 0, 453 + offset, 500).ToString()); |
118 } | 131 } |
119 { | 132 { |
120 SCOPED_TRACE("Secondary Left"); | 133 SCOPED_TRACE("Secondary Left"); |
121 TestLauncherAlignment(root_windows[1], SHELF_ALIGNMENT_LEFT, | 134 TestLauncherAlignment( |
122 "347,0 453x500"); | 135 root_windows[1], SHELF_ALIGNMENT_LEFT, |
136 gfx::Rect(300 + kShelfSize, 0, 453 + offset, 500).ToString()); | |
123 } | 137 } |
124 } | 138 } |
139 #endif // defined(OS_CHROMEOS) | |
125 | 140 |
126 // Makes sure the shelf is initially sized correctly. | 141 // Makes sure the shelf is initially sized correctly. |
127 TEST_F(ShelfWidgetTest, LauncherInitiallySized) { | 142 TEST_P(ShelfWidgetTest, LauncherInitiallySized) { |
128 ShelfWidget* shelf_widget = GetShelfWidget(); | 143 ShelfWidget* shelf_widget = GetShelfWidget(); |
129 Shelf* shelf = shelf_widget->shelf(); | 144 Shelf* shelf = shelf_widget->shelf(); |
130 ASSERT_TRUE(shelf); | 145 ASSERT_TRUE(shelf); |
131 ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); | 146 ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
132 ASSERT_TRUE(shelf_layout_manager); | 147 ASSERT_TRUE(shelf_layout_manager); |
133 ASSERT_TRUE(shelf_widget->status_area_widget()); | 148 ASSERT_TRUE(shelf_widget->status_area_widget()); |
134 int status_width = shelf_widget->status_area_widget()-> | 149 int status_width = shelf_widget->status_area_widget()-> |
135 GetWindowBoundsInScreen().width(); | 150 GetWindowBoundsInScreen().width(); |
136 // Test only makes sense if the status is > 0, which it better be. | 151 // Test only makes sense if the status is > 0, which it better be. |
137 EXPECT_GT(status_width, 0); | 152 EXPECT_GT(status_width, 0); |
138 EXPECT_EQ(status_width, shelf_widget->GetContentsView()->width() - | 153 EXPECT_EQ(status_width, shelf_widget->GetContentsView()->width() - |
139 test::ShelfTestAPI(shelf).shelf_view()->width()); | 154 test::ShelfTestAPI(shelf).shelf_view()->width()); |
140 } | 155 } |
141 | 156 |
142 // Verifies when the shell is deleted with a full screen window we don't crash. | 157 // Verifies when the shell is deleted with a full screen window we don't crash. |
143 TEST_F(ShelfWidgetTest, DontReferenceShelfAfterDeletion) { | 158 TEST_P(ShelfWidgetTest, DontReferenceShelfAfterDeletion) { |
144 views::Widget* widget = new views::Widget; | 159 views::Widget* widget = new views::Widget; |
145 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 160 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
146 params.bounds = gfx::Rect(0, 0, 200, 200); | 161 params.bounds = gfx::Rect(0, 0, 200, 200); |
147 params.context = CurrentContext(); | 162 params.context = CurrentContext(); |
148 // Widget is now owned by the parent window. | 163 // Widget is now owned by the parent window. |
149 widget->Init(params); | 164 widget->Init(params); |
150 widget->SetFullscreen(true); | 165 widget->SetFullscreen(true); |
151 } | 166 } |
152 | 167 |
153 #if defined(OS_CHROMEOS) | 168 #if defined(OS_CHROMEOS) |
154 // Verifies shelf is created with correct size after user login and when its | 169 // Verifies shelf is created with correct size after user login and when its |
155 // container and status widget has finished sizing. | 170 // container and status widget has finished sizing. |
156 // See http://crbug.com/252533 | 171 // See http://crbug.com/252533 |
157 TEST_F(ShelfWidgetTest, ShelfInitiallySizedAfterLogin) { | 172 TEST_P(ShelfWidgetTest, ShelfInitiallySizedAfterLogin) { |
158 SetUserLoggedIn(false); | 173 SetUserLoggedIn(false); |
159 UpdateDisplay("300x200,400x300"); | 174 UpdateDisplay("300x200,400x300"); |
160 | 175 |
161 ShelfWidget* shelf_widget = NULL; | 176 ShelfWidget* shelf_widget = NULL; |
162 Shell::RootWindowControllerList controllers( | 177 Shell::RootWindowControllerList controllers( |
163 Shell::GetAllRootWindowControllers()); | 178 Shell::GetAllRootWindowControllers()); |
164 for (Shell::RootWindowControllerList::const_iterator i = controllers.begin(); | 179 for (Shell::RootWindowControllerList::const_iterator i = controllers.begin(); |
165 i != controllers.end(); | 180 i != controllers.end(); |
166 ++i) { | 181 ++i) { |
167 if (!(*i)->shelf_widget()->shelf()) { | 182 if (!(*i)->shelf_widget()->shelf()) { |
(...skipping 13 matching lines...) Expand all Loading... | |
181 shelf_widget->status_area_widget()->GetWindowBoundsInScreen().width(); | 196 shelf_widget->status_area_widget()->GetWindowBoundsInScreen().width(); |
182 EXPECT_GT(status_width, 0); | 197 EXPECT_GT(status_width, 0); |
183 EXPECT_EQ(status_width, | 198 EXPECT_EQ(status_width, |
184 shelf_widget->GetContentsView()->width() - | 199 shelf_widget->GetContentsView()->width() - |
185 test::ShelfTestAPI(shelf).shelf_view()->width()); | 200 test::ShelfTestAPI(shelf).shelf_view()->width()); |
186 } | 201 } |
187 #endif // defined(OS_CHROMEOS) | 202 #endif // defined(OS_CHROMEOS) |
188 | 203 |
189 // Tests that the shelf lets mouse-events close to the edge fall through to the | 204 // Tests that the shelf lets mouse-events close to the edge fall through to the |
190 // window underneath. | 205 // window underneath. |
191 TEST_F(ShelfWidgetTest, ShelfEdgeOverlappingWindowHitTestMouse) { | 206 TEST_P(ShelfWidgetTest, ShelfEdgeOverlappingWindowHitTestMouse) { |
tdanderson
2016/06/21 19:52:21
ditto to the comments I made in WindowStateTest.Re
| |
192 ShelfWidget* shelf_widget = GetShelfWidget(); | 207 ShelfWidget* shelf_widget = GetShelfWidget(); |
193 gfx::Rect shelf_bounds = shelf_widget->GetWindowBoundsInScreen(); | 208 gfx::Rect shelf_bounds = shelf_widget->GetWindowBoundsInScreen(); |
209 | |
194 EXPECT_TRUE(!shelf_bounds.IsEmpty()); | 210 EXPECT_TRUE(!shelf_bounds.IsEmpty()); |
195 ShelfLayoutManager* shelf_layout_manager = | 211 ShelfLayoutManager* shelf_layout_manager = |
196 shelf_widget->shelf_layout_manager(); | 212 shelf_widget->shelf_layout_manager(); |
197 ASSERT_TRUE(shelf_layout_manager); | 213 ASSERT_TRUE(shelf_layout_manager); |
198 EXPECT_EQ(SHELF_VISIBLE, shelf_layout_manager->visibility_state()); | 214 EXPECT_EQ(SHELF_VISIBLE, shelf_layout_manager->visibility_state()); |
199 | 215 |
200 // Create a Widget which overlaps the shelf in both left and bottom | 216 // Create a Widget which overlaps the shelf in both left and bottom |
201 // alignments. | 217 // alignments. |
202 const int kOverlapSize = 15; | 218 const int kOverlapSize = 15; |
203 const int kWindowHeight = 200; | 219 const int kWindowHeight = 200; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 gfx::Point event_location(widget_bounds.x() + 5, shelf_bounds.y() + 1); | 280 gfx::Point event_location(widget_bounds.x() + 5, shelf_bounds.y() + 1); |
265 ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location, | 281 ui::MouseEvent mouse(ui::ET_MOUSE_MOVED, event_location, event_location, |
266 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); | 282 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); |
267 ui::EventTarget* target = targeter->FindTargetForEvent(root, &mouse); | 283 ui::EventTarget* target = targeter->FindTargetForEvent(root, &mouse); |
268 EXPECT_EQ(shelf_widget->GetNativeWindow(), target); | 284 EXPECT_EQ(shelf_widget->GetNativeWindow(), target); |
269 } | 285 } |
270 } | 286 } |
271 | 287 |
272 // Tests that the shelf has a slightly larger hit-region for touch-events when | 288 // Tests that the shelf has a slightly larger hit-region for touch-events when |
273 // it's in the auto-hidden state. | 289 // it's in the auto-hidden state. |
274 TEST_F(ShelfWidgetTest, HiddenShelfHitTestTouch) { | 290 TEST_P(ShelfWidgetTest, HiddenShelfHitTestTouch) { |
275 Shelf* shelf = Shelf::ForPrimaryDisplay(); | 291 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
276 ShelfWidget* shelf_widget = GetShelfWidget(); | 292 ShelfWidget* shelf_widget = GetShelfWidget(); |
277 gfx::Rect shelf_bounds = shelf_widget->GetWindowBoundsInScreen(); | 293 gfx::Rect shelf_bounds = shelf_widget->GetWindowBoundsInScreen(); |
278 EXPECT_TRUE(!shelf_bounds.IsEmpty()); | 294 EXPECT_TRUE(!shelf_bounds.IsEmpty()); |
279 ShelfLayoutManager* shelf_layout_manager = | 295 ShelfLayoutManager* shelf_layout_manager = |
280 shelf_widget->shelf_layout_manager(); | 296 shelf_widget->shelf_layout_manager(); |
281 ASSERT_TRUE(shelf_layout_manager); | 297 ASSERT_TRUE(shelf_layout_manager); |
282 EXPECT_EQ(SHELF_VISIBLE, shelf_layout_manager->visibility_state()); | 298 EXPECT_EQ(SHELF_VISIBLE, shelf_layout_manager->visibility_state()); |
283 | 299 |
284 // Create a widget to make sure that the shelf does auto-hide. | 300 // Create a widget to make sure that the shelf does auto-hide. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 shelf_layout_manager->auto_hide_state()); | 442 shelf_layout_manager->auto_hide_state()); |
427 } | 443 } |
428 | 444 |
429 private: | 445 private: |
430 ShelfWidgetTestShellDelegate* shelf_widget_test_shell_delegate_; | 446 ShelfWidgetTestShellDelegate* shelf_widget_test_shell_delegate_; |
431 DISALLOW_COPY_AND_ASSIGN(ShelfWidgetTestWithDelegate); | 447 DISALLOW_COPY_AND_ASSIGN(ShelfWidgetTestWithDelegate); |
432 }; | 448 }; |
433 | 449 |
434 } // namespace | 450 } // namespace |
435 | 451 |
436 TEST_F(ShelfWidgetTestWithDelegate, CreateAutoHideAlwaysShelf) { | 452 // Note: First argument is optional and intentionally left blank. |
453 // (it's a prefix for the generated test cases) | |
454 INSTANTIATE_TEST_CASE_P( | |
455 , | |
456 ShelfWidgetTestWithDelegate, | |
457 testing::Values(MaterialDesignController::NON_MATERIAL, | |
458 MaterialDesignController::MATERIAL_NORMAL, | |
459 MaterialDesignController::MATERIAL_EXPERIMENTAL)); | |
460 | |
461 TEST_P(ShelfWidgetTestWithDelegate, CreateAutoHideAlwaysShelf) { | |
437 // The actual auto hide state is shown because there are no open windows. | 462 // The actual auto hide state is shown because there are no open windows. |
438 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM, | 463 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM, |
439 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 464 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
440 SHELF_AUTO_HIDE, SHELF_AUTO_HIDE_SHOWN); | 465 SHELF_AUTO_HIDE, SHELF_AUTO_HIDE_SHOWN); |
441 } | 466 } |
442 | 467 |
443 TEST_F(ShelfWidgetTestWithDelegate, CreateAutoHideNeverShelf) { | 468 TEST_P(ShelfWidgetTestWithDelegate, CreateAutoHideNeverShelf) { |
444 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. | 469 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. |
445 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_LEFT, | 470 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_LEFT, |
446 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, | 471 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, |
447 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); | 472 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); |
448 } | 473 } |
449 | 474 |
450 TEST_F(ShelfWidgetTestWithDelegate, CreateAutoHideAlwaysHideShelf) { | 475 TEST_P(ShelfWidgetTestWithDelegate, CreateAutoHideAlwaysHideShelf) { |
451 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. | 476 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. |
452 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_RIGHT, | 477 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_RIGHT, |
453 SHELF_AUTO_HIDE_ALWAYS_HIDDEN, SHELF_HIDDEN, | 478 SHELF_AUTO_HIDE_ALWAYS_HIDDEN, SHELF_HIDDEN, |
454 SHELF_AUTO_HIDE_HIDDEN); | 479 SHELF_AUTO_HIDE_HIDDEN); |
455 } | 480 } |
456 | 481 |
457 TEST_F(ShelfWidgetTestWithDelegate, CreateLockedShelf) { | 482 TEST_P(ShelfWidgetTestWithDelegate, CreateLockedShelf) { |
458 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. | 483 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. |
459 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM_LOCKED, | 484 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM_LOCKED, |
460 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, | 485 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, |
461 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); | 486 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); |
462 } | 487 } |
463 | 488 |
464 } // namespace ash | 489 } // namespace ash |
OLD | NEW |