| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |