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

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc

Issue 2606773002: Setup Chromad user policy plumbing (Closed)
Patch Set: Rebase Created 3 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void SetUp() override { 64 void SetUp() override {
65 EXPECT_CALL(cryptohome_client_, GetSanitizedUsername(cryptohome_id_, _)) 65 EXPECT_CALL(cryptohome_client_, GetSanitizedUsername(cryptohome_id_, _))
66 .Times(AnyNumber()) 66 .Times(AnyNumber())
67 .WillRepeatedly(SendSanitizedUsername( 67 .WillRepeatedly(SendSanitizedUsername(
68 chromeos::DBUS_METHOD_CALL_SUCCESS, kSanitizedUsername)); 68 chromeos::DBUS_METHOD_CALL_SUCCESS, kSanitizedUsername));
69 69
70 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir()); 70 ASSERT_TRUE(tmp_dir_.CreateUniqueTempDir());
71 store_.reset(new UserCloudPolicyStoreChromeOS( 71 store_.reset(new UserCloudPolicyStoreChromeOS(
72 &cryptohome_client_, &session_manager_client_, loop_.task_runner(), 72 &cryptohome_client_, &session_manager_client_, loop_.task_runner(),
73 account_id_, user_policy_dir())); 73 account_id_, user_policy_dir(), false /* is_active_directory */));
74 store_->AddObserver(&observer_); 74 store_->AddObserver(&observer_);
75 75
76 // Install the initial public key, so that by default the validation of 76 // Install the initial public key, so that by default the validation of
77 // the stored/loaded policy blob succeeds. 77 // the stored/loaded policy blob succeeds.
78 std::string public_key = policy_.GetPublicSigningKeyAsString(); 78 std::string public_key = policy_.GetPublicSigningKeyAsString();
79 ASSERT_FALSE(public_key.empty()); 79 ASSERT_FALSE(public_key.empty());
80 StoreUserPolicyKey(public_key); 80 StoreUserPolicyKey(public_key);
81 81
82 policy_.payload().mutable_homepagelocation()->set_value(kDefaultHomepage); 82 policy_.payload().mutable_homepagelocation()->set_value(kDefaultHomepage);
83 policy_.Build(); 83 policy_.Build();
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 586
587 EXPECT_FALSE(store_->policy()); 587 EXPECT_FALSE(store_->policy());
588 EXPECT_TRUE(store_->policy_map().empty()); 588 EXPECT_TRUE(store_->policy_map().empty());
589 EXPECT_EQ(CloudPolicyStore::STATUS_VALIDATION_ERROR, store_->status()); 589 EXPECT_EQ(CloudPolicyStore::STATUS_VALIDATION_ERROR, store_->status());
590 EXPECT_EQ(std::string(), store_->policy_signature_public_key()); 590 EXPECT_EQ(std::string(), store_->policy_signature_public_key());
591 } 591 }
592 592
593 } // namespace 593 } // namespace
594 594
595 } // namespace policy 595 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698