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

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc

Issue 2171813004: mash: Fold ShelfItemDelegateManager into ShelfModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicitly destroy ShelfItemDelegates Created 4 years, 5 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/common/shelf/shelf_item_types.h" 7 #include "ash/common/shelf/shelf_item_types.h"
8 #include "ash/common/wm_root_window_controller.h" 8 #include "ash/common/wm_root_window_controller.h"
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ash::WmShelf* GetWmShelf() { 48 ash::WmShelf* GetWmShelf() {
49 return ash::WmShell::Get() 49 return ash::WmShell::Get()
50 ->GetPrimaryRootWindow() 50 ->GetPrimaryRootWindow()
51 ->GetRootWindowController() 51 ->GetRootWindowController()
52 ->GetShelf(); 52 ->GetShelf();
53 } 53 }
54 54
55 LauncherContextMenu* CreateLauncherContextMenu( 55 LauncherContextMenu* CreateLauncherContextMenu(
56 ash::ShelfItemType shelf_item_type) { 56 ash::ShelfItemType shelf_item_type) {
57 ash::ShelfItem item; 57 ash::ShelfItem item;
58 item.id = 1; // dummy id 58 item.id = 123; // dummy id
59 item.type = shelf_item_type; 59 item.type = shelf_item_type;
60 return LauncherContextMenu::Create(controller_.get(), &item, GetWmShelf()); 60 return LauncherContextMenu::Create(controller_.get(), &item, GetWmShelf());
61 } 61 }
62 62
63 LauncherContextMenu* CreateLauncherContextMenuForDesktopShell() { 63 LauncherContextMenu* CreateLauncherContextMenuForDesktopShell() {
64 ash::ShelfItem* item = nullptr; 64 ash::ShelfItem* item = nullptr;
65 return LauncherContextMenu::Create(controller_.get(), item, GetWmShelf()); 65 return LauncherContextMenu::Create(controller_.get(), item, GetWmShelf());
66 } 66 }
67 67
68 ArcAppTest& arc_test() { return arc_test_; } 68 ArcAppTest& arc_test() { return arc_test_; }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 arc_test().app_instance()->SendTaskCreated(1, arc_test().fake_apps()[0]); 196 arc_test().app_instance()->SendTaskCreated(1, arc_test().fake_apps()[0]);
197 menu.reset(new ArcLauncherContextMenu(controller(), &item, wm_shelf)); 197 menu.reset(new ArcLauncherContextMenu(controller(), &item, wm_shelf));
198 198
199 EXPECT_FALSE( 199 EXPECT_FALSE(
200 IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW)); 200 IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_OPEN_NEW));
201 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_PIN)); 201 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_PIN));
202 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_PIN)); 202 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_PIN));
203 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_CLOSE)); 203 EXPECT_TRUE(IsItemPresentInMenu(menu.get(), LauncherContextMenu::MENU_CLOSE));
204 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_CLOSE)); 204 EXPECT_TRUE(menu->IsCommandIdEnabled(LauncherContextMenu::MENU_CLOSE));
205 } 205 }
OLDNEW
« 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