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

Unified Diff: ash/test/ash_test_helper.cc

Issue 693643004: Make UserActivityDetector a singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash45
Patch Set: Created 6 years, 2 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: ash/test/ash_test_helper.cc
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index 86a50d5399736d6253fc5f22321da35f9ced4e27..2b746db4cea3b4143721978a239ea74a48cd5701 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -25,6 +25,7 @@
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/message_center/message_center.h"
#include "ui/wm/core/capture_controller.h"
+#include "ui/wm/core/user_activity_detector.h"
#if defined(OS_CHROMEOS)
#include "chromeos/audio/cras_audio_handler.h"
@@ -87,6 +88,9 @@ void AshTestHelper::SetUp(bool start_session) {
// Create CrasAudioHandler for testing since g_browser_process is not
// created in AshTestBase tests.
chromeos::CrasAudioHandler::InitializeForTesting();
+
+ // The UserActivityDetector must be created before the shell is created.
+ wm::UserActivityDetector::Create();
#endif
ShellInitParams init_params;
init_params.delegate = test_shell_delegate_;
@@ -121,6 +125,8 @@ void AshTestHelper::TearDown() {
message_center::MessageCenter::Shutdown();
#if defined(OS_CHROMEOS)
+ wm::UserActivityDetector::Shutdown();
+
chromeos::CrasAudioHandler::Shutdown();
if (dbus_thread_manager_initialized_) {
chromeos::DBusThreadManager::Shutdown();

Powered by Google App Engine
This is Rietveld 408576698