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

Side by Side Diff: components/policy/core/common/cloud/user_cloud_policy_store_unittest.cc

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/policy/core/common/cloud/user_cloud_policy_store.h" 5 #include "components/policy/core/common/cloud/user_cloud_policy_store.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 base::FilePath key_file() { 94 base::FilePath key_file() {
95 return tmp_dir_.GetPath().AppendASCII("policy_key"); 95 return tmp_dir_.GetPath().AppendASCII("policy_key");
96 } 96 }
97 97
98 // Verifies that store_->policy_map() has the appropriate entries. 98 // Verifies that store_->policy_map() has the appropriate entries.
99 void VerifyPolicyMap(CloudPolicyStore* store) { 99 void VerifyPolicyMap(CloudPolicyStore* store) {
100 EXPECT_EQ(2U, store->policy_map().size()); 100 EXPECT_EQ(2U, store->policy_map().size());
101 const PolicyMap::Entry* entry = 101 const PolicyMap::Entry* entry =
102 store->policy_map().Get(key::kPasswordManagerEnabled); 102 store->policy_map().Get(key::kPasswordManagerEnabled);
103 ASSERT_TRUE(entry); 103 ASSERT_TRUE(entry);
104 EXPECT_TRUE(base::FundamentalValue(true).Equals(entry->value.get())); 104 EXPECT_TRUE(base::Value(true).Equals(entry->value.get()));
105 ASSERT_TRUE(store->policy_map().Get(key::kURLBlacklist)); 105 ASSERT_TRUE(store->policy_map().Get(key::kURLBlacklist));
106 } 106 }
107 107
108 // Install an expectation on |observer_| for an error code. 108 // Install an expectation on |observer_| for an error code.
109 void ExpectError(CloudPolicyStore* store, CloudPolicyStore::Status error) { 109 void ExpectError(CloudPolicyStore* store, CloudPolicyStore::Status error) {
110 EXPECT_CALL(observer_, 110 EXPECT_CALL(observer_,
111 OnStoreError(AllOf(Eq(store), 111 OnStoreError(AllOf(Eq(store),
112 Property(&CloudPolicyStore::status, 112 Property(&CloudPolicyStore::status,
113 Eq(error))))); 113 Eq(error)))));
114 } 114 }
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner())); 504 new UserCloudPolicyStore(policy_file(), key_file(), loop_.task_runner()));
505 store2->SetSigninUsername(PolicyBuilder::kFakeUsername); 505 store2->SetSigninUsername(PolicyBuilder::kFakeUsername);
506 store2->AddObserver(&observer_); 506 store2->AddObserver(&observer_);
507 ExpectError(store2.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR); 507 ExpectError(store2.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR);
508 store2->Load(); 508 store2->Load();
509 RunUntilIdle(); 509 RunUntilIdle();
510 store2->RemoveObserver(&observer_); 510 store2->RemoveObserver(&observer_);
511 } 511 }
512 512
513 } // namespace policy 513 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698