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

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

Issue 2412623003: Rename cert_based_register_request to match server proto. (Closed)
Patch Set: Created 4 years, 2 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 "components/policy/core/common/cloud/cloud_policy_client.h" 5 #include "components/policy/core/common/cloud/cloud_policy_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 data.set_device_certificate(kEnrollmentCertificate); 103 data.set_device_certificate(kEnrollmentCertificate);
104 104
105 em::DeviceRegisterRequest* request = data.mutable_device_register_request(); 105 em::DeviceRegisterRequest* request = data.mutable_device_register_request();
106 request->set_type(em::DeviceRegisterRequest::DEVICE); 106 request->set_type(em::DeviceRegisterRequest::DEVICE);
107 request->set_machine_id(kMachineID); 107 request->set_machine_id(kMachineID);
108 request->set_machine_model(kMachineModel); 108 request->set_machine_model(kMachineModel);
109 request->set_flavor( 109 request->set_flavor(
110 em::DeviceRegisterRequest::FLAVOR_ENROLLMENT_ATTESTATION); 110 em::DeviceRegisterRequest::FLAVOR_ENROLLMENT_ATTESTATION);
111 111
112 em::CertificateBasedDeviceRegisterRequest* cert_based_register_request = 112 em::CertificateBasedDeviceRegisterRequest* cert_based_register_request =
113 cert_based_registration_request_.mutable_cert_based_register_request(); 113 cert_based_registration_request_
114 .mutable_certificate_based_register_request();
114 fake_signing_service_.SignDataSynchronously(data.SerializeAsString(), 115 fake_signing_service_.SignDataSynchronously(data.SerializeAsString(),
115 cert_based_register_request->mutable_signed_request()); 116 cert_based_register_request->mutable_signed_request());
116 117
117 em::PolicyFetchRequest* policy_fetch_request = 118 em::PolicyFetchRequest* policy_fetch_request =
118 policy_request_.mutable_policy_request()->add_request(); 119 policy_request_.mutable_policy_request()->add_request();
119 policy_fetch_request->set_policy_type(dm_protocol::kChromeUserPolicyType); 120 policy_fetch_request->set_policy_type(dm_protocol::kChromeUserPolicyType);
120 policy_fetch_request->set_signature_type(em::PolicyFetchRequest::SHA1_RSA); 121 policy_fetch_request->set_signature_type(em::PolicyFetchRequest::SHA1_RSA);
121 policy_fetch_request->set_verification_key_hash(kPolicyVerificationKeyHash); 122 policy_fetch_request->set_verification_key_hash(kPolicyVerificationKeyHash);
122 policy_response_.mutable_policy_response()->add_response()->set_policy_data( 123 policy_response_.mutable_policy_response()->add_response()->set_policy_data(
123 CreatePolicyData("fake-policy-data")); 124 CreatePolicyData("fake-policy-data"));
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 EXPECT_CALL(callback_observer_, OnCallbackComplete(true)).Times(1); 951 EXPECT_CALL(callback_observer_, OnCallbackComplete(true)).Times(1);
951 952
952 CloudPolicyClient::StatusCallback callback = 953 CloudPolicyClient::StatusCallback callback =
953 base::Bind(&MockStatusCallbackObserver::OnCallbackComplete, 954 base::Bind(&MockStatusCallbackObserver::OnCallbackComplete,
954 base::Unretained(&callback_observer_)); 955 base::Unretained(&callback_observer_));
955 client_->UpdateGcmId(kGcmID, callback); 956 client_->UpdateGcmId(kGcmID, callback);
956 EXPECT_EQ(DM_STATUS_SUCCESS, client_->status()); 957 EXPECT_EQ(DM_STATUS_SUCCESS, client_->status());
957 } 958 }
958 959
959 } // namespace policy 960 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/cloud/cloud_policy_client.cc ('k') | components/policy/proto/device_management_backend.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698