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

Unified Diff: components/signin/core/browser/signin_error_controller_unittest.cc

Issue 288813003: Add username of account that has an auth error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 7 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: components/signin/core/browser/signin_error_controller_unittest.cc
diff --git a/components/signin/core/browser/signin_error_controller_unittest.cc b/components/signin/core/browser/signin_error_controller_unittest.cc
index d143eddde2eb4322ec1ccede7641030e1a0afaf9..8c5f51a73ca3495af909d576a9dc9c6619499f59 100644
--- a/components/signin/core/browser/signin_error_controller_unittest.cc
+++ b/components/signin/core/browser/signin_error_controller_unittest.cc
@@ -11,7 +11,9 @@
#include "testing/gtest/include/gtest/gtest.h"
static const char kTestAccountId[] = "testuser@test.com";
+static const char kTestUsername[] = "testuser@test.com";
static const char kOtherTestAccountId[] = "otheruser@test.com";
+static const char kOtherTestUsername[] = "otheruser@test.com";
class SigninErrorControllerTest : public testing::Test {
public:
@@ -45,8 +47,11 @@ TEST_F(SigninErrorControllerTest, ErrorAuthStatusProvider) {
ASSERT_FALSE(error_controller_->HasError());
error_provider.reset(new FakeAuthStatusProvider(error_controller_.get()));
- error_provider->SetAuthError(kTestAccountId, GoogleServiceAuthError(
- GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
+ error_provider->SetAuthError(
+ kTestAccountId,
+ kTestUsername,
+ GoogleServiceAuthError(
+ GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
ASSERT_TRUE(error_controller_->HasError());
error_provider.reset();
@@ -66,20 +71,24 @@ TEST_F(SigninErrorControllerTest, AuthStatusProviderErrorTransition) {
ASSERT_FALSE(error_controller_->HasError());
provider0->SetAuthError(
kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
ASSERT_TRUE(error_controller_->HasError());
provider1->SetAuthError(
kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError(GoogleServiceAuthError::ACCOUNT_DISABLED));
ASSERT_TRUE(error_controller_->HasError());
// Now resolve the auth errors - the menu item should go away.
provider0->SetAuthError(kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError::AuthErrorNone());
ASSERT_TRUE(error_controller_->HasError());
provider1->SetAuthError(kTestAccountId,
- GoogleServiceAuthError::AuthErrorNone());
+ kTestUsername,
+ GoogleServiceAuthError::AuthErrorNone());
ASSERT_FALSE(error_controller_->HasError());
provider0.reset();
@@ -97,10 +106,12 @@ TEST_F(SigninErrorControllerTest, AuthStatusProviderAccountTransition) {
provider0->SetAuthError(
kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
provider1->SetAuthError(
kOtherTestAccountId,
+ kOtherTestUsername,
GoogleServiceAuthError(GoogleServiceAuthError::NONE));
ASSERT_TRUE(error_controller_->HasError());
ASSERT_STREQ(kTestAccountId,
@@ -158,6 +169,7 @@ TEST_F(SigninErrorControllerTest, AuthStatusEnumerateAllErrors) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(table); ++i) {
FakeAuthStatusProvider provider(error_controller_.get());
provider.SetAuthError(kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError(table[i].error_state));
EXPECT_EQ(error_controller_->HasError(), table[i].is_error);
@@ -207,10 +219,12 @@ TEST_F(SigninErrorControllerTest, AuthStatusChange) {
provider0->SetAuthError(
kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::NONE));
provider1->SetAuthError(
kOtherTestAccountId,
+ kOtherTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS));
ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
@@ -221,6 +235,7 @@ TEST_F(SigninErrorControllerTest, AuthStatusChange) {
// Change the 1st provider's error.
provider1->SetAuthError(
kOtherTestAccountId,
+ kOtherTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::SERVICE_UNAVAILABLE));
ASSERT_EQ(GoogleServiceAuthError::SERVICE_UNAVAILABLE,
@@ -231,6 +246,7 @@ TEST_F(SigninErrorControllerTest, AuthStatusChange) {
// Set the 0th provider's error -- nothing should change.
provider0->SetAuthError(
kTestAccountId,
+ kTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE));
ASSERT_EQ(GoogleServiceAuthError::SERVICE_UNAVAILABLE,
@@ -241,6 +257,7 @@ TEST_F(SigninErrorControllerTest, AuthStatusChange) {
// Clear the 1st provider's error, so the 0th provider's error is used.
provider1->SetAuthError(
kOtherTestAccountId,
+ kOtherTestUsername,
GoogleServiceAuthError(
GoogleServiceAuthError::NONE));
ASSERT_EQ(GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE,

Powered by Google App Engine
This is Rietveld 408576698