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

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

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 return true; 49 return true;
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 class UserCloudPolicyStoreTest : public testing::Test { 54 class UserCloudPolicyStoreTest : public testing::Test {
55 public: 55 public:
56 UserCloudPolicyStoreTest() {} 56 UserCloudPolicyStoreTest() {}
57 57
58 virtual void SetUp() override { 58 void SetUp() override {
59 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); 59 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir());
60 store_.reset( 60 store_.reset(
61 new UserCloudPolicyStore(policy_file(), 61 new UserCloudPolicyStore(policy_file(),
62 key_file(), 62 key_file(),
63 GetPolicyVerificationKey(), 63 GetPolicyVerificationKey(),
64 loop_.message_loop_proxy())); 64 loop_.message_loop_proxy()));
65 external_data_manager_.reset(new MockCloudExternalDataManager); 65 external_data_manager_.reset(new MockCloudExternalDataManager);
66 external_data_manager_->SetPolicyStore(store_.get()); 66 external_data_manager_->SetPolicyStore(store_.get());
67 store_->SetSigninUsername(PolicyBuilder::kFakeUsername); 67 store_->SetSigninUsername(PolicyBuilder::kFakeUsername);
68 store_->AddObserver(&observer_); 68 store_->AddObserver(&observer_);
69 69
70 // Install an initial public key, so that by default the validation of 70 // Install an initial public key, so that by default the validation of
71 // the stored/loaded policy blob succeeds (it looks like a new key 71 // the stored/loaded policy blob succeeds (it looks like a new key
72 // provision). 72 // provision).
73 policy_.SetDefaultInitialSigningKey(); 73 policy_.SetDefaultInitialSigningKey();
74 74
75 InitPolicyPayload(&policy_.payload()); 75 InitPolicyPayload(&policy_.payload());
76 76
77 policy_.Build(); 77 policy_.Build();
78 } 78 }
79 79
80 virtual void TearDown() override { 80 void TearDown() override {
81 store_->RemoveObserver(&observer_); 81 store_->RemoveObserver(&observer_);
82 external_data_manager_.reset(); 82 external_data_manager_.reset();
83 store_.reset(); 83 store_.reset();
84 RunUntilIdle(); 84 RunUntilIdle();
85 } 85 }
86 86
87 void InitPolicyPayload(enterprise_management::CloudPolicySettings* payload) { 87 void InitPolicyPayload(enterprise_management::CloudPolicySettings* payload) {
88 payload->mutable_passwordmanagerenabled()->set_value(true); 88 payload->mutable_passwordmanagerenabled()->set_value(true);
89 payload->mutable_urlblacklist()->mutable_value()->add_entries( 89 payload->mutable_urlblacklist()->mutable_value()->add_entries(
90 "chromium.org"); 90 "chromium.org");
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 loop_.message_loop_proxy())); 524 loop_.message_loop_proxy()));
525 store2->SetSigninUsername(PolicyBuilder::kFakeUsername); 525 store2->SetSigninUsername(PolicyBuilder::kFakeUsername);
526 store2->AddObserver(&observer_); 526 store2->AddObserver(&observer_);
527 ExpectError(store2.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR); 527 ExpectError(store2.get(), CloudPolicyStore::STATUS_VALIDATION_ERROR);
528 store2->Load(); 528 store2->Load();
529 RunUntilIdle(); 529 RunUntilIdle();
530 store2->RemoveObserver(&observer_); 530 store2->RemoveObserver(&observer_);
531 } 531 }
532 532
533 } // namespace policy 533 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698