| 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/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 shelf_model()->items()[shelf_item_count - 1]; | 847 shelf_model()->items()[shelf_item_count - 1]; |
| 848 const LauncherItemController* app_item_controller = | 848 const LauncherItemController* app_item_controller = |
| 849 GetItemController(app_item.id); | 849 GetItemController(app_item.id); |
| 850 const LauncherItemController* panel_item_controller = | 850 const LauncherItemController* panel_item_controller = |
| 851 GetItemController(panel_item.id); | 851 GetItemController(panel_item.id); |
| 852 // Icons for Apps are set by the AppWindowLauncherController, so | 852 // Icons for Apps are set by the AppWindowLauncherController, so |
| 853 // image_set_by_controller() should be set. | 853 // image_set_by_controller() should be set. |
| 854 EXPECT_TRUE(app_item_controller->image_set_by_controller()); | 854 EXPECT_TRUE(app_item_controller->image_set_by_controller()); |
| 855 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); | 855 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); |
| 856 // Ensure icon heights are correct (see test.js in app_icon/ test directory) | 856 // Ensure icon heights are correct (see test.js in app_icon/ test directory) |
| 857 EXPECT_EQ(ash::kShelfSize, app_item.image.height()); | 857 EXPECT_EQ(ash::GetShelfConstant(ash::SHELF_SIZE), app_item.image.height()); |
| 858 EXPECT_EQ(64, panel_item.image.height()); | 858 EXPECT_EQ(64, panel_item.image.height()); |
| 859 } | 859 } |
| 860 | 860 |
| 861 // Test that we can launch an app with a shortcut. | 861 // Test that we can launch an app with a shortcut. |
| 862 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { | 862 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { |
| 863 TabStripModel* tab_strip = browser()->tab_strip_model(); | 863 TabStripModel* tab_strip = browser()->tab_strip_model(); |
| 864 int tab_count = tab_strip->count(); | 864 int tab_count = tab_strip->count(); |
| 865 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 865 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
| 866 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); | 866 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); |
| 867 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); | 867 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); |
| (...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2291 // Close all windows. | 2291 // Close all windows. |
| 2292 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); | 2292 CloseBrowserWindow(browser(), menu1.get(), LauncherContextMenu::MENU_CLOSE); |
| 2293 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); | 2293 EXPECT_EQ(0u, BrowserList::GetInstance()->size()); |
| 2294 | 2294 |
| 2295 // Check if "Close" is removed from the context menu. | 2295 // Check if "Close" is removed from the context menu. |
| 2296 std::unique_ptr<LauncherContextMenu> menu2 = | 2296 std::unique_ptr<LauncherContextMenu> menu2 = |
| 2297 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT); | 2297 CreateLauncherContextMenu(ash::TYPE_BROWSER_SHORTCUT); |
| 2298 ASSERT_FALSE( | 2298 ASSERT_FALSE( |
| 2299 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); | 2299 IsItemPresentInMenu(menu2.get(), LauncherContextMenu::MENU_CLOSE)); |
| 2300 } | 2300 } |
| OLD | NEW |