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_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
10 #include "ash/common/shelf/app_list_button.h" | 10 #include "ash/common/shelf/app_list_button.h" |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 const Extension* extension1 = LoadAndLaunchPlatformApp("launch", "Launched"); | 705 const Extension* extension1 = LoadAndLaunchPlatformApp("launch", "Launched"); |
706 AppWindow* window1 = CreateAppWindow(browser()->profile(), extension1); | 706 AppWindow* window1 = CreateAppWindow(browser()->profile(), extension1); |
707 EXPECT_TRUE(window1->GetNativeWindow()->IsVisible()); | 707 EXPECT_TRUE(window1->GetNativeWindow()->IsVisible()); |
708 EXPECT_TRUE(window1->GetBaseWindow()->IsActive()); | 708 EXPECT_TRUE(window1->GetBaseWindow()->IsActive()); |
709 | 709 |
710 // Confirm that a controller item was created and is the correct state. | 710 // Confirm that a controller item was created and is the correct state. |
711 const ash::ShelfItem& item1 = GetLastLauncherItem(); | 711 const ash::ShelfItem& item1 = GetLastLauncherItem(); |
712 LauncherItemController* item1_controller = GetItemController(item1.id); | 712 LauncherItemController* item1_controller = GetItemController(item1.id); |
713 EXPECT_EQ(ash::TYPE_APP, item1.type); | 713 EXPECT_EQ(ash::TYPE_APP, item1.type); |
714 EXPECT_EQ(ash::STATUS_ACTIVE, item1.status); | 714 EXPECT_EQ(ash::STATUS_ACTIVE, item1.status); |
715 EXPECT_EQ(LauncherItemController::TYPE_APP, item1_controller->type()); | |
716 // Since it is already active, clicking it should minimize. | 715 // Since it is already active, clicking it should minimize. |
717 TestEvent click_event(ui::ET_MOUSE_PRESSED); | 716 TestEvent click_event(ui::ET_MOUSE_PRESSED); |
718 item1_controller->ItemSelected(click_event); | 717 item1_controller->ItemSelected(click_event); |
719 EXPECT_FALSE(window1->GetNativeWindow()->IsVisible()); | 718 EXPECT_FALSE(window1->GetNativeWindow()->IsVisible()); |
720 EXPECT_FALSE(window1->GetBaseWindow()->IsActive()); | 719 EXPECT_FALSE(window1->GetBaseWindow()->IsActive()); |
721 EXPECT_TRUE(window1->GetBaseWindow()->IsMinimized()); | 720 EXPECT_TRUE(window1->GetBaseWindow()->IsMinimized()); |
722 EXPECT_EQ(ash::STATUS_RUNNING, item1.status); | 721 EXPECT_EQ(ash::STATUS_RUNNING, item1.status); |
723 // Clicking the item again should activate the window again. | 722 // Clicking the item again should activate the window again. |
724 item1_controller->ItemSelected(click_event); | 723 item1_controller->ItemSelected(click_event); |
725 EXPECT_TRUE(window1->GetNativeWindow()->IsVisible()); | 724 EXPECT_TRUE(window1->GetNativeWindow()->IsVisible()); |
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2418 | 2417 |
2419 // Close all windows via the menu item. | 2418 // Close all windows via the menu item. |
2420 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2419 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
2421 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2420 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
2422 | 2421 |
2423 // Check if "Close" is removed from the context menu. | 2422 // Check if "Close" is removed from the context menu. |
2424 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2423 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
2425 ASSERT_FALSE( | 2424 ASSERT_FALSE( |
2426 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2425 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
2427 } | 2426 } |
OLD | NEW |