| 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/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 shelf_model()->items()[shelf_item_count - 1]; | 813 shelf_model()->items()[shelf_item_count - 1]; |
| 814 const LauncherItemController* app_item_controller = | 814 const LauncherItemController* app_item_controller = |
| 815 GetItemController(app_item.id); | 815 GetItemController(app_item.id); |
| 816 const LauncherItemController* panel_item_controller = | 816 const LauncherItemController* panel_item_controller = |
| 817 GetItemController(panel_item.id); | 817 GetItemController(panel_item.id); |
| 818 // Icons for Apps are set by the AppWindowLauncherController, so | 818 // Icons for Apps are set by the AppWindowLauncherController, so |
| 819 // image_set_by_controller() should be set. | 819 // image_set_by_controller() should be set. |
| 820 EXPECT_TRUE(app_item_controller->image_set_by_controller()); | 820 EXPECT_TRUE(app_item_controller->image_set_by_controller()); |
| 821 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); | 821 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); |
| 822 // Ensure icon heights are correct (see test.js in app_icon/ test directory) | 822 // Ensure icon heights are correct (see test.js in app_icon/ test directory) |
| 823 EXPECT_EQ(ash::kShelfSize, app_item.image.height()); | 823 EXPECT_EQ(ash::GetShelfLayoutConstant(ash::SHELF_SIZE), |
| 824 app_item.image.height()); |
| 824 EXPECT_EQ(64, panel_item.image.height()); | 825 EXPECT_EQ(64, panel_item.image.height()); |
| 825 } | 826 } |
| 826 | 827 |
| 827 // Test that we can launch an app with a shortcut. | 828 // Test that we can launch an app with a shortcut. |
| 828 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { | 829 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { |
| 829 TabStripModel* tab_strip = browser()->tab_strip_model(); | 830 TabStripModel* tab_strip = browser()->tab_strip_model(); |
| 830 int tab_count = tab_strip->count(); | 831 int tab_count = tab_strip->count(); |
| 831 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 832 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
| 832 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); | 833 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); |
| 833 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); | 834 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); |
| (...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2231 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2232 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2232 | 2233 |
| 2233 // There should be two new browsers. | 2234 // There should be two new browsers. |
| 2234 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); | 2235 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); |
| 2235 | 2236 |
| 2236 // The apps should now be running, with the last opened app active. | 2237 // The apps should now be running, with the last opened app active. |
| 2237 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); | 2238 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); |
| 2238 EXPECT_EQ(ash::STATUS_ACTIVE, | 2239 EXPECT_EQ(ash::STATUS_ACTIVE, |
| 2239 model_->ItemByID(bookmark_app_shelf_id)->status); | 2240 model_->ItemByID(bookmark_app_shelf_id)->status); |
| 2240 } | 2241 } |
| OLD | NEW |