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 "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 { GoogleServiceAuthError::ACCOUNT_DELETED, true }, | 229 { GoogleServiceAuthError::ACCOUNT_DELETED, true }, |
230 { GoogleServiceAuthError::ACCOUNT_DISABLED, true }, | 230 { GoogleServiceAuthError::ACCOUNT_DISABLED, true }, |
231 { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true }, | 231 { GoogleServiceAuthError::SERVICE_UNAVAILABLE, true }, |
232 { GoogleServiceAuthError::TWO_FACTOR, true }, | 232 { GoogleServiceAuthError::TWO_FACTOR, true }, |
233 { GoogleServiceAuthError::REQUEST_CANCELED, true }, | 233 { GoogleServiceAuthError::REQUEST_CANCELED, true }, |
234 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true }, | 234 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true }, |
235 { GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, true }, | 235 { GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, true }, |
236 { GoogleServiceAuthError::SERVICE_ERROR, true }, | 236 { GoogleServiceAuthError::SERVICE_ERROR, true }, |
237 { GoogleServiceAuthError::WEB_LOGIN_REQUIRED, true }, | 237 { GoogleServiceAuthError::WEB_LOGIN_REQUIRED, true }, |
238 }; | 238 }; |
239 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(table) == GoogleServiceAuthError::NUM_STATES, | 239 COMPILE_ASSERT(arraysize(table) == GoogleServiceAuthError::NUM_STATES, |
240 kTable_size_does_not_match_number_of_auth_error_types); | 240 kTable_size_does_not_match_number_of_auth_error_types); |
241 | 241 |
242 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(table); ++i) { | 242 for (size_t i = 0; i < arraysize(table); ++i) { |
243 FakeAuthStatusProvider provider(error_controller_); | 243 FakeAuthStatusProvider provider(error_controller_); |
244 provider.SetAuthError(kTestAccountId, | 244 provider.SetAuthError(kTestAccountId, |
245 kTestUsername, | 245 kTestUsername, |
246 GoogleServiceAuthError(table[i].error_state)); | 246 GoogleServiceAuthError(table[i].error_state)); |
247 const Notification* notification = notification_ui_manager_->FindById( | 247 const Notification* notification = notification_ui_manager_->FindById( |
248 kNotificationId, NotificationUIManager::GetProfileID(profile_.get())); | 248 kNotificationId, NotificationUIManager::GetProfileID(profile_.get())); |
249 ASSERT_EQ(table[i].is_error, notification != NULL); | 249 ASSERT_EQ(table[i].is_error, notification != NULL); |
250 if (table[i].is_error) { | 250 if (table[i].is_error) { |
251 EXPECT_FALSE(notification->title().empty()); | 251 EXPECT_FALSE(notification->title().empty()); |
252 EXPECT_FALSE(notification->message().empty()); | 252 EXPECT_FALSE(notification->message().empty()); |
253 EXPECT_EQ((size_t)1, notification->buttons().size()); | 253 EXPECT_EQ((size_t)1, notification->buttons().size()); |
254 } | 254 } |
255 } | 255 } |
256 } | 256 } |
257 #endif | 257 #endif |
258 | 258 |
259 } // namespace test | 259 } // namespace test |
260 } // namespace ash | 260 } // namespace ash |
OLD | NEW |