| 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 "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| 11 #include "ash/display/display_controller.h" | 11 #include "ash/display/display_controller.h" |
| 12 #include "ash/shelf/shelf.h" | 12 #include "ash/shelf/shelf.h" |
| 13 #include "ash/shelf/shelf_button.h" | 13 #include "ash/shelf/shelf_button.h" |
| 14 #include "ash/shelf/shelf_constants.h" | |
| 15 #include "ash/shelf/shelf_model.h" | 14 #include "ash/shelf/shelf_model.h" |
| 16 #include "ash/shelf/shelf_util.h" | 15 #include "ash/shelf/shelf_util.h" |
| 17 #include "ash/shelf/shelf_view.h" | 16 #include "ash/shelf/shelf_view.h" |
| 18 #include "ash/shell.h" | 17 #include "ash/shell.h" |
| 19 #include "ash/test/app_list_controller_test_api.h" | 18 #include "ash/test/app_list_controller_test_api.h" |
| 20 #include "ash/test/shelf_test_api.h" | 19 #include "ash/test/shelf_test_api.h" |
| 21 #include "ash/test/shelf_view_test_api.h" | 20 #include "ash/test/shelf_view_test_api.h" |
| 22 #include "ash/test/shell_test_api.h" | 21 #include "ash/test/shell_test_api.h" |
| 23 #include "ash/wm/window_state.h" | 22 #include "ash/wm/window_state.h" |
| 24 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 shelf_model()->items()[shelf_item_count - 1]; | 814 shelf_model()->items()[shelf_item_count - 1]; |
| 816 const LauncherItemController* app_item_controller = | 815 const LauncherItemController* app_item_controller = |
| 817 GetItemController(app_item.id); | 816 GetItemController(app_item.id); |
| 818 const LauncherItemController* panel_item_controller = | 817 const LauncherItemController* panel_item_controller = |
| 819 GetItemController(panel_item.id); | 818 GetItemController(panel_item.id); |
| 820 // Icons for Apps are set by the AppWindowLauncherController, so | 819 // Icons for Apps are set by the AppWindowLauncherController, so |
| 821 // image_set_by_controller() should be set. | 820 // image_set_by_controller() should be set. |
| 822 EXPECT_TRUE(app_item_controller->image_set_by_controller()); | 821 EXPECT_TRUE(app_item_controller->image_set_by_controller()); |
| 823 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); | 822 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); |
| 824 // Ensure icon heights are correct (see test.js in app_icon/ test directory) | 823 // Ensure icon heights are correct (see test.js in app_icon/ test directory) |
| 825 EXPECT_EQ(ash::kShelfSize, app_item.image.height()); | 824 EXPECT_EQ(48, app_item.image.height()); |
| 826 EXPECT_EQ(64, panel_item.image.height()); | 825 EXPECT_EQ(64, panel_item.image.height()); |
| 827 } | 826 } |
| 828 | 827 |
| 829 // Test that we can launch an app with a shortcut. | 828 // Test that we can launch an app with a shortcut. |
| 830 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { | 829 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { |
| 831 TabStripModel* tab_strip = browser()->tab_strip_model(); | 830 TabStripModel* tab_strip = browser()->tab_strip_model(); |
| 832 int tab_count = tab_strip->count(); | 831 int tab_count = tab_strip->count(); |
| 833 ash::ShelfID shortcut_id = CreateShortcut("app1"); | 832 ash::ShelfID shortcut_id = CreateShortcut("app1"); |
| 834 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); | 833 EXPECT_EQ(ash::STATUS_CLOSED, (*model_->ItemByID(shortcut_id)).status); |
| 835 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); | 834 ActivateShelfItem(model_->ItemIndexByID(shortcut_id)); |
| (...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2025 GURL("http://www.foo.com/bar.html")); | 2024 GURL("http://www.foo.com/bar.html")); |
| 2026 // Make sure the navigation was entirely performed. | 2025 // Make sure the navigation was entirely performed. |
| 2027 base::MessageLoop::current()->RunUntilIdle(); | 2026 base::MessageLoop::current()->RunUntilIdle(); |
| 2028 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 2027 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); |
| 2029 app_browser->tab_strip_model()->CloseWebContentsAt(0, | 2028 app_browser->tab_strip_model()->CloseWebContentsAt(0, |
| 2030 TabStripModel::CLOSE_NONE); | 2029 TabStripModel::CLOSE_NONE); |
| 2031 // Make sure that the app is really gone. | 2030 // Make sure that the app is really gone. |
| 2032 base::MessageLoop::current()->RunUntilIdle(); | 2031 base::MessageLoop::current()->RunUntilIdle(); |
| 2033 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 2032 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); |
| 2034 } | 2033 } |
| OLD | NEW |