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

Side by Side Diff: chrome/browser/signin/signin_error_notifier_ash_unittest.cc

Issue 2314913003: Deprecate HOSTED_NOT_ALLOWED auth error (Closed)
Patch Set: Replace NUM_DEPRECATED_STATES with IsDeprecated() Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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
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, false },
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 if (GoogleServiceAuthError::IsDeprecated(table[i].error_state))
241 continue;
240 FakeAuthStatusProvider provider(error_controller_); 242 FakeAuthStatusProvider provider(error_controller_);
241 provider.SetAuthError(kTestAccountId, 243 provider.SetAuthError(kTestAccountId,
242 GoogleServiceAuthError(table[i].error_state)); 244 GoogleServiceAuthError(table[i].error_state));
243 const Notification* notification = notification_ui_manager_->FindById( 245 const Notification* notification = notification_ui_manager_->FindById(
244 kNotificationId, NotificationUIManager::GetProfileID(profile_.get())); 246 kNotificationId, NotificationUIManager::GetProfileID(profile_.get()));
245 ASSERT_EQ(table[i].is_error, notification != NULL); 247 ASSERT_EQ(table[i].is_error, notification != NULL);
246 if (table[i].is_error) { 248 if (table[i].is_error) {
247 EXPECT_FALSE(notification->title().empty()); 249 EXPECT_FALSE(notification->title().empty());
248 EXPECT_FALSE(notification->message().empty()); 250 EXPECT_FALSE(notification->message().empty());
249 EXPECT_EQ((size_t)1, notification->buttons().size()); 251 EXPECT_EQ((size_t)1, notification->buttons().size());
250 } 252 }
251 } 253 }
252 } 254 }
253 #endif 255 #endif
254 256
255 } // namespace test 257 } // namespace test
256 } // namespace ash 258 } // namespace ash
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/webui_login_display.cc ('k') | chrome/browser/signin/signin_global_error_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698