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

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager_unittest.cc

Issue 2739323004: arc: Reactivate OptIn flow on clicking Play Store. (Closed)
Patch Set: Created 3 years, 9 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/chromeos/arc/arc_session_manager_unittest.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
index 2a401ff5aee17160e23d436d19b6384a5a4761c4..d6a487e3b260d14bf1e214e4b135cfd96eb0998d 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -549,6 +549,31 @@ TEST_P(ArcSessionManagerPolicyTest, SkippingTerms) {
arc_session_manager()->Shutdown();
}
+TEST_P(ArcSessionManagerPolicyTest, ReenableManagedArc) {
+ sync_preferences::TestingPrefServiceSyncable* const prefs =
+ profile()->GetTestingPrefService();
+
+ // Set ARC to be managed.
+ prefs->SetManagedPref(prefs::kArcEnabled, new base::Value(true));
+ EXPECT_TRUE(arc::IsArcPlayStoreEnabledForProfile(profile()));
+
+ arc_session_manager()->SetProfile(profile());
+ arc_session_manager()->RequestEnable();
+ EXPECT_TRUE(arc_session_manager()->enable_requested());
+
+ // Simulate close OptIn. Session manager should stop.
+ SetArcPlayStoreEnabledForProfile(profile(), false);
+ EXPECT_TRUE(arc::IsArcPlayStoreEnabledForProfile(profile()));
+ EXPECT_FALSE(arc_session_manager()->enable_requested());
+
+ // Restart ARC again
+ SetArcPlayStoreEnabledForProfile(profile(), true);
+ EXPECT_TRUE(arc::IsArcPlayStoreEnabledForProfile(profile()));
+ EXPECT_TRUE(arc_session_manager()->enable_requested());
+
+ arc_session_manager()->Shutdown();
+}
+
INSTANTIATE_TEST_CASE_P(
ArcSessionManagerPolicyTest,
ArcSessionManagerPolicyTest,

Powered by Google App Engine
This is Rietveld 408576698