Commit ec1e1cfb authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Reorder AshTestHelper setup/teardown.

This is in preparation for making AshTestHelper an AuraTestHelper
subclass.  The primary purpose here is to move the parts of setup/
teardown that will be handled by the AuraTestHelper to the start/end
of the ash setup/teardown phases, respectively, so that moving them
into AuraTestHelper will not change the relative order of anything.

The secondary purpose, subject to the above, is to better group
related functionality and add a few comments about ordering
requirements.  I didn't aim for perfection, just something better.

This is split into its own CL since reordering setup/teardown is risky;
there are many implicit dependencies.

There are some trivial changes:
* Removed a null-check of the cursor manager that was only needed for
  MASH.
* Explicitly reset all unique_ptrs during TearDown() rather than waiting
  until destruction for a few.
* Removed CHECK(!::wm::CaptureController::Get()) during teardown; it's
  not clear to me why we CHECK this but none of the other many bits of
  state destruction on teardown.

Otherwise, should be no functional change.

Bug: none
Change-Id: Ief088e58606b83e127e93daad0a60f90601b9866
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121085
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753811}
parent aa4de8d3
This diff is collapsed.
...@@ -135,32 +135,23 @@ class AshTestHelper { ...@@ -135,32 +135,23 @@ class AshTestHelper {
void reset_commandline() { command_line_.reset(); } void reset_commandline() { command_line_.reset(); }
private: private:
std::unique_ptr<::wm::WMState> wm_state_;
std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
std::unique_ptr<ui::TestContextFactories> context_factories_;
std::unique_ptr<base::test::ScopedCommandLine> command_line_;
std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider> std::unique_ptr<chromeos::system::ScopedFakeStatisticsProvider>
statistics_provider_; statistics_provider_;
std::unique_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
std::unique_ptr<::wm::WMState> wm_state_;
std::unique_ptr<AshTestViewsDelegate> test_views_delegate_;
// Flags for whether various services were initialized here.
bool bluez_dbus_manager_initialized_ = false;
bool power_policy_controller_initialized_ = false;
std::unique_ptr<TestSessionControllerClient> session_controller_client_;
std::unique_ptr<TestNotifierSettingsController> notifier_settings_controller_;
std::unique_ptr<TestSystemTrayClient> system_tray_client_;
std::unique_ptr<TestPrefServiceProvider> prefs_provider_; std::unique_ptr<TestPrefServiceProvider> prefs_provider_;
std::unique_ptr<TestNotifierSettingsController> notifier_settings_controller_;
std::unique_ptr<TestAssistantService> assistant_service_; std::unique_ptr<TestAssistantService> assistant_service_;
std::unique_ptr<ui::TestContextFactories> context_factories_; std::unique_ptr<TestSystemTrayClient> system_tray_client_;
std::unique_ptr<TestPhotoController> photo_controller_; std::unique_ptr<TestPhotoController> photo_controller_;
std::unique_ptr<base::test::ScopedCommandLine> command_line_;
std::unique_ptr<AppListTestHelper> app_list_test_helper_; std::unique_ptr<AppListTestHelper> app_list_test_helper_;
bool bluez_dbus_manager_initialized_ = false;
bool power_policy_controller_initialized_ = false;
std::unique_ptr<TestNewWindowDelegate> new_window_delegate_; std::unique_ptr<TestNewWindowDelegate> new_window_delegate_;
std::unique_ptr<AshTestViewsDelegate> test_views_delegate_;
std::unique_ptr<TestSessionControllerClient> session_controller_client_;
std::unique_ptr<TestKeyboardControllerObserver> std::unique_ptr<TestKeyboardControllerObserver>
test_keyboard_controller_observer_; test_keyboard_controller_observer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment