Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2857)

Unified Diff: chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_context_menu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
index 27a0acdc8dd0248b15d540ed0273b2b8a05aa76f..9d67fb81fc1e9b5eddff8d355e0f216da4e62eea 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
@@ -6,8 +6,9 @@
#include "ash/common/shelf/shelf_item_types.h"
#include "ash/common/shelf/shelf_model.h"
-#include "ash/shelf/shelf.h"
-#include "ash/shell.h"
+#include "ash/common/wm_root_window_controller.h"
+#include "ash/common/wm_shell.h"
+#include "ash/common/wm_window.h"
#include "ash/test/ash_test_base.h"
#include "base/macros.h"
#include "chrome/app/chrome_command_ids.h"
@@ -43,19 +44,24 @@ class LauncherContextMenuTest : public ash::test::AshTestBase {
ash::test::AshTestBase::TearDown();
}
+ ash::WmShelf* GetWmShelf() {
+ return ash::WmShell::Get()
+ ->GetPrimaryRootWindow()
+ ->GetRootWindowController()
+ ->GetShelf();
+ }
+
LauncherContextMenu* CreateLauncherContextMenu(
ash::ShelfItemType shelf_item_type) {
ash::ShelfItem item;
item.id = 1; // dummy id
item.type = shelf_item_type;
- ash::Shelf* shelf = ash::Shelf::ForWindow(CurrentContext());
- return LauncherContextMenu::Create(controller_.get(), &item, shelf);
+ return LauncherContextMenu::Create(controller_.get(), &item, GetWmShelf());
}
LauncherContextMenu* CreateLauncherContextMenuForDesktopShell() {
ash::ShelfItem* item = nullptr;
- ash::Shelf* shelf = ash::Shelf::ForWindow(CurrentContext());
- return LauncherContextMenu::Create(controller_.get(), item, shelf);
+ return LauncherContextMenu::Create(controller_.get(), item, GetWmShelf());
}
ArcAppTest& arc_test() { return arc_test_; }
@@ -158,10 +164,10 @@ TEST_F(LauncherContextMenuTest, ArcLauncherContextMenuItemCheck) {
ash::ShelfItem item;
item.id = controller()->GetShelfIDForAppID(app_id);
- ash::Shelf* shelf = ash::Shelf::ForWindow(CurrentContext());
+ ash::WmShelf* wm_shelf = GetWmShelf();
std::unique_ptr<LauncherContextMenu> menu(
- new ArcLauncherContextMenu(controller(), &item, shelf));
+ new ArcLauncherContextMenu(controller(), &item, wm_shelf));
// Arc app is pinned but not running.
EXPECT_TRUE(
@@ -188,7 +194,7 @@ TEST_F(LauncherContextMenuTest, ArcLauncherContextMenuItemCheck) {
// Arc app is running.
arc_test().app_instance()->SendTaskCreated(1, arc_test().fake_apps()[0]);
- menu.reset(new ArcLauncherContextMenu(controller(), &item, shelf));
+ menu.reset(new ArcLauncherContextMenu(controller(), &item, wm_shelf));
EXPECT_FALSE(
IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW));
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_context_menu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698