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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_port.h" | 10 #include "ash/shell_port.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 generator.GestureTapAt(point_outside); | 141 generator.GestureTapAt(point_outside); |
142 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); | 142 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); |
143 } | 143 } |
144 | 144 |
145 // Tests opening the app launcher on a non-primary display, then deleting the | 145 // Tests opening the app launcher on a non-primary display, then deleting the |
146 // display. | 146 // display. |
147 TEST_P(AppListPresenterDelegateTest, NonPrimaryDisplay) { | 147 TEST_P(AppListPresenterDelegateTest, NonPrimaryDisplay) { |
148 // Set up a screen with two displays (horizontally adjacent). | 148 // Set up a screen with two displays (horizontally adjacent). |
149 UpdateDisplay("1024x768,1024x768"); | 149 UpdateDisplay("1024x768,1024x768"); |
150 | 150 |
151 std::vector<WmWindow*> root_windows = ShellPort::Get()->GetAllRootWindows(); | 151 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
152 ASSERT_EQ(2u, root_windows.size()); | 152 ASSERT_EQ(2u, root_windows.size()); |
153 WmWindow* secondary_root = root_windows[1]; | 153 aura::Window* secondary_root = root_windows[1]; |
154 EXPECT_EQ("1024,0 1024x768", secondary_root->GetBoundsInScreen().ToString()); | 154 EXPECT_EQ("1024,0 1024x768", secondary_root->GetBoundsInScreen().ToString()); |
155 | 155 |
156 app_list_presenter_impl()->Show( | 156 app_list_presenter_impl()->Show(display::Screen::GetScreen() |
157 secondary_root->GetDisplayNearestWindow().id()); | 157 ->GetDisplayNearestWindow(secondary_root) |
| 158 .id()); |
158 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); | 159 EXPECT_TRUE(app_list_presenter_impl()->GetTargetVisibility()); |
159 | 160 |
160 // Remove the secondary display. Shouldn't crash (http://crbug.com/368990). | 161 // Remove the secondary display. Shouldn't crash (http://crbug.com/368990). |
161 UpdateDisplay("1024x768"); | 162 UpdateDisplay("1024x768"); |
162 | 163 |
163 // Updating the displays should close the app list. | 164 // Updating the displays should close the app list. |
164 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); | 165 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); |
165 } | 166 } |
166 | 167 |
167 // Tests opening the app launcher on a tiny display that is too small to contain | 168 // Tests opening the app launcher on a tiny display that is too small to contain |
(...skipping 13 matching lines...) Expand all Loading... |
181 | 182 |
182 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); | 183 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); |
183 int app_list_view_top = | 184 int app_list_view_top = |
184 app_list->anchor_rect().y() - app_list->bounds().height() / 2; | 185 app_list->anchor_rect().y() - app_list->bounds().height() / 2; |
185 const int kMinimalAppListMargin = 10; | 186 const int kMinimalAppListMargin = 10; |
186 | 187 |
187 EXPECT_GE(app_list_view_top, kMinimalAppListMargin); | 188 EXPECT_GE(app_list_view_top, kMinimalAppListMargin); |
188 } | 189 } |
189 | 190 |
190 } // namespace ash | 191 } // namespace ash |
OLD | NEW |