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/common/shelf/app_list_button.h" | 9 #include "ash/common/shelf/app_list_button.h" |
10 #include "ash/common/shelf/shelf_button.h" | 10 #include "ash/common/shelf/shelf_button.h" |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); | 1078 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); |
1079 | 1079 |
1080 // Navigate back. | 1080 // Navigate back. |
1081 ui_test_utils::NavigateToURL( | 1081 ui_test_utils::NavigateToURL( |
1082 browser(), GURL("http://www.example.com/path1/foo.html")); | 1082 browser(), GURL("http://www.example.com/path1/foo.html")); |
1083 EXPECT_EQ(ash::STATUS_ACTIVE, (*model_->ItemByID(shortcut_id)).status); | 1083 EXPECT_EQ(ash::STATUS_ACTIVE, (*model_->ItemByID(shortcut_id)).status); |
1084 } | 1084 } |
1085 | 1085 |
1086 // Confirm that a tab can be moved between browsers while maintaining the | 1086 // Confirm that a tab can be moved between browsers while maintaining the |
1087 // correct running state. | 1087 // correct running state. |
1088 // Disabled due to flake: crbug.com/693341. | 1088 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, TabDragAndDrop) { |
1089 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_TabDragAndDrop) { | 1089 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
1090 TabStripModel* tab_strip_model1 = browser()->tab_strip_model(); | 1090 TabStripModel* tab_strip_model1 = browser()->tab_strip_model(); |
1091 EXPECT_EQ(1, tab_strip_model1->count()); | 1091 EXPECT_EQ(1, tab_strip_model1->count()); |
1092 int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); | 1092 const int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); |
1093 EXPECT_TRUE(browser_index >= 0); | 1093 EXPECT_GE(browser_index, 0); |
1094 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | |
1095 | 1094 |
1096 // Create a shortcut for app1. | 1095 // Create a shortcut for app1. |
1097 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 1096 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
1098 EXPECT_EQ(ash::STATUS_ACTIVE, model_->items()[browser_index].status); | 1097 EXPECT_EQ(ash::STATUS_ACTIVE, model_->items()[browser_index].status); |
1099 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); | 1098 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); |
1100 | 1099 |
1101 // Activate app1 and check its item status. | 1100 // Activate app1 and check its item status. |
1102 WmShelf::ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); | 1101 WmShelf::ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); |
1103 EXPECT_EQ(2, tab_strip_model1->count()); | 1102 EXPECT_EQ(2, tab_strip_model1->count()); |
1104 EXPECT_EQ(ash::STATUS_RUNNING, model_->items()[browser_index].status); | 1103 EXPECT_EQ(ash::STATUS_RUNNING, model_->items()[browser_index].status); |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 | 2410 |
2412 // Close all windows via the menu item. | 2411 // Close all windows via the menu item. |
2413 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2412 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
2414 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2413 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
2415 | 2414 |
2416 // Check if "Close" is removed from the context menu. | 2415 // Check if "Close" is removed from the context menu. |
2417 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2416 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
2418 ASSERT_FALSE( | 2417 ASSERT_FALSE( |
2419 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2418 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
2420 } | 2419 } |
OLD | NEW |