| 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 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2144 | 2144 |
| 2145 // Activate again. This doesn't create new browser, it activates the window. | 2145 // Activate again. This doesn't create new browser, it activates the window. |
| 2146 SelectItem(item_controller, ui::ET_UNKNOWN); | 2146 SelectItem(item_controller, ui::ET_UNKNOWN); |
| 2147 running_browser = chrome::GetTotalBrowserCount(); | 2147 running_browser = chrome::GetTotalBrowserCount(); |
| 2148 EXPECT_EQ(1u, running_browser); | 2148 EXPECT_EQ(1u, running_browser); |
| 2149 EXPECT_TRUE(controller_->IsOpen(id)); | 2149 EXPECT_TRUE(controller_->IsOpen(id)); |
| 2150 EXPECT_FALSE(window_state->IsMinimized()); | 2150 EXPECT_FALSE(window_state->IsMinimized()); |
| 2151 } | 2151 } |
| 2152 | 2152 |
| 2153 // Check that the window's ShelfID property matches that of the active tab. | 2153 // Check that the window's ShelfID property matches that of the active tab. |
| 2154 // TODO(https://crbug.com/694941): Disabled due to flakiness. | 2154 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, MatchingShelfIDandActiveTab) { |
| 2155 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, | |
| 2156 DISABLED_MatchingShelfIDandActiveTab) { | |
| 2157 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 2155 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
| 2158 EXPECT_EQ(1, browser()->tab_strip_model()->count()); | 2156 EXPECT_EQ(1, browser()->tab_strip_model()->count()); |
| 2159 EXPECT_EQ(0, browser()->tab_strip_model()->active_index()); | 2157 EXPECT_EQ(0, browser()->tab_strip_model()->active_index()); |
| 2160 EXPECT_EQ(2, model_->item_count()); | 2158 EXPECT_EQ(2, model_->item_count()); |
| 2161 | 2159 |
| 2162 ash::WmWindow* window = | 2160 ash::WmWindow* window = |
| 2163 ash::WmWindow::Get(browser()->window()->GetNativeWindow()); | 2161 ash::WmWindow::Get(browser()->window()->GetNativeWindow()); |
| 2164 | 2162 |
| 2165 int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); | 2163 int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); |
| 2166 ash::ShelfID browser_id = model_->items()[browser_index].id; | 2164 ash::ShelfID browser_id = model_->items()[browser_index].id; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2394 | 2392 |
| 2395 // Close all windows via the menu item. | 2393 // Close all windows via the menu item. |
| 2396 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2394 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2397 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2395 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2398 | 2396 |
| 2399 // Check if "Close" is removed from the context menu. | 2397 // Check if "Close" is removed from the context menu. |
| 2400 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2398 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2401 ASSERT_FALSE( | 2399 ASSERT_FALSE( |
| 2402 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2400 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2403 } | 2401 } |
| OLD | NEW |