| 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/common/shelf/shelf_view.h" | 5 #include "ash/common/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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 ShelfItemDelegate::kExistingWindowActivated); | 1901 ShelfItemDelegate::kExistingWindowActivated); |
| 1902 SimulateClick(browser_index_); | 1902 SimulateClick(browser_index_); |
| 1903 | 1903 |
| 1904 histogram_tester.ExpectTotalCount( | 1904 histogram_tester.ExpectTotalCount( |
| 1905 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 1); | 1905 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName, 1); |
| 1906 } | 1906 } |
| 1907 | 1907 |
| 1908 class ShelfViewVisibleBoundsTest : public ShelfViewTest, | 1908 class ShelfViewVisibleBoundsTest : public ShelfViewTest, |
| 1909 public testing::WithParamInterface<bool> { | 1909 public testing::WithParamInterface<bool> { |
| 1910 public: | 1910 public: |
| 1911 ShelfViewVisibleBoundsTest() : text_direction_change_(GetParam()) { | 1911 ShelfViewVisibleBoundsTest() : text_direction_change_(GetParam()) {} |
| 1912 // TODO(jamescook): This test fails unless the system update icon is | |
| 1913 // showing, which used to be the default. However, it only fails on the | |
| 1914 // trybots, and only in the case where the overflow button is showing. | |
| 1915 // See http://crbug.com/619344 | |
| 1916 TestSystemTrayDelegate::SetSystemUpdateRequired(true); | |
| 1917 } | |
| 1918 | 1912 |
| 1919 void CheckAllItemsAreInBounds() { | 1913 void CheckAllItemsAreInBounds() { |
| 1920 gfx::Rect visible_bounds = shelf_view_->GetVisibleItemsBoundsInScreen(); | 1914 gfx::Rect visible_bounds = shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 1921 gfx::Rect shelf_bounds = shelf_view_->GetBoundsInScreen(); | 1915 gfx::Rect shelf_bounds = shelf_view_->GetBoundsInScreen(); |
| 1922 EXPECT_TRUE(shelf_bounds.Contains(visible_bounds)); | 1916 EXPECT_TRUE(shelf_bounds.Contains(visible_bounds)); |
| 1923 for (int i = 0; i < test_api_->GetButtonCount(); ++i) | 1917 for (int i = 0; i < test_api_->GetButtonCount(); ++i) |
| 1924 if (ShelfButton* button = test_api_->GetButton(i)) | 1918 if (ShelfButton* button = test_api_->GetButton(i)) { |
| 1925 EXPECT_TRUE(visible_bounds.Contains(button->GetBoundsInScreen())); | 1919 if (button->visible()) |
| 1920 EXPECT_TRUE(visible_bounds.Contains(button->GetBoundsInScreen())); |
| 1921 } |
| 1926 CheckAppListButtonIsInBounds(); | 1922 CheckAppListButtonIsInBounds(); |
| 1927 } | 1923 } |
| 1928 | 1924 |
| 1929 void CheckAppListButtonIsInBounds() { | 1925 void CheckAppListButtonIsInBounds() { |
| 1930 gfx::Rect visible_bounds = shelf_view_->GetVisibleItemsBoundsInScreen(); | 1926 gfx::Rect visible_bounds = shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 1931 gfx::Rect app_list_button_bounds = | 1927 gfx::Rect app_list_button_bounds = |
| 1932 shelf_view_->GetAppListButton()->GetBoundsInScreen(); | 1928 shelf_view_->GetAppListButton()->GetBoundsInScreen(); |
| 1933 EXPECT_TRUE(visible_bounds.Contains(app_list_button_bounds)); | 1929 EXPECT_TRUE(visible_bounds.Contains(app_list_button_bounds)); |
| 1934 } | 1930 } |
| 1935 | 1931 |
| (...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3171 IsEmpty()); | 3167 IsEmpty()); |
| 3172 | 3168 |
| 3173 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); | 3169 ASSERT_TRUE(test_api_->IsShowingOverflowBubble()); |
| 3174 } | 3170 } |
| 3175 } | 3171 } |
| 3176 | 3172 |
| 3177 #endif // !defined(OS_WIN) | 3173 #endif // !defined(OS_WIN) |
| 3178 | 3174 |
| 3179 } // namespace test | 3175 } // namespace test |
| 3180 } // namespace ash | 3176 } // namespace ash |
| OLD | NEW |