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

Side by Side Diff: chrome/browser/ui/webui/options/preferences_browsertest.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 years, 3 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
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 "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
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 values[i]->DeepCopy(), NULL); 204 policy::POLICY_SOURCE_CLOUD, values[i]->DeepCopy(), nullptr);
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
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,
881 new base::StringValue(onc_policy), 882 new base::StringValue(onc_policy),
882 NULL); 883 NULL);
883 policy_provider_.UpdateChromePolicy(map); 884 policy_provider_.UpdateChromePolicy(map);
884 885
885 content::RunAllPendingInMessageLoop(); 886 content::RunAllPendingInMessageLoop();
886 } 887 }
887 888
888 const chromeos::NetworkState* GetDefaultNetwork() { 889 const chromeos::NetworkState* GetDefaultNetwork() {
889 chromeos::NetworkStateHandler* handler = 890 chromeos::NetworkStateHandler* handler =
890 chromeos::NetworkHandler::Get()->network_state_handler(); 891 chromeos::NetworkHandler::Get()->network_state_handler();
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2)); 1079 SetProxyPref(chromeos::kProxyHttpsPort, base::FundamentalValue(2));
1079 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3)); 1080 SetProxyPref(chromeos::kProxyFtpPort, base::FundamentalValue(3));
1080 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4)); 1081 SetProxyPref(chromeos::kProxySocksPort, base::FundamentalValue(4));
1081 1082
1082 VerifyCurrentProxyServer( 1083 VerifyCurrentProxyServer(
1083 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", 1084 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4",
1084 onc::ONC_SOURCE_NONE); 1085 onc::ONC_SOURCE_NONE);
1085 } 1086 }
1086 1087
1087 #endif 1088 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/certificate_manager_browsertest.cc ('k') | chrome/browser/ui/webui/policy_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698