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

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

Issue 2174753004: arc:Integration test for Arc package Chrome sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@current
Patch Set: Modify target 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
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 6ac101e160efa0f98dbb1631ae1810da9d33109a..fecaf94a69081c5224dfa18fb9ed1528f823f1b5 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
@@ -11,6 +11,8 @@
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_context.h"
+bool ArcAppListPrefsFactory::is_sync_test_ = false;
+
// static
ArcAppListPrefs* ArcAppListPrefsFactory::GetForBrowserContext(
content::BrowserContext* context) {
@@ -23,6 +25,11 @@ ArcAppListPrefsFactory* ArcAppListPrefsFactory::GetInstance() {
return base::Singleton<ArcAppListPrefsFactory>::get();
}
+// static
+void ArcAppListPrefsFactory::SetFactoryForSyncTest() {
+ is_sync_test_ = true;
+}
+
ArcAppListPrefsFactory::ArcAppListPrefsFactory()
: BrowserContextKeyedServiceFactory(
"ArcAppListPrefs",
@@ -38,6 +45,13 @@ KeyedService* ArcAppListPrefsFactory::BuildServiceInstanceFor(
if (!arc::ArcAuthService::IsAllowedForProfile(profile))
return nullptr;
+ if (is_sync_test_) {
+ sync_test_app_instance_holders_[context].reset(
+ new arc::InstanceHolder<arc::mojom::AppInstance>());
+ return ArcAppListPrefs::Create(
+ profile, sync_test_app_instance_holders_[context].get());
+ }
+
arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get();
if (!bridge_service)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698