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

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

Issue 2800263002: Revert of mash: Remove ChromeLauncherController's |id_to_item_controller_map_|. (Closed)
Patch Set: Created 3 years, 8 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
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
index d792aa29e5f511f2390b2ab0a4ebf6a56a1af0ee..9efd0ce03060905a8fd5e2fd18b116a15c9cc26a 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
@@ -254,7 +254,7 @@
}
ash::ShelfItemDelegate* GetShelfItemDelegate(ash::ShelfID id) {
- return shelf_model()->GetShelfItemDelegate(id);
+ return controller_->GetShelfItemDelegate(id);
}
ChromeLauncherControllerImpl* controller_;
@@ -788,7 +788,9 @@
const ash::ShelfItem& item1 = GetLastLauncherPanelItem();
EXPECT_EQ(ash::TYPE_APP_PANEL, item1.type);
EXPECT_EQ(ash::STATUS_RUNNING, item1.status);
- ash::ShelfItemDelegate* item1_delegate = GetShelfItemDelegate(item1.id);
+ EXPECT_EQ(nullptr, GetShelfItemDelegate(item1.id));
+ ash::ShelfItemDelegate* item1_delegate =
+ shelf_model()->GetShelfItemDelegate(item1.id);
EXPECT_EQ(ash::TYPE_APP_PANEL,
panel->GetNativeWindow()->GetProperty(ash::kShelfItemTypeKey));
// Click the item and confirm that the panel is activated.
@@ -826,7 +828,9 @@
const ash::ShelfItem& item1 = GetLastLauncherPanelItem();
EXPECT_EQ(ash::TYPE_APP_PANEL, item1.type);
EXPECT_EQ(ash::STATUS_RUNNING, item1.status);
- ash::ShelfItemDelegate* item1_delegate = GetShelfItemDelegate(item1.id);
+ EXPECT_EQ(nullptr, GetShelfItemDelegate(item1.id));
+ ash::ShelfItemDelegate* item1_delegate =
+ shelf_model()->GetShelfItemDelegate(item1.id);
EXPECT_EQ(ash::TYPE_APP_PANEL,
panel->GetNativeWindow()->GetProperty(ash::kShelfItemTypeKey));
// Click the item and confirm that the panel is activated.
@@ -906,6 +910,8 @@
ASSERT_TRUE(app_custom_icon_item_delegate);
EXPECT_TRUE(app_custom_icon_item_delegate->image_set_by_controller());
+ // Panels are handled by ShelfWindowWatcher, not ChromeLauncherController.
+ EXPECT_EQ(nullptr, GetShelfItemDelegate(panel_item.id));
// Ensure icon heights are correct (see test.js in app_icon/ test directory)
EXPECT_EQ(extension_misc::EXTENSION_ICON_SMALL, app_item.image.height());
EXPECT_EQ(extension_misc::EXTENSION_ICON_LARGE,
@@ -1540,7 +1546,10 @@
EXPECT_FALSE(panel->GetBaseWindow()->IsActive());
// Confirm that a shelf item was created and is the correct state.
const ash::ShelfItem& item = GetLastLauncherPanelItem();
- ash::ShelfItemDelegate* shelf_item_delegate = GetShelfItemDelegate(item.id);
+ // Panels are handled by ShelfWindowWatcher, not ChromeLauncherController.
+ EXPECT_EQ(nullptr, GetShelfItemDelegate(item.id));
+ ash::ShelfItemDelegate* shelf_item_delegate =
+ shelf_model()->GetShelfItemDelegate(item.id);
EXPECT_NE(nullptr, shelf_item_delegate);
EXPECT_EQ(ash::TYPE_APP_PANEL, item.type);
EXPECT_EQ(ash::STATUS_RUNNING, item.status);
@@ -1765,7 +1774,7 @@
// Now request to either activate an existing app or create a new one.
ash::ShelfItemDelegate* item_delegate =
- model_->GetShelfItemDelegate(shortcut_id);
+ controller_->GetShelfItemDelegate(shortcut_id);
SelectItem(item_delegate, ui::ET_KEY_RELEASED);
// Check that we have set focus on the existing application and nothing new

Powered by Google App Engine
This is Rietveld 408576698