Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 13831007: BrowserTest for VariationsRestrictParameter user policy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary lines Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
2065 PolicyTest::SetUpInProcessBrowserTestFixture();
2066 PolicyMap policies;
2067 policies.Set(
2068 key::kVariationsRestrictParameter,
2069 POLICY_LEVEL_MANDATORY,
2070 POLICY_SCOPE_USER,
2071 base::Value::CreateStringValue("restricted"));
2072 provider_.UpdateChromePolicy(policies);
2073 }
2074 };
2075
2076 IN_PROC_BROWSER_TEST_F(PolicyVariationsServiceTest, VariationsURLIsValid) {
2077 const std::string default_variations_url =
2078 chrome_variations::VariationsService::
2079 GetDefaultVariationsServerURLForTesting();
2080
2081 // Policy is applied and pref is already updated in local state.
2082 EXPECT_EQ(default_variations_url + "?restrict=restricted",
2083 chrome_variations::VariationsService::GetVariationsServerURL(
2084 g_browser_process->local_state()).spec());
2085 }
2086 #endif
2087
2058 } // namespace policy 2088 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698