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

Unified Diff: chrome/browser/policy/device_policy_cache_unittest.cc

Issue 9599009: Fix infinite refresh of device policy when the TPM gets out of sync with the stateful partition. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added unit test Created 8 years, 10 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
« no previous file with comments | « chrome/browser/policy/device_policy_cache.cc ('k') | chrome/browser/policy/user_policy_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/device_policy_cache_unittest.cc
diff --git a/chrome/browser/policy/device_policy_cache_unittest.cc b/chrome/browser/policy/device_policy_cache_unittest.cc
index b438cdad3cc8dc4e0e222f8313b67b47968fbdda..3a62009fea40d97f236d997fb6039cf896420645 100644
--- a/chrome/browser/policy/device_policy_cache_unittest.cc
+++ b/chrome/browser/policy/device_policy_cache_unittest.cc
@@ -153,7 +153,7 @@ TEST_F(DevicePolicyCacheTest, SetPolicy) {
EXPECT_CALL(signed_settings_helper_, StartRetrievePolicyOp(_)).WillOnce(
MockSignedSettingsHelperRetrievePolicy(SignedSettings::SUCCESS,
new_policy));
- cache_->SetPolicy(new_policy);
+ EXPECT_TRUE(cache_->SetPolicy(new_policy));
testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_);
base::FundamentalValue updated_expected(300);
EXPECT_TRUE(Value::Equals(&updated_expected,
@@ -178,7 +178,7 @@ TEST_F(DevicePolicyCacheTest, SetPolicyWrongUser) {
em::PolicyFetchResponse new_policy;
CreateRefreshRatePolicy(&new_policy, "foreign_user@example.com", 300);
EXPECT_CALL(signed_settings_helper_, StartStorePolicyOp(_, _)).Times(0);
- cache_->SetPolicy(new_policy);
+ EXPECT_FALSE(cache_->SetPolicy(new_policy));
testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_);
base::FundamentalValue expected(120);
@@ -202,7 +202,7 @@ TEST_F(DevicePolicyCacheTest, SetPolicyNonEnterpriseDevice) {
em::PolicyFetchResponse new_policy;
CreateRefreshRatePolicy(&new_policy, kTestUser, 120);
EXPECT_CALL(signed_settings_helper_, StartStorePolicyOp(_, _)).Times(0);
- cache_->SetPolicy(new_policy);
+ EXPECT_FALSE(cache_->SetPolicy(new_policy));
testing::Mock::VerifyAndClearExpectations(&signed_settings_helper_);
base::FundamentalValue expected(120);
« no previous file with comments | « chrome/browser/policy/device_policy_cache.cc ('k') | chrome/browser/policy/user_policy_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698