| 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,
|
|
|