| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/extensions/extension_service.h" | 41 #include "chrome/browser/extensions/extension_service.h" |
| 42 #include "chrome/browser/extensions/shared_module_service.h" | 42 #include "chrome/browser/extensions/shared_module_service.h" |
| 43 #include "chrome/browser/extensions/unpacked_installer.h" | 43 #include "chrome/browser/extensions/unpacked_installer.h" |
| 44 #include "chrome/browser/extensions/updater/extension_cache_fake.h" | 44 #include "chrome/browser/extensions/updater/extension_cache_fake.h" |
| 45 #include "chrome/browser/extensions/updater/extension_updater.h" | 45 #include "chrome/browser/extensions/updater/extension_updater.h" |
| 46 #include "chrome/browser/infobars/infobar_service.h" | 46 #include "chrome/browser/infobars/infobar_service.h" |
| 47 #include "chrome/browser/interstitials/security_interstitial_page.h" | 47 #include "chrome/browser/interstitials/security_interstitial_page.h" |
| 48 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" | 48 #include "chrome/browser/interstitials/security_interstitial_page_test_utils.h" |
| 49 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 49 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 50 #include "chrome/browser/media/media_stream_devices_controller.h" | 50 #include "chrome/browser/media/media_stream_devices_controller.h" |
| 51 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h" |
| 51 #include "chrome/browser/metrics/variations/variations_service.h" | 52 #include "chrome/browser/metrics/variations/variations_service.h" |
| 52 #include "chrome/browser/net/prediction_options.h" | 53 #include "chrome/browser/net/prediction_options.h" |
| 53 #include "chrome/browser/net/url_request_mock_util.h" | 54 #include "chrome/browser/net/url_request_mock_util.h" |
| 54 #include "chrome/browser/plugins/plugin_prefs.h" | 55 #include "chrome/browser/plugins/plugin_prefs.h" |
| 55 #include "chrome/browser/policy/cloud/test_request_interceptor.h" | 56 #include "chrome/browser/policy/cloud/test_request_interceptor.h" |
| 56 #include "chrome/browser/policy/profile_policy_connector.h" | 57 #include "chrome/browser/policy/profile_policy_connector.h" |
| 57 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 58 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 58 #include "chrome/browser/prefs/session_startup_pref.h" | 59 #include "chrome/browser/prefs/session_startup_pref.h" |
| 59 #include "chrome/browser/profiles/profile.h" | 60 #include "chrome/browser/profiles/profile.h" |
| 60 #include "chrome/browser/search/instant_service.h" | 61 #include "chrome/browser/search/instant_service.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 #include "components/policy/core/common/policy_map.h" | 98 #include "components/policy/core/common/policy_map.h" |
| 98 #include "components/policy/core/common/policy_pref_names.h" | 99 #include "components/policy/core/common/policy_pref_names.h" |
| 99 #include "components/policy/core/common/policy_service.h" | 100 #include "components/policy/core/common/policy_service.h" |
| 100 #include "components/policy/core/common/policy_service_impl.h" | 101 #include "components/policy/core/common/policy_service_impl.h" |
| 101 #include "components/search/search.h" | 102 #include "components/search/search.h" |
| 102 #include "components/search_engines/template_url.h" | 103 #include "components/search_engines/template_url.h" |
| 103 #include "components/search_engines/template_url_service.h" | 104 #include "components/search_engines/template_url_service.h" |
| 104 #include "components/translate/core/browser/language_state.h" | 105 #include "components/translate/core/browser/language_state.h" |
| 105 #include "components/translate/core/browser/translate_infobar_delegate.h" | 106 #include "components/translate/core/browser/translate_infobar_delegate.h" |
| 106 #include "components/version_info/version_info.h" | 107 #include "components/version_info/version_info.h" |
| 108 #include "components/web_resource/resource_request_allowed_notifier.h" |
| 107 #include "content/public/browser/browser_child_process_host_iterator.h" | 109 #include "content/public/browser/browser_child_process_host_iterator.h" |
| 108 #include "content/public/browser/browser_context.h" | 110 #include "content/public/browser/browser_context.h" |
| 109 #include "content/public/browser/browser_thread.h" | 111 #include "content/public/browser/browser_thread.h" |
| 110 #include "content/public/browser/child_process_data.h" | 112 #include "content/public/browser/child_process_data.h" |
| 111 #include "content/public/browser/download_item.h" | 113 #include "content/public/browser/download_item.h" |
| 112 #include "content/public/browser/download_manager.h" | 114 #include "content/public/browser/download_manager.h" |
| 113 #include "content/public/browser/gpu_data_manager.h" | 115 #include "content/public/browser/gpu_data_manager.h" |
| 114 #include "content/public/browser/interstitial_page.h" | 116 #include "content/public/browser/interstitial_page.h" |
| 115 #include "content/public/browser/notification_details.h" | 117 #include "content/public/browser/notification_details.h" |
| 116 #include "content/public/browser/notification_observer.h" | 118 #include "content/public/browser/notification_observer.h" |
| (...skipping 3650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3767 NULL); | 3769 NULL); |
| 3768 provider_.UpdateChromePolicy(policies); | 3770 provider_.UpdateChromePolicy(policies); |
| 3769 } | 3771 } |
| 3770 }; | 3772 }; |
| 3771 | 3773 |
| 3772 IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) { | 3774 IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) { |
| 3773 const std::string default_variations_url = | 3775 const std::string default_variations_url = |
| 3774 chrome_variations::VariationsService:: | 3776 chrome_variations::VariationsService:: |
| 3775 GetDefaultVariationsServerURLForTesting(); | 3777 GetDefaultVariationsServerURLForTesting(); |
| 3776 | 3778 |
| 3777 const GURL url = | 3779 // g_browser_process->variations_service() is null by default in Chromium |
| 3778 chrome_variations::VariationsService::GetVariationsServerURL( | 3780 // builds, so construct a VariationsService locally instead. |
| 3779 g_browser_process->local_state(), std::string()); | 3781 chrome_variations::VariationsService service( |
| 3782 make_scoped_ptr(new ChromeVariationsServiceClient()), |
| 3783 new web_resource::ResourceRequestAllowedNotifier( |
| 3784 g_browser_process->local_state(), nullptr), |
| 3785 g_browser_process->local_state(), NULL); |
| 3786 |
| 3787 const GURL url = service.GetVariationsServerURL( |
| 3788 g_browser_process->local_state(), std::string()); |
| 3780 EXPECT_TRUE(base::StartsWith(url.spec(), default_variations_url, | 3789 EXPECT_TRUE(base::StartsWith(url.spec(), default_variations_url, |
| 3781 base::CompareCase::SENSITIVE)); | 3790 base::CompareCase::SENSITIVE)); |
| 3782 std::string value; | 3791 std::string value; |
| 3783 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); | 3792 EXPECT_TRUE(net::GetValueForKeyInQuery(url, "restrict", &value)); |
| 3784 EXPECT_EQ("restricted", value); | 3793 EXPECT_EQ("restricted", value); |
| 3785 } | 3794 } |
| 3786 | 3795 |
| 3787 IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistSelective) { | 3796 IN_PROC_BROWSER_TEST_F(PolicyTest, NativeMessagingBlacklistSelective) { |
| 3788 base::ListValue blacklist; | 3797 base::ListValue blacklist; |
| 3789 blacklist.Append(new base::StringValue("host.name")); | 3798 blacklist.Append(new base::StringValue("host.name")); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3856 | 3865 |
| 3857 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, | 3866 IN_PROC_BROWSER_TEST_F(HardwareAccelerationModePolicyTest, |
| 3858 HardwareAccelerationDisabled) { | 3867 HardwareAccelerationDisabled) { |
| 3859 // Verifies that hardware acceleration can be disabled with policy. | 3868 // Verifies that hardware acceleration can be disabled with policy. |
| 3860 EXPECT_FALSE( | 3869 EXPECT_FALSE( |
| 3861 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); | 3870 content::GpuDataManager::GetInstance()->GpuAccessAllowed(nullptr)); |
| 3862 } | 3871 } |
| 3863 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 3872 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
| 3864 | 3873 |
| 3865 } // namespace policy | 3874 } // namespace policy |
| OLD | NEW |