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

Unified Diff: chrome/browser/extensions/api/storage/policy_value_store_unittest.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
diff --git a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
index d2ff1a83c067f79f4dd1ade350b3824eb5fc4d25..55bf7f2f59c0b5bb97ba219d2c6441ae36c8991f 100644
--- a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
+++ b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc
@@ -12,6 +12,7 @@
#include "base/message_loop/message_loop.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/policy_map.h"
+#include "components/policy/core/common/policy_types.h"
#include "content/public/test/test_browser_thread.h"
#include "extensions/browser/api/storage/settings_observer.h"
#include "extensions/browser/value_store/leveldb_value_store.h"
@@ -120,9 +121,10 @@ TEST_F(PolicyValueStoreTest, DontProvideRecommendedPolicies) {
policy::PolicyMap policies;
base::FundamentalValue expected(123);
policies.Set("must", policy::POLICY_LEVEL_MANDATORY,
- policy::POLICY_SCOPE_USER, expected.DeepCopy(), NULL);
+ policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
+ expected.DeepCopy(), nullptr);
policies.Set("may", policy::POLICY_LEVEL_RECOMMENDED,
- policy::POLICY_SCOPE_USER,
+ policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
new base::FundamentalValue(456), NULL);
store_->SetCurrentPolicy(policies);
ValueStore::ReadResult result = store_->Get();
@@ -165,7 +167,7 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) {
policy::PolicyMap policies;
policies.Set("aaa", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- value.DeepCopy(), NULL);
+ policy::POLICY_SOURCE_CLOUD, value.DeepCopy(), nullptr);
store_->SetCurrentPolicy(policies);
loop_.RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer_);
@@ -181,7 +183,7 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) {
}
policies.Set("bbb", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- value.DeepCopy(), NULL);
+ policy::POLICY_SOURCE_CLOUD, value.DeepCopy(), nullptr);
store_->SetCurrentPolicy(policies);
loop_.RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer_);
@@ -199,7 +201,7 @@ TEST_F(PolicyValueStoreTest, NotifyOnChanges) {
}
policies.Set("bbb", policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
- new_value.DeepCopy(), NULL);
+ policy::POLICY_SOURCE_CLOUD, new_value.DeepCopy(), nullptr);
store_->SetCurrentPolicy(policies);
loop_.RunUntilIdle();
Mock::VerifyAndClearExpectations(&observer_);

Powered by Google App Engine
This is Rietveld 408576698