| 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 // in its refocus url path. | 1195 // in its refocus url path. |
| 1196 WmShelf::ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); | 1196 WmShelf::ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); |
| 1197 EXPECT_EQ(++tab_count, tab_strip->count()); | 1197 EXPECT_EQ(++tab_count, tab_strip->count()); |
| 1198 WebContents* second_tab = tab_strip->GetActiveWebContents(); | 1198 WebContents* second_tab = tab_strip->GetActiveWebContents(); |
| 1199 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(shortcut_id)->status); | 1199 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(shortcut_id)->status); |
| 1200 EXPECT_NE(first_tab, second_tab); | 1200 EXPECT_NE(first_tab, second_tab); |
| 1201 EXPECT_EQ(tab_strip->GetActiveWebContents(), second_tab); | 1201 EXPECT_EQ(tab_strip->GetActiveWebContents(), second_tab); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 // Check the launcher activation state for applications and browser. | 1204 // Check the launcher activation state for applications and browser. |
| 1205 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, ActivationStateCheck) { | 1205 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_ActivationStateCheck) { |
| 1206 TabStripModel* tab_strip = browser()->tab_strip_model(); | 1206 TabStripModel* tab_strip = browser()->tab_strip_model(); |
| 1207 // Get the browser item index | 1207 // Get the browser item index |
| 1208 int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); | 1208 int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); |
| 1209 EXPECT_TRUE(browser_index >= 0); | 1209 EXPECT_TRUE(browser_index >= 0); |
| 1210 | 1210 |
| 1211 // Even though we are just comming up, the browser should be active. | 1211 // Even though we are just comming up, the browser should be active. |
| 1212 EXPECT_EQ(ash::STATUS_ACTIVE, model_->items()[browser_index].status); | 1212 EXPECT_EQ(ash::STATUS_ACTIVE, model_->items()[browser_index].status); |
| 1213 | 1213 |
| 1214 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 1214 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
| 1215 controller_->SetRefocusURLPatternForTest( | 1215 controller_->SetRefocusURLPatternForTest( |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2392 | 2392 |
| 2393 // Close all windows via the menu item. | 2393 // Close all windows via the menu item. |
| 2394 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2394 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2395 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2395 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2396 | 2396 |
| 2397 // Check if "Close" is removed from the context menu. | 2397 // Check if "Close" is removed from the context menu. |
| 2398 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); | 2398 std::unique_ptr<LauncherContextMenu> menu2 = CreateBrowserItemContextMenu(); |
| 2399 ASSERT_FALSE( | 2399 ASSERT_FALSE( |
| 2400 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2400 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2401 } | 2401 } |
| OLD | NEW |