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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_list_prefs.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.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
index 78512a0c0193e24f2dd0c8aa44b01fcd69cc693d..39b31a5e607ee6762de99310c58927c01e314ba6 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -268,16 +268,23 @@ void ArcAppListPrefs::StartPrefs() {
arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
CHECK(arc_session_manager);
- if (arc_session_manager->profile()) {
- // Note: If ArcSessionManager has profile, it should be as same as the one
- // this instance has, because ArcAppListPrefsFactory creates an instance
- // only if the given Profile meets ARC's requirement.
- // Anyway, just in case, check it here.
- DCHECK_EQ(profile_, arc_session_manager->profile());
+ // In sync test, ArcAppListPrefs with non primary profile will be created
+ // after ArcSessionManager is initialized. Don't call
+ // OnArcPlayStoreEnabledChanged() which may protentially confuse
+ // ArcSessionManager state machine.
+ if (arc_session_manager->profile() &&
hidehiko 2017/03/02 17:45:39 Hmm... I still do not want to remove the DCHECK ot
lgcheng 2017/03/02 23:45:10 Agree with you concern. Reconstruct a little. Use
+ arc_session_manager->profile() == profile_) {
OnArcPlayStoreEnabledChanged(
arc::IsArcPlayStoreEnabledForProfile(profile_));
}
- arc_session_manager->AddObserver(this);
+
+ // In sync test, ArcAppListPrefs with non primary profile will be created
+ // after ArcSessionManager is initialized. Don't tied ArcAppListPrefs created
+ // with non primary profile to ArcSessionManager to avoid confusing
+ // ArcSessionManager state machine.
+ if (!arc_session_manager->profile() ||
+ arc_session_manager->profile() == profile_)
+ arc_session_manager->AddObserver(this);
app_instance_holder_->AddObserver(this);
if (!app_instance_holder_->has_instance())

Powered by Google App Engine
This is Rietveld 408576698