| 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 12 matching lines...) Expand all Loading... |
| 23 #include "ash/shelf/shelf_icon_observer.h" | 23 #include "ash/shelf/shelf_icon_observer.h" |
| 24 #include "ash/shelf/shelf_tooltip_manager.h" | 24 #include "ash/shelf/shelf_tooltip_manager.h" |
| 25 #include "ash/shelf/shelf_widget.h" | 25 #include "ash/shelf/shelf_widget.h" |
| 26 #include "ash/shell.h" | 26 #include "ash/shell.h" |
| 27 #include "ash/test/ash_test_base.h" | 27 #include "ash/test/ash_test_base.h" |
| 28 #include "ash/test/ash_test_helper.h" | 28 #include "ash/test/ash_test_helper.h" |
| 29 #include "ash/test/material_design_controller_test_api.h" | 29 #include "ash/test/material_design_controller_test_api.h" |
| 30 #include "ash/test/overflow_bubble_view_test_api.h" | 30 #include "ash/test/overflow_bubble_view_test_api.h" |
| 31 #include "ash/test/shelf_test_api.h" | 31 #include "ash/test/shelf_test_api.h" |
| 32 #include "ash/test/shelf_view_test_api.h" | 32 #include "ash/test/shelf_view_test_api.h" |
| 33 #include "ash/test/shell_test_api.h" | |
| 34 #include "ash/test/test_shelf_delegate.h" | 33 #include "ash/test/test_shelf_delegate.h" |
| 35 #include "ash/test/test_shelf_item_delegate.h" | 34 #include "ash/test/test_shelf_item_delegate.h" |
| 36 #include "ash/test/test_shell_delegate.h" | 35 #include "ash/test/test_shell_delegate.h" |
| 37 #include "ash/test/test_system_tray_delegate.h" | 36 #include "ash/test/test_system_tray_delegate.h" |
| 38 #include "base/compiler_specific.h" | 37 #include "base/compiler_specific.h" |
| 39 #include "base/i18n/rtl.h" | 38 #include "base/i18n/rtl.h" |
| 40 #include "base/memory/ptr_util.h" | 39 #include "base/memory/ptr_util.h" |
| 41 #include "base/run_loop.h" | 40 #include "base/run_loop.h" |
| 42 #include "base/strings/string_number_conversions.h" | 41 #include "base/strings/string_number_conversions.h" |
| 43 #include "base/strings/utf_string_conversions.h" | 42 #include "base/strings/utf_string_conversions.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 class ShelfViewTest : public AshTestBase { | 306 class ShelfViewTest : public AshTestBase { |
| 308 public: | 307 public: |
| 309 static const char* | 308 static const char* |
| 310 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName; | 309 kTimeBetweenWindowMinimizedAndActivatedActionsHistogramName; |
| 311 | 310 |
| 312 ShelfViewTest() : model_(nullptr), shelf_view_(nullptr), browser_index_(1) {} | 311 ShelfViewTest() : model_(nullptr), shelf_view_(nullptr), browser_index_(1) {} |
| 313 ~ShelfViewTest() override {} | 312 ~ShelfViewTest() override {} |
| 314 | 313 |
| 315 void SetUp() override { | 314 void SetUp() override { |
| 316 AshTestBase::SetUp(); | 315 AshTestBase::SetUp(); |
| 317 ShellTestApi test_api(Shell::GetInstance()); | 316 model_ = WmShell::Get()->shelf_model(); |
| 318 model_ = test_api.shelf_model(); | |
| 319 Shelf* shelf = Shelf::ForPrimaryDisplay(); | 317 Shelf* shelf = Shelf::ForPrimaryDisplay(); |
| 320 shelf_view_ = ShelfTestAPI(shelf).shelf_view(); | 318 shelf_view_ = ShelfTestAPI(shelf).shelf_view(); |
| 321 | 319 |
| 322 // The bounds should be big enough for 4 buttons + overflow chevron. | 320 // The bounds should be big enough for 4 buttons + overflow chevron. |
| 323 shelf_view_->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE)); | 321 shelf_view_->SetBounds(0, 0, 500, GetShelfConstant(SHELF_SIZE)); |
| 324 | 322 |
| 325 test_api_.reset(new ShelfViewTestAPI(shelf_view_)); | 323 test_api_.reset(new ShelfViewTestAPI(shelf_view_)); |
| 326 test_api_->SetAnimationDuration(1); // Speeds up animation for test. | 324 test_api_->SetAnimationDuration(1); // Speeds up animation for test. |
| 327 | 325 |
| 328 ReplaceShelfDelegate(); | 326 ReplaceShelfDelegate(); |
| (...skipping 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2577 test_api_->CloseMenu(); | 2575 test_api_->CloseMenu(); |
| 2578 EXPECT_EQ(views::InkDropState::HIDDEN, | 2576 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 2579 browser_button_ink_drop_->GetTargetInkDropState()); | 2577 browser_button_ink_drop_->GetTargetInkDropState()); |
| 2580 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), | 2578 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), |
| 2581 ElementsAre(views::InkDropState::ACTIVATED, | 2579 ElementsAre(views::InkDropState::ACTIVATED, |
| 2582 views::InkDropState::DEACTIVATED)); | 2580 views::InkDropState::DEACTIVATED)); |
| 2583 } | 2581 } |
| 2584 | 2582 |
| 2585 } // namespace test | 2583 } // namespace test |
| 2586 } // namespace ash | 2584 } // namespace ash |
| OLD | NEW |