| 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 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 bounds_shelf_1.CenterPoint().y()); | 1716 bounds_shelf_1.CenterPoint().y()); |
| 1717 base::MessageLoop::current()->RunUntilIdle(); | 1717 base::MessageLoop::current()->RunUntilIdle(); |
| 1718 // Issue an ESC and see that the operation gets cancelled. | 1718 // Issue an ESC and see that the operation gets cancelled. |
| 1719 generator.PressKey(ui::VKEY_ESCAPE, 0); | 1719 generator.PressKey(ui::VKEY_ESCAPE, 0); |
| 1720 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); | 1720 generator.ReleaseKey(ui::VKEY_ESCAPE, 0); |
| 1721 EXPECT_FALSE(grid_view->dragging()); | 1721 EXPECT_FALSE(grid_view->dragging()); |
| 1722 EXPECT_FALSE(grid_view->has_dragged_view()); | 1722 EXPECT_FALSE(grid_view->has_dragged_view()); |
| 1723 generator.ReleaseLeftButton(); | 1723 generator.ReleaseLeftButton(); |
| 1724 } | 1724 } |
| 1725 | 1725 |
| 1726 #if !defined(OS_WIN) | |
| 1727 // Used to test drag & drop an item between app list and shelf with multi | 1726 // Used to test drag & drop an item between app list and shelf with multi |
| 1728 // display environment. | 1727 // display environment. |
| 1729 class ShelfAppBrowserTestWithMultiMonitor | 1728 class ShelfAppBrowserTestWithMultiMonitor |
| 1730 : public ShelfAppBrowserTestNoDefaultBrowser { | 1729 : public ShelfAppBrowserTestNoDefaultBrowser { |
| 1731 protected: | 1730 protected: |
| 1732 ShelfAppBrowserTestWithMultiMonitor() {} | 1731 ShelfAppBrowserTestWithMultiMonitor() {} |
| 1733 ~ShelfAppBrowserTestWithMultiMonitor() override {} | 1732 ~ShelfAppBrowserTestWithMultiMonitor() override {} |
| 1734 | 1733 |
| 1735 void SetUpCommandLine(base::CommandLine* command_line) override { | 1734 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1736 ShelfAppBrowserTestNoDefaultBrowser::SetUpCommandLine(command_line); | 1735 ShelfAppBrowserTestNoDefaultBrowser::SetUpCommandLine(command_line); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 empty_slot_rect.CenterPoint().y()); | 1824 empty_slot_rect.CenterPoint().y()); |
| 1826 base::MessageLoop::current()->RunUntilIdle(); | 1825 base::MessageLoop::current()->RunUntilIdle(); |
| 1827 EXPECT_EQ(2, model_->item_count()); | 1826 EXPECT_EQ(2, model_->item_count()); |
| 1828 EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); | 1827 EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); |
| 1829 | 1828 |
| 1830 // Dropping it should keep the shelf as it originally was. | 1829 // Dropping it should keep the shelf as it originally was. |
| 1831 generator.ReleaseLeftButton(); | 1830 generator.ReleaseLeftButton(); |
| 1832 base::MessageLoop::current()->RunUntilIdle(); | 1831 base::MessageLoop::current()->RunUntilIdle(); |
| 1833 EXPECT_EQ(2, model_->item_count()); | 1832 EXPECT_EQ(2, model_->item_count()); |
| 1834 } | 1833 } |
| 1835 #endif | |
| 1836 | 1834 |
| 1837 // Do tests for removal of items from the shelf by dragging. | 1835 // Do tests for removal of items from the shelf by dragging. |
| 1838 // Disabled due to flake: http://crbug.com/448482 | 1836 // Disabled due to flake: http://crbug.com/448482 |
| 1839 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_DragOffShelf) { | 1837 IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_DragOffShelf) { |
| 1840 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), | 1838 ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow(), |
| 1841 gfx::Point()); | 1839 gfx::Point()); |
| 1842 ash::test::ShelfViewTestAPI test( | 1840 ash::test::ShelfViewTestAPI test( |
| 1843 ash::test::ShelfTestAPI(shelf_).shelf_view()); | 1841 ash::test::ShelfTestAPI(shelf_).shelf_view()); |
| 1844 test.SetAnimationDuration(1); // Speed up animations for test. | 1842 test.SetAnimationDuration(1); // Speed up animations for test. |
| 1845 // Create a known application and check that we have 3 items in the shelf. | 1843 // Create a known application and check that we have 3 items in the shelf. |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2233 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); | 2231 controller_->ActivateApp(bookmark_app->id(), ash::LAUNCH_FROM_APP_LIST, 0); |
| 2234 | 2232 |
| 2235 // There should be two new browsers. | 2233 // There should be two new browsers. |
| 2236 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); | 2234 EXPECT_EQ(3u, chrome::GetBrowserCount(browser()->profile())); |
| 2237 | 2235 |
| 2238 // The apps should now be running, with the last opened app active. | 2236 // The apps should now be running, with the last opened app active. |
| 2239 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); | 2237 EXPECT_EQ(ash::STATUS_RUNNING, model_->ItemByID(hosted_app_shelf_id)->status); |
| 2240 EXPECT_EQ(ash::STATUS_ACTIVE, | 2238 EXPECT_EQ(ash::STATUS_ACTIVE, |
| 2241 model_->ItemByID(bookmark_app_shelf_id)->status); | 2239 model_->ItemByID(bookmark_app_shelf_id)->status); |
| 2242 } | 2240 } |
| OLD | NEW |