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/native_app_window.h" | 7 #include "apps/native_app_window.h" |
8 #include "apps/shell_window.h" | 8 #include "apps/shell_window.h" |
9 #include "apps/shell_window_registry.h" | 9 #include "apps/shell_window_registry.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 EXPECT_EQ(3, model_->item_count()); // No new item got added. | 1585 EXPECT_EQ(3, model_->item_count()); // No new item got added. |
1586 EXPECT_TRUE(grid_view->forward_events_to_drag_and_drop_host_for_test()); | 1586 EXPECT_TRUE(grid_view->forward_events_to_drag_and_drop_host_for_test()); |
1587 generator.ReleaseLeftButton(); | 1587 generator.ReleaseLeftButton(); |
1588 base::MessageLoop::current()->RunUntilIdle(); | 1588 base::MessageLoop::current()->RunUntilIdle(); |
1589 EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); | 1589 EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); |
1590 EXPECT_EQ(3, model_->item_count()); // And it remains that way. | 1590 EXPECT_EQ(3, model_->item_count()); // And it remains that way. |
1591 } | 1591 } |
1592 | 1592 |
1593 // Do tests for removal of items from the shelf by dragging. | 1593 // Do tests for removal of items from the shelf by dragging. |
1594 IN_PROC_BROWSER_TEST_F(LauncherAppBrowserTest, DragOffShelf) { | 1594 IN_PROC_BROWSER_TEST_F(LauncherAppBrowserTest, DragOffShelf) { |
1595 // Set the command line option to enable the new functionality. | |
1596 CommandLine::ForCurrentProcess()->AppendSwitch( | |
1597 ash::switches::kAshEnableDragOffShelf); | |
1598 aura::test::EventGenerator generator( | 1595 aura::test::EventGenerator generator( |
1599 ash::Shell::GetPrimaryRootWindow(), gfx::Point()); | 1596 ash::Shell::GetPrimaryRootWindow(), gfx::Point()); |
1600 ash::test::LauncherViewTestAPI test(launcher_->GetLauncherViewForTest()); | 1597 ash::test::LauncherViewTestAPI test(launcher_->GetLauncherViewForTest()); |
1601 | 1598 |
1602 // Create a known application and check that we have 3 items in the launcher. | 1599 // Create a known application and check that we have 3 items in the launcher. |
1603 CreateShortcut("app1"); | 1600 CreateShortcut("app1"); |
1604 EXPECT_EQ(3, model_->item_count()); | 1601 EXPECT_EQ(3, model_->item_count()); |
1605 | 1602 |
1606 // Test #1: Ripping out the browser item should not change anything. | 1603 // Test #1: Ripping out the browser item should not change anything. |
1607 int browser_index = GetIndexOfLauncherItemType(ash::TYPE_BROWSER_SHORTCUT); | 1604 int browser_index = GetIndexOfLauncherItemType(ash::TYPE_BROWSER_SHORTCUT); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 // Now show overflow bubble. | 1772 // Now show overflow bubble. |
1776 test.ShowOverflowBubble(); | 1773 test.ShowOverflowBubble(); |
1777 EXPECT_TRUE(launcher_->IsShowingOverflowBubble()); | 1774 EXPECT_TRUE(launcher_->IsShowingOverflowBubble()); |
1778 | 1775 |
1779 // Unpin first pinned app and there should be no crash. | 1776 // Unpin first pinned app and there should be no crash. |
1780 controller_->UnpinAppWithID(std::string("fake_app_0")); | 1777 controller_->UnpinAppWithID(std::string("fake_app_0")); |
1781 | 1778 |
1782 test.RunMessageLoopUntilAnimationsDone(); | 1779 test.RunMessageLoopUntilAnimationsDone(); |
1783 EXPECT_FALSE(launcher_->IsShowingOverflowBubble()); | 1780 EXPECT_FALSE(launcher_->IsShowingOverflowBubble()); |
1784 } | 1781 } |
OLD | NEW |