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

Unified Diff: ash/test/ash_test_helper.cc

Issue 2186363002: Set Ash material design mode in tests properly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 4 years, 5 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 | « ash/test/ash_test_helper.h ('k') | ash/test/ash_test_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « ash/test/ash_test_helper.h ('k') | ash/test/ash_test_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698