Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: ash/shelf/shelf_view_unittest.cc

Issue 2186363002: Set Ash material design mode in tests properly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compile errors after rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/test/ash_md_test_base.h » ('j') | ash/test/ash_test_base.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 } 2109 }
2110 2110
2111 private: 2111 private:
2112 std::unique_ptr<TestAppListPresenter> app_list_presenter_; 2112 std::unique_ptr<TestAppListPresenter> app_list_presenter_;
2113 2113
2114 DISALLOW_COPY_AND_ASSIGN(TestAppListShellDelegate); 2114 DISALLOW_COPY_AND_ASSIGN(TestAppListShellDelegate);
2115 }; 2115 };
2116 2116
2117 } // namespace 2117 } // namespace
2118 2118
2119 class ShelfViewInkDropTest : public ShelfViewTest { 2119 class ShelfViewInkDropTest : public ShelfViewTest {
tdanderson 2016/07/29 15:16:50 Can you add a comment here saying that this fixtur
bruthig 2016/07/29 16:13:03 Are there any tests here that are NON_MATERIAL spe
mohsen 2016/07/29 18:05:19 Done.
mohsen 2016/07/29 18:05:19 No, these are all ripple tests and only make sense
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);
tdanderson 2016/07/29 15:16:50 Just a thought (not necessarily something to addre
bruthig 2016/07/29 16:13:04 +1 to something like this. Could "ModeForShelf()"
mohsen 2016/07/29 18:05:19 As discussed in person, this is not simple since E
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/test/ash_md_test_base.h » ('j') | ash/test/ash_test_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698