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 "chrome/browser/ui/webui/options/preferences_browsertest.h" | 5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 &policy_provider_); | 194 &policy_provider_); |
195 } | 195 } |
196 | 196 |
197 void PreferencesBrowserTest::SetUserPolicies( | 197 void PreferencesBrowserTest::SetUserPolicies( |
198 const std::vector<std::string>& names, | 198 const std::vector<std::string>& names, |
199 const std::vector<base::Value*>& values, | 199 const std::vector<base::Value*>& values, |
200 policy::PolicyLevel level) { | 200 policy::PolicyLevel level) { |
201 policy::PolicyMap map; | 201 policy::PolicyMap map; |
202 for (size_t i = 0; i < names.size(); ++i) { | 202 for (size_t i = 0; i < names.size(); ++i) { |
203 map.Set(names[i], level, policy::POLICY_SCOPE_USER, | 203 map.Set(names[i], level, policy::POLICY_SCOPE_USER, |
204 policy::POLICY_SOURCE_CLOUD, values[i]->DeepCopy(), nullptr); | 204 values[i]->DeepCopy(), NULL); |
205 } | 205 } |
206 policy_provider_.UpdateChromePolicy(map); | 206 policy_provider_.UpdateChromePolicy(map); |
207 } | 207 } |
208 | 208 |
209 void PreferencesBrowserTest::ClearUserPolicies() { | 209 void PreferencesBrowserTest::ClearUserPolicies() { |
210 policy::PolicyMap empty_policy_map; | 210 policy::PolicyMap empty_policy_map; |
211 policy_provider_.UpdateChromePolicy(empty_policy_map); | 211 policy_provider_.UpdateChromePolicy(empty_policy_map); |
212 } | 212 } |
213 | 213 |
214 void PreferencesBrowserTest::SetUserValues( | 214 void PreferencesBrowserTest::SetUserValues( |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 " \"Type\": \"PAC\" }" | 871 " \"Type\": \"PAC\" }" |
872 " }" | 872 " }" |
873 " ]," | 873 " ]," |
874 " \"Type\": \"UnencryptedConfiguration\"" | 874 " \"Type\": \"UnencryptedConfiguration\"" |
875 "}"; | 875 "}"; |
876 | 876 |
877 policy::PolicyMap map; | 877 policy::PolicyMap map; |
878 map.Set(policy_name, | 878 map.Set(policy_name, |
879 policy::POLICY_LEVEL_MANDATORY, | 879 policy::POLICY_LEVEL_MANDATORY, |
880 scope, | 880 scope, |
881 policy::POLICY_SOURCE_CLOUD, | |
882 new base::StringValue(onc_policy), | 881 new base::StringValue(onc_policy), |
883 NULL); | 882 NULL); |
884 policy_provider_.UpdateChromePolicy(map); | 883 policy_provider_.UpdateChromePolicy(map); |
885 | 884 |
886 content::RunAllPendingInMessageLoop(); | 885 content::RunAllPendingInMessageLoop(); |
887 } | 886 } |
888 | 887 |
889 const chromeos::NetworkState* GetDefaultNetwork() { | 888 const chromeos::NetworkState* GetDefaultNetwork() { |
890 chromeos::NetworkStateHandler* handler = | 889 chromeos::NetworkStateHandler* handler = |
891 chromeos::NetworkHandler::Get()->network_state_handler(); | 890 chromeos::NetworkHandler::Get()->network_state_handler(); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); | 1078 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); |
1080 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); | 1079 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); |
1081 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); | 1080 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); |
1082 | 1081 |
1083 VerifyCurrentProxyServer( | 1082 VerifyCurrentProxyServer( |
1084 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", | 1083 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", |
1085 onc::ONC_SOURCE_NONE); | 1084 onc::ONC_SOURCE_NONE); |
1086 } | 1085 } |
1087 | 1086 |
1088 #endif | 1087 #endif |
OLD | NEW |