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

Unified Diff: chrome/browser/extensions/extension_action_icon_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 | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_action_icon_factory_unittest.cc
diff --git a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc
index d307a54f3f4df425b3ee2b4c0ef758287413afa7..351b25b9d0e44a019881460edfc514142165b26a 100644
--- a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc
+++ b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc
@@ -144,15 +144,12 @@ class ExtensionActionIconFactoryTest
extension_service_ = static_cast<extensions::TestExtensionSystem*>(
extensions::ExtensionSystem::Get(profile_.get()))->
CreateExtensionService(&command_line, base::FilePath(), false);
- // 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()));
}
void TearDown() override {
- ui::test::MaterialDesignControllerTestAPI::UninitializeMode();
+ material_design_state_.reset();
profile_.reset(); // Get all DeleteSoon calls sent to ui_loop_.
ui_loop_.RunUntilIdle();
}
@@ -182,6 +179,8 @@ class ExtensionActionIconFactoryTest
content::TestBrowserThread io_thread_;
std::unique_ptr<TestingProfile> profile_;
ExtensionService* extension_service_;
+ std::unique_ptr<ui::test::MaterialDesignControllerTestAPI>
+ material_design_state_;
#if defined OS_CHROMEOS
chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/themes/theme_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698