| 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 17 matching lines...) Expand all Loading... |
| 28 #include "ash/shell_port.h" | 28 #include "ash/shell_port.h" |
| 29 #include "ash/system/web_notification/web_notification_tray.h" | 29 #include "ash/system/web_notification/web_notification_tray.h" |
| 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" |
| 39 #include "ash/wallpaper/wallpaper_controller.h" |
| 38 #include "ash/wm_window.h" | 40 #include "ash/wm_window.h" |
| 39 #include "base/i18n/rtl.h" | 41 #include "base/i18n/rtl.h" |
| 40 #include "base/macros.h" | 42 #include "base/macros.h" |
| 41 #include "base/memory/ptr_util.h" | 43 #include "base/memory/ptr_util.h" |
| 42 #include "base/numerics/safe_conversions.h" | 44 #include "base/numerics/safe_conversions.h" |
| 43 #include "base/run_loop.h" | 45 #include "base/run_loop.h" |
| 44 #include "base/strings/string_number_conversions.h" | 46 #include "base/strings/string_number_conversions.h" |
| 45 #include "base/strings/utf_string_conversions.h" | 47 #include "base/strings/utf_string_conversions.h" |
| 46 #include "base/test/histogram_tester.h" | 48 #include "base/test/histogram_tester.h" |
| 47 #include "base/test/scoped_mock_time_message_loop_task_runner.h" | 49 #include "base/test/scoped_mock_time_message_loop_task_runner.h" |
| (...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); | 1575 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); |
| 1574 EXPECT_EQ(bubble_size.width(), | 1576 EXPECT_EQ(bubble_size.width(), |
| 1575 test_for_overflow_view.GetPreferredSize().width()); | 1577 test_for_overflow_view.GetPreferredSize().width()); |
| 1576 | 1578 |
| 1577 generator.ReleaseLeftButton(); | 1579 generator.ReleaseLeftButton(); |
| 1578 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); | 1580 test_for_overflow_view.RunMessageLoopUntilAnimationsDone(); |
| 1579 EXPECT_EQ(bubble_size.width(), | 1581 EXPECT_EQ(bubble_size.width(), |
| 1580 test_for_overflow_view.GetPreferredSize().width()); | 1582 test_for_overflow_view.GetPreferredSize().width()); |
| 1581 } | 1583 } |
| 1582 | 1584 |
| 1585 TEST_F(ShelfViewTest, OverflowShelfColorIsDerivedFromWallpaper) { |
| 1586 test::WallpaperControllerTestApi wallpaper_test_api( |
| 1587 Shell::Get()->wallpaper_controller()); |
| 1588 const SkColor opaque_expected_color = |
| 1589 wallpaper_test_api.ApplyColorProducingWallpaper(); |
| 1590 |
| 1591 AddButtonsUntilOverflow(); |
| 1592 test_api_->ShowOverflowBubble(); |
| 1593 OverflowBubbleView* bubble_view = test_api_->overflow_bubble()->bubble_view(); |
| 1594 |
| 1595 EXPECT_EQ(opaque_expected_color, SkColorSetA(bubble_view->color(), 255)); |
| 1596 } |
| 1597 |
| 1583 // Check the drag insertion bounds of scrolled overflow bubble. | 1598 // Check the drag insertion bounds of scrolled overflow bubble. |
| 1584 TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { | 1599 TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { |
| 1585 UpdateDisplay("400x300"); | 1600 UpdateDisplay("400x300"); |
| 1586 | 1601 |
| 1587 EXPECT_EQ(2, model_->item_count()); | 1602 EXPECT_EQ(2, model_->item_count()); |
| 1588 | 1603 |
| 1589 AddButtonsUntilOverflow(); | 1604 AddButtonsUntilOverflow(); |
| 1590 | 1605 |
| 1591 // Show overflow bubble. | 1606 // Show overflow bubble. |
| 1592 test_api_->ShowOverflowBubble(); | 1607 test_api_->ShowOverflowBubble(); |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3117 EXPECT_EQ(views::InkDropState::ACTIVATED, | 3132 EXPECT_EQ(views::InkDropState::ACTIVATED, |
| 3118 overflow_button_ink_drop_->GetTargetInkDropState()); | 3133 overflow_button_ink_drop_->GetTargetInkDropState()); |
| 3119 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), | 3134 EXPECT_THAT(overflow_button_ink_drop_->GetAndResetRequestedStates(), |
| 3120 IsEmpty()); | 3135 IsEmpty()); |
| 3121 | 3136 |
| 3122 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 3137 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 3123 } | 3138 } |
| 3124 | 3139 |
| 3125 } // namespace test | 3140 } // namespace test |
| 3126 } // namespace ash | 3141 } // namespace ash |
| OLD | NEW |