Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/signin/signin_error_notifier_ash.h" | 5 #include "chrome/browser/signin/signin_error_notifier_ash.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 { GoogleServiceAuthError::NONE, false }, | 221 { GoogleServiceAuthError::NONE, false }, |
| 222 { GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, true }, | 222 { GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, true }, |
| 223 { GoogleServiceAuthError::USER_NOT_SIGNED_UP, true }, | 223 { GoogleServiceAuthError::USER_NOT_SIGNED_UP, true }, |
| 224 { GoogleServiceAuthError::CONNECTION_FAILED, false }, | 224 { GoogleServiceAuthError::CONNECTION_FAILED, false }, |
| 225 { GoogleServiceAuthError::CAPTCHA_REQUIRED, true }, | 225 { GoogleServiceAuthError::CAPTCHA_REQUIRED, true }, |
| 226 { GoogleServiceAuthError::ACCOUNT_DELETED, true }, | 226 { GoogleServiceAuthError::ACCOUNT_DELETED, true }, |
| 227 { GoogleServiceAuthError::ACCOUNT_DISABLED, true }, | 227 { GoogleServiceAuthError::ACCOUNT_DISABLED, true }, |
| 228 { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true }, | 228 { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true }, |
| 229 { GoogleServiceAuthError::TWO_FACTOR, true }, | 229 { GoogleServiceAuthError::TWO_FACTOR, true }, |
| 230 { GoogleServiceAuthError::REQUEST_CANCELED, true }, | 230 { GoogleServiceAuthError::REQUEST_CANCELED, true }, |
| 231 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true }, | 231 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED_DEPRECATED, true }, |
|
Roger Tawa OOO till Jul 10th
2016/09/08 13:49:24
Should remove this from tests. Same for other sig
Greg Levin
2016/09/08 19:56:35
Done for two of them, but see note in signin_globa
| |
| 232 { GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, true }, | 232 { GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, true }, |
| 233 { GoogleServiceAuthError::SERVICE_ERROR, true }, | 233 { GoogleServiceAuthError::SERVICE_ERROR, true }, |
| 234 { GoogleServiceAuthError::WEB_LOGIN_REQUIRED, true }, | 234 { GoogleServiceAuthError::WEB_LOGIN_REQUIRED, true }, |
| 235 }; | 235 }; |
| 236 static_assert(arraysize(table) == GoogleServiceAuthError::NUM_STATES, | 236 static_assert(arraysize(table) == GoogleServiceAuthError::NUM_STATES, |
| 237 "table size should match number of auth error types"); | 237 "table size should match number of auth error types"); |
| 238 | 238 |
| 239 for (size_t i = 0; i < arraysize(table); ++i) { | 239 for (size_t i = 0; i < arraysize(table); ++i) { |
| 240 FakeAuthStatusProvider provider(error_controller_); | 240 FakeAuthStatusProvider provider(error_controller_); |
| 241 provider.SetAuthError(kTestAccountId, | 241 provider.SetAuthError(kTestAccountId, |
| 242 GoogleServiceAuthError(table[i].error_state)); | 242 GoogleServiceAuthError(table[i].error_state)); |
| 243 const Notification* notification = notification_ui_manager_->FindById( | 243 const Notification* notification = notification_ui_manager_->FindById( |
| 244 kNotificationId, NotificationUIManager::GetProfileID(profile_.get())); | 244 kNotificationId, NotificationUIManager::GetProfileID(profile_.get())); |
| 245 ASSERT_EQ(table[i].is_error, notification != NULL); | 245 ASSERT_EQ(table[i].is_error, notification != NULL); |
| 246 if (table[i].is_error) { | 246 if (table[i].is_error) { |
| 247 EXPECT_FALSE(notification->title().empty()); | 247 EXPECT_FALSE(notification->title().empty()); |
| 248 EXPECT_FALSE(notification->message().empty()); | 248 EXPECT_FALSE(notification->message().empty()); |
| 249 EXPECT_EQ((size_t)1, notification->buttons().size()); | 249 EXPECT_EQ((size_t)1, notification->buttons().size()); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 #endif | 253 #endif |
| 254 | 254 |
| 255 } // namespace test | 255 } // namespace test |
| 256 } // namespace ash | 256 } // namespace ash |
| OLD | NEW |