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 "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
10 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return menu->GetIndexOfCommandId(command_id) != -1; | 40 return menu->GetIndexOfCommandId(command_id) != -1; |
41 } | 41 } |
42 | 42 |
43 LauncherContextMenuTest() : profile_(new TestingProfile()) {} | 43 LauncherContextMenuTest() : profile_(new TestingProfile()) {} |
44 | 44 |
45 void SetUp() override { | 45 void SetUp() override { |
46 arc_test_.SetUp(profile_.get()); | 46 arc_test_.SetUp(profile_.get()); |
47 session_manager_ = base::MakeUnique<session_manager::SessionManager>(); | 47 session_manager_ = base::MakeUnique<session_manager::SessionManager>(); |
48 ash::test::AshTestBase::SetUp(); | 48 ash::test::AshTestBase::SetUp(); |
49 controller_.reset(new ChromeLauncherControllerImpl( | 49 controller_.reset(new ChromeLauncherControllerImpl( |
50 profile(), ash::WmShell::Get()->shelf_model())); | 50 profile(), ash::Shell::Get()->shelf_model())); |
51 controller_->Init(); | 51 controller_->Init(); |
52 } | 52 } |
53 | 53 |
54 void TearDown() override { | 54 void TearDown() override { |
55 controller_.reset(nullptr); | 55 controller_.reset(nullptr); |
56 ash::test::AshTestBase::TearDown(); | 56 ash::test::AshTestBase::TearDown(); |
57 } | 57 } |
58 | 58 |
59 ash::WmShelf* GetWmShelf(int64_t display_id) { | 59 ash::WmShelf* GetWmShelf(int64_t display_id) { |
60 ash::RootWindowController* root_window_controller = | 60 ash::RootWindowController* root_window_controller = |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 widget->SetFullscreen(true); | 301 widget->SetFullscreen(true); |
302 std::unique_ptr<LauncherContextMenu> primary_menu(CreateLauncherContextMenu( | 302 std::unique_ptr<LauncherContextMenu> primary_menu(CreateLauncherContextMenu( |
303 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); | 303 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(primary_id))); |
304 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( | 304 std::unique_ptr<LauncherContextMenu> secondary_menu(CreateLauncherContextMenu( |
305 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); | 305 ash::TYPE_BROWSER_SHORTCUT, GetWmShelf(secondary_id))); |
306 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), | 306 EXPECT_FALSE(IsItemPresentInMenu(primary_menu.get(), |
307 LauncherContextMenu::MENU_AUTO_HIDE)); | 307 LauncherContextMenu::MENU_AUTO_HIDE)); |
308 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), | 308 EXPECT_TRUE(IsItemPresentInMenu(secondary_menu.get(), |
309 LauncherContextMenu::MENU_AUTO_HIDE)); | 309 LauncherContextMenu::MENU_AUTO_HIDE)); |
310 } | 310 } |
OLD | NEW |