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

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

Issue 2554743003: arc: Fix double provisioning failure reporting. (Closed)
Patch Set: add unit test and comments addressed Created 4 years 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 7403af09cf93d450cc35f63daf901471a04261de..3cb61bea038623cc3051862ce268716a344268e3 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -377,4 +377,24 @@ TEST_F(ArcSessionManagerTest, DisabledForNonPrimaryProfile) {
arc_session_manager()->Shutdown();
}
+TEST_F(ArcSessionManagerTest, IgnoreSecondErrorReporting) {
+ profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, true);
+ arc_session_manager()->OnPrimaryUserProfilePrepared(profile());
+ arc_session_manager()->StartArc();
+ EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
+
+ // Report some failure that does not stop the bridge.
+ arc_session_manager()->OnProvisioningFinished(
+ ProvisioningResult::GMS_SIGN_IN_FAILED);
+ EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
+
+ // Try to send another error that stops the bridge if sent first. It should
+ // be ignored.
+ arc_session_manager()->OnProvisioningFinished(
+ ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
+ EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
+
+ arc_session_manager()->Shutdown();
+}
+
} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698