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

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

Issue 2556273002: [Merge-M56] arc: Fix double provisioning failure reporting. (Closed)
Patch Set: resolve conflicts 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_auth_service.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_auth_service_unittest.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
index 8bd07428ed4620664bfc9d4e595299818ce7bde3..21ab28924dca57c6b74b7e251ca333da01662324 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "chrome/browser/chromeos/arc/arc_auth_service.h"
+#include "chrome/browser/chromeos/arc/arc_optin_uma.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
@@ -437,4 +438,24 @@ TEST_F(ArcAuthServiceTest, RemoveDataFolder) {
auth_service()->Shutdown();
}
+TEST_F(ArcAuthServiceTest, IgnoreSecondErrorReporting) {
+ profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, true);
+ auth_service()->OnPrimaryUserProfilePrepared(profile());
+ auth_service()->StartArc();
+ EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
+
+ // Report some failure that does not stop the bridge.
+ auth_service()->OnProvisioningFinished(
+ ProvisioningResult::GMS_SIGN_IN_FAILED);
+ EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
+
+ // Try to send another error that stops the bridge if sent first. It should
+ // be ignored.
+ auth_service()->OnProvisioningFinished(
+ ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
+ EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
+
+ auth_service()->Shutdown();
+}
+
} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698