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

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

Issue 2554743003: arc: Fix double provisioning failure reporting. (Closed)
Patch Set: rebase / todo added 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
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fe2298b050bfe1a598b875deb65bc3954107c793..98b7e135f7c278cf2b97582f2ad00a88ae360e3f 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -452,6 +452,27 @@ TEST_F(ArcSessionManagerTest, RemoveDataFolder) {
arc_session_manager()->StartArc();
EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
+
+ 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();
}
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698