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