OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shelf/shelf_view.h" | 5 #include "ash/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "ash/test/ash_test_base.h" | 30 #include "ash/test/ash_test_base.h" |
31 #include "ash/test/ash_test_helper.h" | 31 #include "ash/test/ash_test_helper.h" |
32 #include "ash/test/overflow_bubble_view_test_api.h" | 32 #include "ash/test/overflow_bubble_view_test_api.h" |
33 #include "ash/test/overflow_button_test_api.h" | 33 #include "ash/test/overflow_button_test_api.h" |
34 #include "ash/test/shelf_view_test_api.h" | 34 #include "ash/test/shelf_view_test_api.h" |
35 #include "ash/test/shell_test_api.h" | 35 #include "ash/test/shell_test_api.h" |
36 #include "ash/test/test_shell_delegate.h" | 36 #include "ash/test/test_shell_delegate.h" |
37 #include "ash/test/test_system_tray_delegate.h" | 37 #include "ash/test/test_system_tray_delegate.h" |
38 #include "ash/test/wallpaper_controller_test_api.h" | 38 #include "ash/test/wallpaper_controller_test_api.h" |
39 #include "ash/wallpaper/wallpaper_controller.h" | 39 #include "ash/wallpaper/wallpaper_controller.h" |
40 #include "ash/wm_window.h" | |
41 #include "base/i18n/rtl.h" | 40 #include "base/i18n/rtl.h" |
42 #include "base/macros.h" | 41 #include "base/macros.h" |
43 #include "base/memory/ptr_util.h" | 42 #include "base/memory/ptr_util.h" |
44 #include "base/numerics/safe_conversions.h" | 43 #include "base/numerics/safe_conversions.h" |
45 #include "base/run_loop.h" | 44 #include "base/run_loop.h" |
46 #include "base/strings/string_number_conversions.h" | 45 #include "base/strings/string_number_conversions.h" |
47 #include "base/strings/utf_string_conversions.h" | 46 #include "base/strings/utf_string_conversions.h" |
48 #include "base/test/histogram_tester.h" | 47 #include "base/test/histogram_tester.h" |
49 #include "base/test/scoped_mock_time_message_loop_task_runner.h" | 48 #include "base/test/scoped_mock_time_message_loop_task_runner.h" |
50 #include "base/test/user_action_tester.h" | 49 #include "base/test/user_action_tester.h" |
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1719 | 1718 |
1720 ShelfView* shelf_view_for_secondary = | 1719 ShelfView* shelf_view_for_secondary = |
1721 secondary_shelf->GetShelfViewForTesting(); | 1720 secondary_shelf->GetShelfViewForTesting(); |
1722 | 1721 |
1723 ShelfViewTestAPI test_api_for_secondary_shelf_view(shelf_view_for_secondary); | 1722 ShelfViewTestAPI test_api_for_secondary_shelf_view(shelf_view_for_secondary); |
1724 ShelfButton* button = | 1723 ShelfButton* button = |
1725 test_api_for_secondary_shelf_view.GetButton(browser_index); | 1724 test_api_for_secondary_shelf_view.GetButton(browser_index); |
1726 | 1725 |
1727 // Fetch the start point of dragging. | 1726 // Fetch the start point of dragging. |
1728 gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); | 1727 gfx::Point start_point = button->GetBoundsInScreen().CenterPoint(); |
1729 start_point = | 1728 ::wm::ConvertPointFromScreen(secondary_shelf->GetWindow(), &start_point); |
1730 secondary_shelf->GetWindow()->ConvertPointFromScreen(start_point); | |
1731 | |
1732 ui::test::EventGenerator generator(Shell::GetAllRootWindows()[1], | 1729 ui::test::EventGenerator generator(Shell::GetAllRootWindows()[1], |
1733 start_point); | 1730 start_point); |
1734 | 1731 |
1735 // Rip off the browser item. | 1732 // Rip off the browser item. |
1736 generator.PressLeftButton(); | 1733 generator.PressLeftButton(); |
1737 generator.MoveMouseTo(start_point.x() + 400, start_point.y()); | 1734 generator.MoveMouseTo(start_point.x() + 400, start_point.y()); |
1738 test_api_for_secondary_shelf_view.RunMessageLoopUntilAnimationsDone(); | 1735 test_api_for_secondary_shelf_view.RunMessageLoopUntilAnimationsDone(); |
1739 EXPECT_TRUE(test_api_for_secondary_shelf_view.IsRippedOffFromShelf()); | 1736 EXPECT_TRUE(test_api_for_secondary_shelf_view.IsRippedOffFromShelf()); |
1740 } | 1737 } |
1741 | 1738 |
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3137 EXPECT_EQ(views::InkDropState::ACTIVATED, | 3134 EXPECT_EQ(views::InkDropState::ACTIVATED, |
3138 overflow_button_ink_drop_->GetTargetInkDropState()); | 3135 overflow_button_ink_drop_->GetTargetInkDropState()); |
3139 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | 3136 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), |
3140 IsEmpty()); | 3137 IsEmpty()); |
3141 | 3138 |
3142 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 3139 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
3143 } | 3140 } |
3144 | 3141 |
3145 } // namespace test | 3142 } // namespace test |
3146 } // namespace ash | 3143 } // namespace ash |
OLD | NEW |