Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
| 28 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 28 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 29 #include "chrome/browser/devtools/devtools_window.h" | 29 #include "chrome/browser/devtools/devtools_window.h" |
| 30 #include "chrome/browser/download/download_prefs.h" | 30 #include "chrome/browser/download/download_prefs.h" |
| 31 #include "chrome/browser/extensions/crx_installer.h" | 31 #include "chrome/browser/extensions/crx_installer.h" |
| 32 #include "chrome/browser/extensions/extension_service.h" | 32 #include "chrome/browser/extensions/extension_service.h" |
| 33 #include "chrome/browser/extensions/extension_system.h" | 33 #include "chrome/browser/extensions/extension_system.h" |
| 34 #include "chrome/browser/infobars/infobar_service.h" | 34 #include "chrome/browser/infobars/infobar_service.h" |
| 35 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 35 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 36 #include "chrome/browser/media/media_stream_devices_controller.h" | 36 #include "chrome/browser/media/media_stream_devices_controller.h" |
| 37 #include "chrome/browser/metrics/variations/variations_service.h" | |
| 37 #include "chrome/browser/net/url_request_mock_util.h" | 38 #include "chrome/browser/net/url_request_mock_util.h" |
| 38 #include "chrome/browser/plugins/plugin_prefs.h" | 39 #include "chrome/browser/plugins/plugin_prefs.h" |
| 39 #include "chrome/browser/policy/browser_policy_connector.h" | 40 #include "chrome/browser/policy/browser_policy_connector.h" |
| 40 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 41 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
| 41 #include "chrome/browser/policy/policy_map.h" | 42 #include "chrome/browser/policy/policy_map.h" |
| 42 #include "chrome/browser/prefs/session_startup_pref.h" | 43 #include "chrome/browser/prefs/session_startup_pref.h" |
| 43 #include "chrome/browser/profiles/profile.h" | 44 #include "chrome/browser/profiles/profile.h" |
| 44 #include "chrome/browser/search/instant_service.h" | 45 #include "chrome/browser/search/instant_service.h" |
| 45 #include "chrome/browser/search/instant_service_factory.h" | 46 #include "chrome/browser/search/instant_service_factory.h" |
| 46 #include "chrome/browser/search/search.h" | 47 #include "chrome/browser/search/search.h" |
| (...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2048 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, | 2049 base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, |
| 2049 this)); | 2050 this)); |
| 2050 | 2051 |
| 2051 MessageLoop::current()->Run(); | 2052 MessageLoop::current()->Run(); |
| 2052 } | 2053 } |
| 2053 | 2054 |
| 2054 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, | 2055 INSTANTIATE_TEST_CASE_P(MediaStreamDevicesControllerBrowserTestInstance, |
| 2055 MediaStreamDevicesControllerBrowserTest, | 2056 MediaStreamDevicesControllerBrowserTest, |
| 2056 testing::Bool()); | 2057 testing::Bool()); |
| 2057 | 2058 |
| 2059 #if !defined(OS_CHROMEOS) | |
| 2060 // Similar to PolicyTest but sets the proper policy before the browser is | |
| 2061 // started. | |
| 2062 class PolicyVariationsServiceTest : public PolicyTest { | |
| 2063 public: | |
| 2064 PolicyVariationsServiceTest() {} | |
| 2065 virtual ~PolicyVariationsServiceTest() {} | |
|
Alexei Svitkine (slow)
2013/04/18 14:53:23
You don't need these two, since the class is defin
Mathieu
2013/04/18 14:56:39
Done.
| |
| 2066 | |
| 2067 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 2068 PolicyTest::SetUpInProcessBrowserTestFixture(); | |
| 2069 PolicyMap policies; | |
| 2070 policies.Set( | |
| 2071 key::kVariationsRestrictParameter, | |
| 2072 POLICY_LEVEL_MANDATORY, | |
| 2073 POLICY_SCOPE_USER, | |
| 2074 base::Value::CreateStringValue("restricted")); | |
| 2075 provider_.UpdateChromePolicy(policies); | |
| 2076 } | |
| 2077 }; | |
| 2078 | |
| 2079 IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) { | |
| 2080 const std::string default_variations_url = | |
| 2081 chrome_variations::VariationsService:: | |
| 2082 GetDefaultVariationsServerURLForTesting(); | |
| 2083 | |
| 2084 // Policy is applied and pref is already updated in local state. | |
| 2085 EXPECT_EQ(default_variations_url + "?restrict=restricted", | |
| 2086 chrome_variations::VariationsService::GetVariationsServerURL( | |
| 2087 g_browser_process->local_state()).spec()); | |
|
Mattias Nissler (ping if slow)
2013/04/18 15:02:53
Ideally, you'd check the URL that the service uses
Mathieu
2013/04/18 15:16:25
In this case this function is directly setting the
| |
| 2088 } | |
| 2089 #endif | |
| 2090 | |
| 2058 } // namespace policy | 2091 } // namespace policy |
| OLD | NEW |