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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar_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
Index: chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
index 2ede2359c3ed1784e7127d10144e1686275f9969..a127432e0dbf96d9c52b44fa883c2a173045ca14 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc
@@ -112,11 +112,8 @@ void ToolbarActionsBarUnitTest::SetUp() {
extensions::extension_action_test_util::CreateToolbarModelForProfile(
profile());
- // 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(GetParam());
+ material_design_state_.reset(
+ new ui::test::MaterialDesignControllerTestAPI(GetParam()));
ToolbarActionsBar::disable_animations_for_testing_ = true;
browser_action_test_util_.reset(new BrowserActionTestUtil(browser(), false));
@@ -133,7 +130,7 @@ void ToolbarActionsBarUnitTest::TearDown() {
overflow_browser_action_test_util_.reset();
ToolbarActionsBar::disable_animations_for_testing_ = false;
redesign_switch_.reset();
- ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
+ material_design_state_.reset();
BrowserWithTestWindowTest::TearDown();
}

Powered by Google App Engine
This is Rietveld 408576698