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

Unified Diff: chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc

Issue 2890433002: Revert "Abandon user sign in when policy is retrieved before session started." (Closed)
Patch Set: Created 3 years, 7 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/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
index b3b0daa13987313a404ab8ff18c4f8cb33ebbaaf..3ebd5f393421449263b0faa3ac6bdc10b10f7069 100644
--- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
+++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc
@@ -35,9 +35,6 @@
namespace em = enterprise_management;
-using RetrievePolicyResponseType =
- chromeos::SessionManagerClient::RetrievePolicyResponseType;
-
using testing::AllOf;
using testing::AnyNumber;
using testing::Eq;
@@ -45,7 +42,6 @@ using testing::Mock;
using testing::Property;
using testing::Return;
using testing::SaveArg;
-using testing::SetArgPointee;
using testing::_;
namespace policy {
@@ -115,7 +111,7 @@ class UserCloudPolicyStoreChromeOSTest : public testing::Test {
ASSERT_FALSE(retrieve_callback.is_null());
// Run the callback.
- retrieve_callback.Run(response, RetrievePolicyResponseType::SUCCESS);
+ retrieve_callback.Run(response);
base::RunLoop().RunUntilIdle();
}
@@ -188,8 +184,7 @@ class UserCloudPolicyStoreChromeOSTest : public testing::Test {
// Finish the retrieve callback.
EXPECT_CALL(observer_, OnStoreLoaded(store_.get()));
- retrieve_callback.Run(policy_.GetBlob(),
- RetrievePolicyResponseType::SUCCESS);
+ retrieve_callback.Run(policy_.GetBlob());
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(store_->policy());
EXPECT_EQ(policy_.policy_data().SerializeAsString(),
@@ -498,9 +493,8 @@ TEST_F(UserCloudPolicyStoreChromeOSTest, LoadInvalidSignature) {
TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediately) {
EXPECT_CALL(observer_, OnStoreLoaded(store_.get()));
EXPECT_CALL(session_manager_client_,
- BlockingRetrievePolicyForUser(cryptohome_id_, _))
- .WillOnce(DoAll(SetArgPointee<1>(policy_.GetBlob()),
- Return(RetrievePolicyResponseType::SUCCESS)));
+ BlockingRetrievePolicyForUser(cryptohome_id_))
+ .WillOnce(Return(policy_.GetBlob()));
EXPECT_CALL(cryptohome_client_, BlockingGetSanitizedUsername(cryptohome_id_))
.WillOnce(Return(kSanitizedUsername));
@@ -526,9 +520,8 @@ TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediately) {
TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyNoPolicy) {
EXPECT_CALL(observer_, OnStoreLoaded(store_.get()));
EXPECT_CALL(session_manager_client_,
- BlockingRetrievePolicyForUser(cryptohome_id_, _))
- .WillOnce(DoAll(SetArgPointee<1>(""),
- Return(RetrievePolicyResponseType::SUCCESS)));
+ BlockingRetrievePolicyForUser(cryptohome_id_))
+ .WillOnce(Return(""));
EXPECT_FALSE(store_->policy());
store_->LoadImmediately();
@@ -544,9 +537,8 @@ TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyNoPolicy) {
TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyInvalidBlob) {
EXPECT_CALL(observer_, OnStoreError(store_.get()));
EXPECT_CALL(session_manager_client_,
- BlockingRetrievePolicyForUser(cryptohome_id_, _))
- .WillOnce(DoAll(SetArgPointee<1>("le blob"),
- Return(RetrievePolicyResponseType::SUCCESS)));
+ BlockingRetrievePolicyForUser(cryptohome_id_))
+ .WillOnce(Return("le blob"));
EXPECT_FALSE(store_->policy());
store_->LoadImmediately();
@@ -562,9 +554,8 @@ TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyInvalidBlob) {
TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyDBusFailure) {
EXPECT_CALL(observer_, OnStoreError(store_.get()));
EXPECT_CALL(session_manager_client_,
- BlockingRetrievePolicyForUser(cryptohome_id_, _))
- .WillOnce(DoAll(SetArgPointee<1>(policy_.GetBlob()),
- Return(RetrievePolicyResponseType::SUCCESS)));
+ BlockingRetrievePolicyForUser(cryptohome_id_))
+ .WillOnce(Return(policy_.GetBlob()));
EXPECT_CALL(cryptohome_client_, BlockingGetSanitizedUsername(cryptohome_id_))
.WillOnce(Return(""));
@@ -583,9 +574,8 @@ TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyDBusFailure) {
TEST_F(UserCloudPolicyStoreChromeOSTest, LoadImmediatelyNoUserPolicyKey) {
EXPECT_CALL(observer_, OnStoreError(store_.get()));
EXPECT_CALL(session_manager_client_,
- BlockingRetrievePolicyForUser(cryptohome_id_, _))
- .WillOnce(DoAll(SetArgPointee<1>(policy_.GetBlob()),
- Return(RetrievePolicyResponseType::SUCCESS)));
+ BlockingRetrievePolicyForUser(cryptohome_id_))
+ .WillOnce(Return(policy_.GetBlob()));
EXPECT_CALL(cryptohome_client_, BlockingGetSanitizedUsername(cryptohome_id_))
.WillOnce(Return("wrong@example.com"));

Powered by Google App Engine
This is Rietveld 408576698