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

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 10918263: Converted policy_prefs_ui.py pyauto test to a browser_test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 50bef18bddfce965da92c969e777a0fbbba1e8f2..959f7eca59966c6bdb7933d9fa1e7be5e500464a 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -158,7 +158,6 @@
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/policy/policy_service.h"
-#include "policy/policy_constants.h"
#endif
#if defined(OS_CHROMEOS)
@@ -1765,8 +1764,6 @@ void TestingAutomationProvider::BuildJSONHandlerMaps() {
&TestingAutomationProvider::OpenProfileWindow;
handler_map_["GetProcessInfo"] =
&TestingAutomationProvider::GetProcessInfo;
- handler_map_["GetPolicyDefinitionList"] =
- &TestingAutomationProvider::GetPolicyDefinitionList;
handler_map_["RefreshPolicies"] =
&TestingAutomationProvider::RefreshPolicies;
handler_map_["InstallExtension"] =
@@ -5325,45 +5322,6 @@ void TestingAutomationProvider::WaitForTabToBeRestored(
new NavigationControllerRestoredObserver(this, &controller, reply_message);
}
-void TestingAutomationProvider::GetPolicyDefinitionList(
- DictionaryValue* args,
- IPC::Message* reply_message) {
- AutomationJSONReply reply(this, reply_message);
-
-#if !defined(ENABLE_CONFIGURATION_POLICY)
- reply.SendError("Configuration Policy disabled");
-#else
- DictionaryValue response;
-
- const policy::PolicyDefinitionList* list =
- policy::GetChromePolicyDefinitionList();
- // Value::Type to python type.
- std::map<Value::Type, std::string> types;
- types[Value::TYPE_BOOLEAN] = "bool";
- types[Value::TYPE_DICTIONARY] = "dict";
- types[Value::TYPE_INTEGER] = "int";
- types[Value::TYPE_LIST] = "list";
- types[Value::TYPE_STRING] = "str";
-
- const policy::PolicyDefinitionList::Entry* entry;
- for (entry = list->begin; entry != list->end; ++entry) {
- if (types.find(entry->value_type) == types.end()) {
- std::string error("Unrecognized policy type for policy ");
- reply.SendError(error + entry->name);
- return;
- }
- Value* type = Value::CreateStringValue(types[entry->value_type]);
- Value* device_policy = Value::CreateBooleanValue(entry->device_policy);
- ListValue* definition = new ListValue;
- definition->Append(type);
- definition->Append(device_policy);
- response.Set(entry->name, definition);
- }
-
- reply.SendSuccess(&response);
-#endif
-}
-
void TestingAutomationProvider::RefreshPolicies(
base::DictionaryValue* args,
IPC::Message* reply_message) {
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.h ('k') | chrome/browser/policy/policy_prefs_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698