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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_test.cc

Issue 2248353002: [M53 cherry-pick] Migrate ArcUserDataService into ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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/ui/app_list/arc/arc_app_test.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/arc/arc_app_test.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_test.cc b/chrome/browser/ui/app_list/arc/arc_app_test.cc
index 4c97ec05ff2999bf7e5039e9eb4e3b91d6ef2ccc..e75719223f6ac424e293a2acc0b33356233f3e4d 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_test.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_test.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h"
#include "chromeos/chromeos_switches.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
#include "components/arc/arc_bridge_service.h"
#include "components/arc/test/fake_app_instance.h"
#include "components/arc/test/fake_arc_bridge_service.h"
@@ -47,6 +48,10 @@ chromeos::FakeChromeUserManager* ArcAppTest::GetUserManager() {
}
void ArcAppTest::SetUp(Profile* profile) {
+ if (!chromeos::DBusThreadManager::IsInitialized()) {
+ chromeos::DBusThreadManager::Initialize();
+ dbus_thread_manager_initialized_ = true;
+ }
base::CommandLine::ForCurrentProcess()->AppendSwitch(
chromeos::switches::kEnableArc);
DCHECK(!profile_);
@@ -123,6 +128,13 @@ void ArcAppTest::SetUp(Profile* profile) {
void ArcAppTest::TearDown() {
auth_service_.reset();
+ if (dbus_thread_manager_initialized_) {
+ // DBusThreadManager may be initialized from other testing utility,
+ // such as ash::test::AshTestHelper::SetUp(), so Shutdown() only when
+ // it is initialized in ArcAppTest::SetUp().
+ chromeos::DBusThreadManager::Shutdown();
+ dbus_thread_manager_initialized_ = false;
+ }
}
void ArcAppTest::StopArcInstance() {
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_test.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698