Index: ash/test/ash_test_helper.cc |
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc |
index 50d4475e49f4cd2f4b91a95af29d3351a9167033..bd25987c3f659179e3e81b146fbd7813bcd957a5 100644 |
--- a/ash/test/ash_test_helper.cc |
+++ b/ash/test/ash_test_helper.cc |
@@ -7,7 +7,6 @@ |
#include "ash/accelerators/accelerator_controller_delegate_aura.h" |
#include "ash/common/ash_switches.h" |
#include "ash/common/display/display_info.h" |
-#include "ash/common/material_design/material_design_controller.h" |
#include "ash/common/wm_shell.h" |
#include "ash/shell.h" |
#include "ash/shell_init_params.h" |
@@ -71,7 +70,8 @@ AshTestHelper::AshTestHelper(base::MessageLoopForUI* message_loop) |
AshTestHelper::~AshTestHelper() {} |
-void AshTestHelper::SetUp(bool start_session) { |
+void AshTestHelper::SetUp(bool start_session, |
+ MaterialDesignController::Mode material_mode) { |
ResetDisplayIdForTest(); |
views_delegate_.reset(new AshTestViewsDelegate); |
@@ -127,6 +127,11 @@ void AshTestHelper::SetUp(bool start_session) { |
ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
ui::MaterialDesignController::Initialize(); |
ash::MaterialDesignController::Initialize(); |
+ if (material_mode == MaterialDesignController::Mode::UNINITIALIZED) |
+ material_mode = MaterialDesignController::GetMode(); |
+ material_design_state_.reset( |
+ new test::MaterialDesignControllerTestAPI(material_mode)); |
+ |
ShellInitParams init_params; |
init_params.delegate = test_shell_delegate_; |
init_params.context_factory = context_factory; |
@@ -152,6 +157,7 @@ void AshTestHelper::SetUp(bool start_session) { |
void AshTestHelper::TearDown() { |
// Tear down the shell. |
Shell::DeleteInstance(); |
+ material_design_state_.reset(); |
test::MaterialDesignControllerTestAPI::Uninitialize(); |
ShellContentState::DestroyInstance(); |