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

Unified Diff: ui/views/animation/ink_drop_animation_controller_factory_unittest.cc

Issue 1878973002: [reland] Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made it possible to restore MaterialDesignController state after each test case (nits) Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/shell_dialogs/run_all_unittests.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_animation_controller_factory_unittest.cc
diff --git a/ui/views/animation/ink_drop_animation_controller_factory_unittest.cc b/ui/views/animation/ink_drop_animation_controller_factory_unittest.cc
index 3f4d09cb02e66f83549abd8d92772d19a63a3b55..64df5fee3b10eb98db2d2dbd0c0627229f20e7d9 100644
--- a/ui/views/animation/ink_drop_animation_controller_factory_unittest.cc
+++ b/ui/views/animation/ink_drop_animation_controller_factory_unittest.cc
@@ -46,6 +46,9 @@ class InkDropAnimationControllerFactoryTest
// Required by base::Timer's.
std::unique_ptr<base::ThreadTaskRunnerHandle> thread_task_runner_handle_;
+ std::unique_ptr<ui::test::MaterialDesignControllerTestAPI>
+ material_design_state_;
+
DISALLOW_COPY_AND_ASSIGN(InkDropAnimationControllerFactoryTest);
};
@@ -54,8 +57,8 @@ InkDropAnimationControllerFactoryTest::InkDropAnimationControllerFactoryTest()
// Any call by a previous test to MaterialDesignController::GetMode() will
// initialize and cache the mode. This ensures that these tests will run from
// a non-initialized state.
- ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
- ui::test::MaterialDesignControllerTestAPI::SetMode(GetMaterialMode());
+ material_design_state_.reset(
+ new ui::test::MaterialDesignControllerTestAPI(GetMaterialMode()));
ink_drop_animation_controller_.reset(
InkDropAnimationControllerFactory::CreateInkDropAnimationController(
&test_ink_drop_host_)
@@ -81,7 +84,7 @@ InkDropAnimationControllerFactoryTest::InkDropAnimationControllerFactoryTest()
InkDropAnimationControllerFactoryTest::
~InkDropAnimationControllerFactoryTest() {
- ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
+ material_design_state_.reset();
}
ui::MaterialDesignController::Mode
« no previous file with comments | « ui/shell_dialogs/run_all_unittests.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698