| 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 ASSERT_EQ(item_count, shelf_model()->item_count()); | 850 ASSERT_EQ(item_count, shelf_model()->item_count()); |
| 851 const ash::ShelfItem& item1 = GetLastLauncherItem(); | 851 const ash::ShelfItem& item1 = GetLastLauncherItem(); |
| 852 ash::ShelfID item_id1 = item1.id; | 852 ash::ShelfID item_id1 = item1.id; |
| 853 EXPECT_EQ(ash::TYPE_APP, item1.type); | 853 EXPECT_EQ(ash::TYPE_APP, item1.type); |
| 854 EXPECT_EQ(ash::STATUS_ACTIVE, item1.status); | 854 EXPECT_EQ(ash::STATUS_ACTIVE, item1.status); |
| 855 | 855 |
| 856 ash::wm::ActivateWindow(browser()->window()->GetNativeWindow()); | 856 ash::wm::ActivateWindow(browser()->window()->GetNativeWindow()); |
| 857 EXPECT_EQ(ash::STATUS_RUNNING, shelf_model()->ItemByID(item_id1)->status); | 857 EXPECT_EQ(ash::STATUS_RUNNING, shelf_model()->ItemByID(item_id1)->status); |
| 858 } | 858 } |
| 859 | 859 |
| 860 // Flaky on Linux ChromiumOS bot -- crbug/720601. |
| 860 // Test that opening an app sets the correct icon | 861 // Test that opening an app sets the correct icon |
| 861 IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, SetIcon) { | 862 IN_PROC_BROWSER_TEST_F(LauncherPlatformAppBrowserTest, DISABLED_SetIcon) { |
| 862 TestAppWindowRegistryObserver test_observer(browser()->profile()); | 863 TestAppWindowRegistryObserver test_observer(browser()->profile()); |
| 863 | 864 |
| 864 // Enable experimental APIs to allow panel creation. | 865 // Enable experimental APIs to allow panel creation. |
| 865 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 866 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 866 extensions::switches::kEnableExperimentalExtensionApis); | 867 extensions::switches::kEnableExperimentalExtensionApis); |
| 867 | 868 |
| 868 int base_shelf_item_count = shelf_model()->item_count(); | 869 int base_shelf_item_count = shelf_model()->item_count(); |
| 869 ExtensionTestMessageListener completed_listener("Completed", false); | 870 ExtensionTestMessageListener completed_listener("Completed", false); |
| 870 LoadAndLaunchPlatformApp("app_icon", "Launched"); | 871 LoadAndLaunchPlatformApp("app_icon", "Launched"); |
| 871 | 872 |
| (...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2412 | 2413 |
| 2413 // Close all windows via the menu item. | 2414 // Close all windows via the menu item. |
| 2414 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2415 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2415 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2416 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2416 | 2417 |
| 2417 // Check if "Close" is removed from the context menu. | 2418 // Check if "Close" is removed from the context menu. |
| 2418 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2419 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2419 ASSERT_FALSE( | 2420 ASSERT_FALSE( |
| 2420 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2421 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2421 } | 2422 } |
| OLD | NEW |