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

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

Issue 2711033002: Fix Arc integration test. (Closed)
Patch Set: Address hidehiko's comments. Created 3 years, 10 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: chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
index e99b5a03e2a0d5374db31469c3d412e4394f5e51..be833428134e85faf40244f7147f1af3315c8c8f 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h"
+#include "base/memory/ptr_util.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
@@ -50,16 +51,18 @@ ArcAppListPrefsFactory::~ArcAppListPrefsFactory() {
KeyedService* ArcAppListPrefsFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
Profile* profile = static_cast<Profile*>(context);
- if (!arc::IsArcAllowedForProfile(profile))
- return nullptr;
+ // Profiles are always treated as allowed to ARC in sync integration test.
if (is_sync_test_) {
- sync_test_app_instance_holders_[context].reset(
- new arc::InstanceHolder<arc::mojom::AppInstance>());
+ sync_test_app_instance_holders_[context] =
+ base::MakeUnique<arc::InstanceHolder<arc::mojom::AppInstance>>();
return ArcAppListPrefs::Create(
profile, sync_test_app_instance_holders_[context].get());
}
+ if (!arc::IsArcAllowedForProfile(profile))
+ return nullptr;
+
auto* arc_service_manager = arc::ArcServiceManager::Get();
if (!arc_service_manager)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698