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 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 ash::test::ShelfTestAPI(secondary_shelf).shelf_view()); | 1757 ash::test::ShelfTestAPI(secondary_shelf).shelf_view()); |
1758 AppListService* service = AppListService::Get(); | 1758 AppListService* service = AppListService::Get(); |
1759 | 1759 |
1760 // There should be two items in our shelf by this time. | 1760 // There should be two items in our shelf by this time. |
1761 EXPECT_EQ(2, model_->item_count()); | 1761 EXPECT_EQ(2, model_->item_count()); |
1762 EXPECT_FALSE(service->IsAppListVisible()); | 1762 EXPECT_FALSE(service->IsAppListVisible()); |
1763 | 1763 |
1764 // Open the app list menu and check that the drag and drop host was set. | 1764 // Open the app list menu and check that the drag and drop host was set. |
1765 gfx::Rect app_list_bounds = | 1765 gfx::Rect app_list_bounds = |
1766 test.shelf_view()->GetAppListButtonView()->GetBoundsInScreen(); | 1766 test.shelf_view()->GetAppListButtonView()->GetBoundsInScreen(); |
1767 gfx::Display display = | 1767 display::Display display = |
1768 gfx::Screen::GetScreen()->GetDisplayNearestWindow(secondary_root_window); | 1768 display::Screen::GetScreen()->GetDisplayNearestWindow( |
| 1769 secondary_root_window); |
1769 const gfx::Point& origin = display.bounds().origin(); | 1770 const gfx::Point& origin = display.bounds().origin(); |
1770 app_list_bounds.Offset(-origin.x(), -origin.y()); | 1771 app_list_bounds.Offset(-origin.x(), -origin.y()); |
1771 | 1772 |
1772 generator.MoveMouseTo(app_list_bounds.CenterPoint().x(), | 1773 generator.MoveMouseTo(app_list_bounds.CenterPoint().x(), |
1773 app_list_bounds.CenterPoint().y()); | 1774 app_list_bounds.CenterPoint().y()); |
1774 generator.ClickLeftButton(); | 1775 generator.ClickLeftButton(); |
1775 base::MessageLoop::current()->RunUntilIdle(); | 1776 base::MessageLoop::current()->RunUntilIdle(); |
1776 EXPECT_TRUE(service->IsAppListVisible()); | 1777 EXPECT_TRUE(service->IsAppListVisible()); |
1777 | 1778 |
1778 // Click the "all apps" button on the start page. | 1779 // Click the "all apps" button on the start page. |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2232 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2233 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
2233 | 2234 |
2234 // There should be two new browsers. | 2235 // There should be two new browsers. |
2235 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); | 2236 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); |
2236 | 2237 |
2237 // The apps should now be running, with the last opened app active. | 2238 // The apps should now be running, with the last opened app active. |
2238 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); | 2239 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); |
2239 EXPECT_EQ(ash::STATUS_ACTIVE, | 2240 EXPECT_EQ(ash::STATUS_ACTIVE, |
2240 model_->ItemByID(bookmark_app_shelf_id)->status); | 2241 model_->ItemByID(bookmark_app_shelf_id)->status); |
2241 } | 2242 } |
OLD | NEW |