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

Unified Diff: chrome/browser/ui/webui/policy_ui_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: Increased ID range for Messages. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/policy_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/policy_ui_browsertest.cc b/chrome/browser/ui/webui/policy_ui_browsertest.cc
index 161a734a735981668475392a7b3ad5eda7b84366..2b7a830bc21853133f94f8b66b3d42051390fd97 100644
--- a/chrome/browser/ui/webui/policy_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/policy_ui_browsertest.cc
@@ -62,6 +62,9 @@ std::vector<std::string> PopulateExpectedPolicy(
} else {
expected_policy.push_back(std::string());
}
+ // Populate expected source name.
+ // TODO(fhorschig): Make MockProvider use another source.
+ expected_policy.push_back(std::string()); // MockProvider sets to unknown.
// Populate expected policy name.
expected_policy.push_back(name);
@@ -69,6 +72,7 @@ std::vector<std::string> PopulateExpectedPolicy(
// Populate expected policy value.
expected_policy.push_back(value);
+
Thiemo Nagel 2015/09/04 20:15:53 Remove blank line.
fhorschig 2015/09/07 14:09:33 Done.
// Populate expected status.
if (unknown)
expected_policy.push_back(l10n_util::GetStringUTF8(IDS_POLICY_UNKNOWN));
@@ -118,9 +122,9 @@ void PolicyUITest::SetUpInProcessBrowserTestFixture() {
}
void PolicyUITest::UpdateProviderPolicy(const policy::PolicyMap& policy) {
- provider_.UpdateChromePolicy(policy);
- base::RunLoop loop;
- loop.RunUntilIdle();
+ provider_.UpdateChromePolicy(policy);
+ base::RunLoop loop;
+ loop.RunUntilIdle();
}
void PolicyUITest::VerifyPolicies(
@@ -186,8 +190,8 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyNames) {
ASSERT_TRUE(chrome_schema.valid());
for (policy::Schema::Iterator it = chrome_schema.GetPropertiesIterator();
!it.IsAtEnd(); it.Advance()) {
- expected_policies.push_back(
- PopulateExpectedPolicy(it.key(), std::string(), NULL, false));
+ expected_policies.push_back(PopulateExpectedPolicy(
Thiemo Nagel 2015/09/04 20:15:53 Don't reformat!
fhorschig 2015/09/07 14:09:34 Done.
+ it.key(), std::string(), NULL, false));
}
// Retrieve the contents of the policy table from the UI and verify that it
@@ -219,6 +223,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) {
policy::POLICY_SCOPE_MACHINE,
new base::StringValue("http://google.com"),
NULL);
+
Thiemo Nagel 2015/09/04 20:15:53 Remove blank line.
fhorschig 2015/09/07 14:09:34 Done.
expected_values[policy::key::kHomepageLocation] = "http://google.com";
values.Set(policy::key::kRestoreOnStartup,
policy::POLICY_LEVEL_RECOMMENDED,
@@ -317,8 +322,8 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, ExtensionLoadAndSendPolicy) {
for (policy::Schema::Iterator it = chrome_schema.GetPropertiesIterator();
!it.IsAtEnd(); it.Advance()) {
- expected_policies.push_back(
- PopulateExpectedPolicy(it.key(), std::string(), NULL, false));
+ expected_policies.push_back(PopulateExpectedPolicy(
Thiemo Nagel 2015/09/04 20:15:53 Don't reformat.
fhorschig 2015/09/07 14:09:33 Done.
+ it.key(), std::string(), NULL, false));
}
// Add newly added policy to expected policy list.
expected_policies.push_back(PopulateExpectedPolicy(

Powered by Google App Engine
This is Rietveld 408576698