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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/launcher/launcher_types.h" | |
12 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
13 #include "ash/shelf/overflow_bubble.h" | 12 #include "ash/shelf/overflow_bubble.h" |
14 #include "ash/shelf/overflow_bubble_view.h" | 13 #include "ash/shelf/overflow_bubble_view.h" |
15 #include "ash/shelf/shelf.h" | 14 #include "ash/shelf/shelf.h" |
16 #include "ash/shelf/shelf_button.h" | 15 #include "ash/shelf/shelf_button.h" |
| 16 #include "ash/shelf/shelf_constants.h" |
17 #include "ash/shelf/shelf_icon_observer.h" | 17 #include "ash/shelf/shelf_icon_observer.h" |
18 #include "ash/shelf/shelf_item_delegate_manager.h" | 18 #include "ash/shelf/shelf_item_delegate_manager.h" |
19 #include "ash/shelf/shelf_layout_manager.h" | 19 #include "ash/shelf/shelf_layout_manager.h" |
20 #include "ash/shelf/shelf_model.h" | 20 #include "ash/shelf/shelf_model.h" |
21 #include "ash/shelf/shelf_tooltip_manager.h" | 21 #include "ash/shelf/shelf_tooltip_manager.h" |
22 #include "ash/shelf/shelf_widget.h" | 22 #include "ash/shelf/shelf_widget.h" |
23 #include "ash/shell.h" | 23 #include "ash/shell.h" |
24 #include "ash/shell_window_ids.h" | 24 #include "ash/shell_window_ids.h" |
25 #include "ash/test/ash_test_base.h" | 25 #include "ash/test/ash_test_base.h" |
26 #include "ash/test/overflow_bubble_view_test_api.h" | 26 #include "ash/test/overflow_bubble_view_test_api.h" |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 AddPlatformAppNoWait(); | 1467 AddPlatformAppNoWait(); |
1468 while (!test_api_->IsOverflowButtonVisible()) { | 1468 while (!test_api_->IsOverflowButtonVisible()) { |
1469 test_api_->RunMessageLoopUntilAnimationsDone(); | 1469 test_api_->RunMessageLoopUntilAnimationsDone(); |
1470 AddPlatformAppNoWait(); | 1470 AddPlatformAppNoWait(); |
1471 ++items_added; | 1471 ++items_added; |
1472 ASSERT_LT(items_added, 10000); | 1472 ASSERT_LT(items_added, 10000); |
1473 } | 1473 } |
1474 | 1474 |
1475 // Resize shelf view with that animation running and stay overflown. | 1475 // Resize shelf view with that animation running and stay overflown. |
1476 gfx::Rect bounds = shelf_view_->bounds(); | 1476 gfx::Rect bounds = shelf_view_->bounds(); |
1477 bounds.set_width(bounds.width() - kLauncherPreferredSize); | 1477 bounds.set_width(bounds.width() - kShelfPreferredSize); |
1478 shelf_view_->SetBoundsRect(bounds); | 1478 shelf_view_->SetBoundsRect(bounds); |
1479 ASSERT_TRUE(test_api_->IsOverflowButtonVisible()); | 1479 ASSERT_TRUE(test_api_->IsOverflowButtonVisible()); |
1480 | 1480 |
1481 // Finish the animation. | 1481 // Finish the animation. |
1482 test_api_->RunMessageLoopUntilAnimationsDone(); | 1482 test_api_->RunMessageLoopUntilAnimationsDone(); |
1483 | 1483 |
1484 // App list button should ends up in its new ideal bounds. | 1484 // App list button should ends up in its new ideal bounds. |
1485 const int app_list_button_index = test_api_->GetButtonCount() - 1; | 1485 const int app_list_button_index = test_api_->GetButtonCount() - 1; |
1486 const gfx::Rect& app_list_ideal_bounds = | 1486 const gfx::Rect& app_list_ideal_bounds = |
1487 test_api_->GetIdealBoundsByIndex(app_list_button_index); | 1487 test_api_->GetIdealBoundsByIndex(app_list_button_index); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 test_api_->RunMessageLoopUntilAnimationsDone(); | 1777 test_api_->RunMessageLoopUntilAnimationsDone(); |
1778 CheckAllItemsAreInBounds(); | 1778 CheckAllItemsAreInBounds(); |
1779 } | 1779 } |
1780 | 1780 |
1781 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); | 1781 INSTANTIATE_TEST_CASE_P(LtrRtl, ShelfViewTextDirectionTest, testing::Bool()); |
1782 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, | 1782 INSTANTIATE_TEST_CASE_P(VisibleBounds, ShelfViewVisibleBoundsTest, |
1783 testing::Bool()); | 1783 testing::Bool()); |
1784 | 1784 |
1785 } // namespace test | 1785 } // namespace test |
1786 } // namespace ash | 1786 } // namespace ash |
OLD | NEW |