| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_global_error.h" | 5 #include "chrome/browser/signin/signin_global_error.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/histogram_tester.h" | 10 #include "base/test/histogram_tester.h" |
| 11 #include "chrome/browser/prefs/pref_service_syncable.h" | |
| 12 #include "chrome/browser/profiles/profile_info_cache.h" | 11 #include "chrome/browser/profiles/profile_info_cache.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/profiles/profile_metrics.h" | 13 #include "chrome/browser/profiles/profile_metrics.h" |
| 15 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" | 14 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" |
| 16 #include "chrome/browser/signin/fake_signin_manager_builder.h" | 15 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
| 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 18 #include "chrome/browser/signin/signin_error_controller_factory.h" | 17 #include "chrome/browser/signin/signin_error_controller_factory.h" |
| 19 #include "chrome/browser/signin/signin_global_error_factory.h" | 18 #include "chrome/browser/signin/signin_global_error_factory.h" |
| 20 #include "chrome/browser/signin/signin_manager_factory.h" | 19 #include "chrome/browser/signin/signin_manager_factory.h" |
| 21 #include "chrome/browser/ui/global_error/global_error_service.h" | 20 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 22 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 21 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 23 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 24 #include "chrome/test/base/testing_browser_process.h" | 23 #include "chrome/test/base/testing_browser_process.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 24 #include "chrome/test/base/testing_profile.h" |
| 26 #include "chrome/test/base/testing_profile_manager.h" | 25 #include "chrome/test/base/testing_profile_manager.h" |
| 27 #include "components/signin/core/browser/fake_auth_status_provider.h" | 26 #include "components/signin/core/browser/fake_auth_status_provider.h" |
| 28 #include "components/signin/core/browser/signin_error_controller.h" | 27 #include "components/signin/core/browser/signin_error_controller.h" |
| 29 #include "components/signin/core/browser/signin_manager.h" | 28 #include "components/signin/core/browser/signin_manager.h" |
| 29 #include "components/syncable_prefs/pref_service_syncable.h" |
| 30 #include "content/public/test/test_browser_thread_bundle.h" | 30 #include "content/public/test/test_browser_thread_bundle.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 32 | 32 |
| 33 static const char kTestAccountId[] = "id-testuser@test.com"; | 33 static const char kTestAccountId[] = "id-testuser@test.com"; |
| 34 static const char kTestGaiaId[] = "gaiaid-testuser@test.com"; | 34 static const char kTestGaiaId[] = "gaiaid-testuser@test.com"; |
| 35 static const char kTestUsername[] = "testuser@test.com"; | 35 static const char kTestUsername[] = "testuser@test.com"; |
| 36 | 36 |
| 37 class SigninGlobalErrorTest : public testing::Test { | 37 class SigninGlobalErrorTest : public testing::Test { |
| 38 public: | 38 public: |
| 39 SigninGlobalErrorTest() : | 39 SigninGlobalErrorTest() : |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 ProfileMetrics::LogNumberOfProfiles( | 162 ProfileMetrics::LogNumberOfProfiles( |
| 163 testing_profile_manager()->profile_manager()); | 163 testing_profile_manager()->profile_manager()); |
| 164 | 164 |
| 165 if (table[i].is_error) | 165 if (table[i].is_error) |
| 166 histogram_tester.ExpectBucketCount("Signin.AuthError", i, 1); | 166 histogram_tester.ExpectBucketCount("Signin.AuthError", i, 1); |
| 167 histogram_tester.ExpectBucketCount( | 167 histogram_tester.ExpectBucketCount( |
| 168 "Profile.NumberOfProfilesWithAuthErrors", table[i].is_error, 1); | 168 "Profile.NumberOfProfilesWithAuthErrors", table[i].is_error, 1); |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |