| 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/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
| 8 #include "ash/common/wm_window.h" | 8 #include "ash/common/wm_window.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 gfx::Point point_outside = | 108 gfx::Point point_outside = |
| 109 gfx::Point(app_window_bounds.right(), app_window_bounds.y()) + | 109 gfx::Point(app_window_bounds.right(), app_window_bounds.y()) + |
| 110 gfx::Vector2d(10, 0); | 110 gfx::Vector2d(10, 0); |
| 111 generator.GestureTapAt(point_outside); | 111 generator.GestureTapAt(point_outside); |
| 112 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); | 112 EXPECT_FALSE(app_list_presenter_impl()->GetTargetVisibility()); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Tests opening the app launcher on a non-primary display, then deleting the | 115 // Tests opening the app launcher on a non-primary display, then deleting the |
| 116 // display. | 116 // display. |
| 117 TEST_F(AppListPresenterDelegateTest, NonPrimaryDisplay) { | 117 TEST_F(AppListPresenterDelegateTest, NonPrimaryDisplay) { |
| 118 if (!SupportsMultipleDisplays()) | |
| 119 return; | |
| 120 | |
| 121 // Set up a screen with two displays (horizontally adjacent). | 118 // Set up a screen with two displays (horizontally adjacent). |
| 122 UpdateDisplay("1024x768,1024x768"); | 119 UpdateDisplay("1024x768,1024x768"); |
| 123 | 120 |
| 124 std::vector<WmWindow*> root_windows = WmShell::Get()->GetAllRootWindows(); | 121 std::vector<WmWindow*> root_windows = WmShell::Get()->GetAllRootWindows(); |
| 125 ASSERT_EQ(2u, root_windows.size()); | 122 ASSERT_EQ(2u, root_windows.size()); |
| 126 WmWindow* secondary_root = root_windows[1]; | 123 WmWindow* secondary_root = root_windows[1]; |
| 127 EXPECT_EQ("1024,0 1024x768", secondary_root->GetBoundsInScreen().ToString()); | 124 EXPECT_EQ("1024,0 1024x768", secondary_root->GetBoundsInScreen().ToString()); |
| 128 | 125 |
| 129 app_list_presenter_impl()->Show( | 126 app_list_presenter_impl()->Show( |
| 130 secondary_root->GetDisplayNearestWindow().id()); | 127 secondary_root->GetDisplayNearestWindow().id()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 152 // the actual app list position (the widget bounds include the bubble border | 149 // the actual app list position (the widget bounds include the bubble border |
| 153 // which is much bigger than the actual app list size). | 150 // which is much bigger than the actual app list size). |
| 154 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); | 151 app_list::AppListView* app_list = app_list_presenter_impl()->GetView(); |
| 155 int app_list_view_top = | 152 int app_list_view_top = |
| 156 app_list->anchor_rect().y() - app_list->bounds().height() / 2; | 153 app_list->anchor_rect().y() - app_list->bounds().height() / 2; |
| 157 const int kMinimalAppListMargin = 10; | 154 const int kMinimalAppListMargin = 10; |
| 158 EXPECT_GE(app_list_view_top, kMinimalAppListMargin); | 155 EXPECT_GE(app_list_view_top, kMinimalAppListMargin); |
| 159 } | 156 } |
| 160 | 157 |
| 161 } // namespace ash | 158 } // namespace ash |
| OLD | NEW |