| 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 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2118 | 2118 |
| 2119 class ShelfViewInkDropTest : public ShelfViewTest { | 2119 class ShelfViewInkDropTest : public ShelfViewTest { |
| 2120 public: | 2120 public: |
| 2121 ShelfViewInkDropTest() {} | 2121 ShelfViewInkDropTest() {} |
| 2122 ~ShelfViewInkDropTest() override {} | 2122 ~ShelfViewInkDropTest() override {} |
| 2123 | 2123 |
| 2124 void SetUp() override { | 2124 void SetUp() override { |
| 2125 shell_delegate_ = new TestAppListShellDelegate; | 2125 shell_delegate_ = new TestAppListShellDelegate; |
| 2126 ash_test_helper()->set_test_shell_delegate(shell_delegate_); | 2126 ash_test_helper()->set_test_shell_delegate(shell_delegate_); |
| 2127 | 2127 |
| 2128 set_material_mode(ash::MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 2129 |
| 2128 ShelfViewTest::SetUp(); | 2130 ShelfViewTest::SetUp(); |
| 2129 | |
| 2130 // TODO(mohsen): Ideally, we would want to set material mode before calling | |
| 2131 // ShelfViewTest::SetUp() so that everything is set up with the correct | |
| 2132 // material mode. Currently, this is not possible as it expects material | |
| 2133 // mode be UNINITIALIZED. (See https://crbug.com/620093) | |
| 2134 ash_md_controller_.reset(new ash::test::MaterialDesignControllerTestAPI( | |
| 2135 ash::MaterialDesignController::MATERIAL_EXPERIMENTAL)); | |
| 2136 } | |
| 2137 | |
| 2138 void TearDown() override { | |
| 2139 ash_md_controller_.reset(); | |
| 2140 | |
| 2141 ShelfViewTest::TearDown(); | |
| 2142 } | 2131 } |
| 2143 | 2132 |
| 2144 protected: | 2133 protected: |
| 2145 void InitAppListButtonInkDrop() { | 2134 void InitAppListButtonInkDrop() { |
| 2146 app_list_button_ = shelf_view_->GetAppListButton(); | 2135 app_list_button_ = shelf_view_->GetAppListButton(); |
| 2147 | 2136 |
| 2148 views::InkDropImpl* ink_drop_impl = | 2137 views::InkDropImpl* ink_drop_impl = |
| 2149 new views::InkDropImpl(app_list_button_); | 2138 new views::InkDropImpl(app_list_button_); |
| 2150 app_list_button_ink_drop_ = new InkDropSpy(base::WrapUnique(ink_drop_impl)); | 2139 app_list_button_ink_drop_ = new InkDropSpy(base::WrapUnique(ink_drop_impl)); |
| 2151 views::test::InkDropHostViewTestApi(app_list_button_) | 2140 views::test::InkDropHostViewTestApi(app_list_button_) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2172 shell_delegate_->app_list_presenter()->Dismiss(); | 2161 shell_delegate_->app_list_presenter()->Dismiss(); |
| 2173 // Similar to real AppListPresenter, notify button that the app list is | 2162 // Similar to real AppListPresenter, notify button that the app list is |
| 2174 // dismissed. | 2163 // dismissed. |
| 2175 app_list_button_->OnAppListDismissed(); | 2164 app_list_button_->OnAppListDismissed(); |
| 2176 } | 2165 } |
| 2177 | 2166 |
| 2178 void FinishAppListVisibilityChange() { | 2167 void FinishAppListVisibilityChange() { |
| 2179 shell_delegate_->app_list_presenter()->FinishVisibilityChange(); | 2168 shell_delegate_->app_list_presenter()->FinishVisibilityChange(); |
| 2180 } | 2169 } |
| 2181 | 2170 |
| 2182 std::unique_ptr<ash::test::MaterialDesignControllerTestAPI> | |
| 2183 ash_md_controller_; | |
| 2184 | |
| 2185 TestAppListShellDelegate* shell_delegate_ = nullptr; // Owned by Shell. | 2171 TestAppListShellDelegate* shell_delegate_ = nullptr; // Owned by Shell. |
| 2186 | 2172 |
| 2187 AppListButton* app_list_button_ = nullptr; | 2173 AppListButton* app_list_button_ = nullptr; |
| 2188 InkDropSpy* app_list_button_ink_drop_ = nullptr; | 2174 InkDropSpy* app_list_button_ink_drop_ = nullptr; |
| 2189 ShelfButton* browser_button_ = nullptr; | 2175 ShelfButton* browser_button_ = nullptr; |
| 2190 InkDropSpy* browser_button_ink_drop_ = nullptr; | 2176 InkDropSpy* browser_button_ink_drop_ = nullptr; |
| 2191 | 2177 |
| 2192 private: | 2178 private: |
| 2193 DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest); | 2179 DISALLOW_COPY_AND_ASSIGN(ShelfViewInkDropTest); |
| 2194 }; | 2180 }; |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2575 test_api_->CloseMenu(); | 2561 test_api_->CloseMenu(); |
| 2576 EXPECT_EQ(views::InkDropState::HIDDEN, | 2562 EXPECT_EQ(views::InkDropState::HIDDEN, |
| 2577 browser_button_ink_drop_->GetTargetInkDropState()); | 2563 browser_button_ink_drop_->GetTargetInkDropState()); |
| 2578 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), | 2564 EXPECT_THAT(browser_button_ink_drop_->GetAndResetRequestedStates(), |
| 2579 ElementsAre(views::InkDropState::ACTIVATED, | 2565 ElementsAre(views::InkDropState::ACTIVATED, |
| 2580 views::InkDropState::DEACTIVATED)); | 2566 views::InkDropState::DEACTIVATED)); |
| 2581 } | 2567 } |
| 2582 | 2568 |
| 2583 } // namespace test | 2569 } // namespace test |
| 2584 } // namespace ash | 2570 } // namespace ash |
| OLD | NEW |