| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/sync/profile_sync_service_mock.h" | 7 #include "chrome/browser/sync/profile_sync_service_mock.h" |
| 8 #include "chrome/browser/sync/sync_ui_util.h" | 8 #include "chrome/browser/sync/sync_ui_util.h" |
| 9 #include "content/test/test_browser_thread.h" | 9 #include "content/test/test_browser_thread.h" |
| 10 #include "testing/gmock/include/gmock/gmock-actions.h" | 10 #include "testing/gmock/include/gmock/gmock-actions.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using ::testing::Return; | 14 using ::testing::Return; |
| 15 using ::testing::NiceMock; | 15 using ::testing::NiceMock; |
| 16 using content::BrowserThread; |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 // Utility function to test that GetStatusLabelsForSyncGlobalError returns | 20 // Utility function to test that GetStatusLabelsForSyncGlobalError returns |
| 20 // the correct results for the given states. | 21 // the correct results for the given states. |
| 21 void VerifySyncGlobalErrorResult(NiceMock<ProfileSyncServiceMock>* service, | 22 void VerifySyncGlobalErrorResult(NiceMock<ProfileSyncServiceMock>* service, |
| 22 GoogleServiceAuthError::State error_state, | 23 GoogleServiceAuthError::State error_state, |
| 23 bool is_signed_in, | 24 bool is_signed_in, |
| 24 bool is_error) { | 25 bool is_error) { |
| 25 GoogleServiceAuthError auth_error(error_state); | 26 GoogleServiceAuthError auth_error(error_state); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true }, | 118 { GoogleServiceAuthError::HOSTED_NOT_ALLOWED, true }, |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 for (size_t i = 0; i < sizeof(table)/sizeof(*table); ++i) { | 121 for (size_t i = 0; i < sizeof(table)/sizeof(*table); ++i) { |
| 121 VerifySyncGlobalErrorResult( | 122 VerifySyncGlobalErrorResult( |
| 122 &service, table[i].error_state, true, table[i].is_error); | 123 &service, table[i].error_state, true, table[i].is_error); |
| 123 VerifySyncGlobalErrorResult( | 124 VerifySyncGlobalErrorResult( |
| 124 &service, table[i].error_state, false, false); | 125 &service, table[i].error_state, false, false); |
| 125 } | 126 } |
| 126 } | 127 } |
| OLD | NEW |