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

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

Issue 2833173002: mash: Support ShelfModel access in Chrome. (Closed)
Patch Set: Cleanup; Fix an Arc test by use CLC, not Ash's ShelfModel. Created 3 years, 7 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
OLDNEW
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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/public/cpp/shelf_item_delegate.h" 9 #include "ash/public/cpp/shelf_item_delegate.h"
10 #include "ash/public/cpp/window_properties.h" 10 #include "ash/public/cpp/window_properties.h"
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 2401
2402 // Close all windows via the menu item. 2402 // Close all windows via the menu item.
2403 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); 2403 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE);
2404 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); 2404 EXPECT_EQ(0u, BrowserList::GetInstance()->size());
2405 2405
2406 // Check if "Close" is removed from the context menu. 2406 // Check if "Close" is removed from the context menu.
2407 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); 2407 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu();
2408 ASSERT_FALSE( 2408 ASSERT_FALSE(
2409 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); 2409 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE));
2410 } 2410 }
2411
2412 // Ensure Ash and Chrome ShelfModel changes are synchronized correctly.
2413 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ShelfModelSyncsWithAsh) {
2414 // The ChromeLauncherController instance should be initialized and contain
2415 // shelf items for the AppList and browser shortcut.
2416 ash::ShelfModel* model = controller_->shelf_model();
2417 EXPECT_EQ(2, model->item_count());
2418 constexpr char kAppListId[] = "jlfapfmkapbjlfbpjedlinehodkccjee";
2419 EXPECT_EQ(kAppListId, model->items()[0].id.app_id);
2420 EXPECT_EQ(extension_misc::kChromeAppId, model->items()[1].id.app_id);
2421 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698