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 "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/shell_window_ids.h" | 6 #include "ash/shell_window_ids.h" |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "ash/test/test_shell_delegate.h" | 8 #include "ash/test/test_shell_delegate.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); | 27 EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); |
28 } | 28 } |
29 | 29 |
30 // Tests that app launcher remains visible when focus is moved to a different | 30 // Tests that app launcher remains visible when focus is moved to a different |
31 // window in kShellWindowId_AppListContainer. | 31 // window in kShellWindowId_AppListContainer. |
32 TEST_F(AppListControllerTest, RemainVisibleWhenFocusingToApplistContainer) { | 32 TEST_F(AppListControllerTest, RemainVisibleWhenFocusingToApplistContainer) { |
33 Shell::GetInstance()->ToggleAppList(NULL); | 33 Shell::GetInstance()->ToggleAppList(NULL); |
34 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); | 34 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); |
35 | 35 |
36 aura::Window* applist_container = Shell::GetContainer( | 36 aura::Window* applist_container = Shell::GetContainer( |
37 Shell::GetPrimaryRootWindow(), | 37 Shell::GetPrimaryRootWindow(), kShellWindowId_AppListContainer); |
38 internal::kShellWindowId_AppListContainer); | |
39 scoped_ptr<aura::Window> window( | 38 scoped_ptr<aura::Window> window( |
40 aura::test::CreateTestWindowWithId(0, applist_container)); | 39 aura::test::CreateTestWindowWithId(0, applist_container)); |
41 wm::ActivateWindow(window.get()); | 40 wm::ActivateWindow(window.get()); |
42 | 41 |
43 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); | 42 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); |
44 } | 43 } |
45 | 44 |
46 // Tests that clicking outside the app-list bubble closes it. | 45 // Tests that clicking outside the app-list bubble closes it. |
47 TEST_F(AppListControllerTest, ClickOutsideBubbleClosesBubble) { | 46 TEST_F(AppListControllerTest, ClickOutsideBubbleClosesBubble) { |
48 Shell* shell = Shell::GetInstance(); | 47 Shell* shell = Shell::GetInstance(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Click outside the bubble. This should close it. | 83 // Click outside the bubble. This should close it. |
85 gfx::Point point_outside = | 84 gfx::Point point_outside = |
86 gfx::Point(app_window_bounds.right(), app_window_bounds.y()) + | 85 gfx::Point(app_window_bounds.right(), app_window_bounds.y()) + |
87 gfx::Vector2d(10, 0); | 86 gfx::Vector2d(10, 0); |
88 EXPECT_TRUE(shell->GetPrimaryRootWindow()->bounds().Contains(point_outside)); | 87 EXPECT_TRUE(shell->GetPrimaryRootWindow()->bounds().Contains(point_outside)); |
89 generator.GestureTapAt(point_outside); | 88 generator.GestureTapAt(point_outside); |
90 EXPECT_FALSE(shell->GetAppListTargetVisibility()); | 89 EXPECT_FALSE(shell->GetAppListTargetVisibility()); |
91 } | 90 } |
92 | 91 |
93 } // namespace ash | 92 } // namespace ash |
OLD | NEW |