| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/permissions/permission_uma_util.h" | 5 #include "chrome/browser/permissions/permission_uma_util.h" |
| 6 | 6 |
| 7 #include "base/test/scoped_command_line.h" | 7 #include "base/test/scoped_command_line.h" |
| 8 #include "chrome/browser/signin/fake_signin_manager_builder.h" | 8 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
| 9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
| 10 #include "chrome/browser/sync/profile_sync_service_factory.h" | 10 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 14 #include "components/browser_sync/browser/profile_sync_service.h" | 14 #include "components/browser_sync/browser/profile_sync_service.h" |
| 15 #include "components/browser_sync/common/browser_sync_switches.h" | 15 #include "components/browser_sync/common/browser_sync_switches.h" |
| 16 #include "components/prefs/pref_service.h" | 16 #include "components/prefs/pref_service.h" |
| 17 #include "components/sync/base/model_type.h" | 17 #include "components/sync/base/model_type.h" |
| 18 #include "components/sync_driver/glue/sync_backend_host_mock.h" | 18 #include "components/sync/driver/glue/sync_backend_host_mock.h" |
| 19 #include "components/sync_driver/sync_prefs.h" | 19 #include "components/sync/driver/sync_prefs.h" |
| 20 #include "content/public/test/test_browser_thread_bundle.h" | 20 #include "content/public/test/test_browser_thread_bundle.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 constexpr char kTestingGaiaId[] = "gaia_id"; | 24 constexpr char kTestingGaiaId[] = "gaia_id"; |
| 25 constexpr char kTestingUsername[] = "fake_username"; | 25 constexpr char kTestingUsername[] = "fake_username"; |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 class PermissionUmaUtilTest : public testing::Test { | 28 class PermissionUmaUtilTest : public testing::Test { |
| 29 protected: | 29 protected: |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 sync_prefs.SetPreferredDataTypes( | 154 sync_prefs.SetPreferredDataTypes( |
| 155 registered_types, syncer::ModelTypeSet(syncer::PRIORITY_PREFERENCES)); | 155 registered_types, syncer::ModelTypeSet(syncer::PRIORITY_PREFERENCES)); |
| 156 EXPECT_FALSE(IsOptedIntoPermissionActionReporting(profile())); | 156 EXPECT_FALSE(IsOptedIntoPermissionActionReporting(profile())); |
| 157 | 157 |
| 158 sync_prefs.SetPreferredDataTypes( | 158 sync_prefs.SetPreferredDataTypes( |
| 159 registered_types, | 159 registered_types, |
| 160 syncer::ModelTypeSet(syncer::PROXY_TABS, syncer::PRIORITY_PREFERENCES)); | 160 syncer::ModelTypeSet(syncer::PROXY_TABS, syncer::PRIORITY_PREFERENCES)); |
| 161 EXPECT_TRUE(IsOptedIntoPermissionActionReporting(profile())); | 161 EXPECT_TRUE(IsOptedIntoPermissionActionReporting(profile())); |
| 162 } | 162 } |
| OLD | NEW |