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" |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 ASSERT_EQ(base_shelf_item_count + 2, shelf_item_count); | 809 ASSERT_EQ(base_shelf_item_count + 2, shelf_item_count); |
810 // The Panel will be the last item, the app second-to-last. | 810 // The Panel will be the last item, the app second-to-last. |
811 const ash::ShelfItem& app_item = | 811 const ash::ShelfItem& app_item = |
812 shelf_model()->items()[shelf_item_count - 2]; | 812 shelf_model()->items()[shelf_item_count - 2]; |
813 const ash::ShelfItem& panel_item = | 813 const ash::ShelfItem& panel_item = |
814 shelf_model()->items()[shelf_item_count - 1]; | 814 shelf_model()->items()[shelf_item_count - 1]; |
815 const LauncherItemController* app_item_controller = | 815 const LauncherItemController* app_item_controller = |
816 GetItemController(app_item.id); | 816 GetItemController(app_item.id); |
817 const LauncherItemController* panel_item_controller = | 817 const LauncherItemController* panel_item_controller = |
818 GetItemController(panel_item.id); | 818 GetItemController(panel_item.id); |
819 // Icons for Apps are set by the ShellWindowLauncherController, so | 819 // Icons for Apps are set by the AppWindowLauncherController, so |
820 // image_set_by_controller() should be set. | 820 // image_set_by_controller() should be set. |
821 EXPECT_TRUE(app_item_controller->image_set_by_controller()); | 821 EXPECT_TRUE(app_item_controller->image_set_by_controller()); |
822 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); | 822 EXPECT_TRUE(panel_item_controller->image_set_by_controller()); |
823 // 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) |
824 EXPECT_EQ(48, app_item.image.height()); | 824 EXPECT_EQ(48, app_item.image.height()); |
825 EXPECT_EQ(64, panel_item.image.height()); | 825 EXPECT_EQ(64, panel_item.image.height()); |
826 } | 826 } |
827 | 827 |
828 // Test that we can launch an app with a shortcut. | 828 // Test that we can launch an app with a shortcut. |
829 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { | 829 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchPinned) { |
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 GURL("http://www.foo.com/bar.html")); | 2022 GURL("http://www.foo.com/bar.html")); |
2023 // Make sure the navigation was entirely performed. | 2023 // Make sure the navigation was entirely performed. |
2024 base::MessageLoop::current()->RunUntilIdle(); | 2024 base::MessageLoop::current()->RunUntilIdle(); |
2025 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); | 2025 EXPECT_EQ(ash::STATUS_ACTIVE, model_->ItemByID(id)->status); |
2026 app_browser->tab_strip_model()->CloseWebContentsAt(0, | 2026 app_browser->tab_strip_model()->CloseWebContentsAt(0, |
2027 TabStripModel::CLOSE_NONE); | 2027 TabStripModel::CLOSE_NONE); |
2028 // Make sure that the app is really gone. | 2028 // Make sure that the app is really gone. |
2029 base::MessageLoop::current()->RunUntilIdle(); | 2029 base::MessageLoop::current()->RunUntilIdle(); |
2030 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); | 2030 EXPECT_EQ(ash::STATUS_CLOSED, model_->ItemByID(id)->status); |
2031 } | 2031 } |
OLD | NEW |