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

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

Issue 2453993004: Match server version of DM API proto. (Closed)
Patch Set: Style and comment fixes. Created 4 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 (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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 upload_certificate_response_.mutable_cert_upload_response(); 133 upload_certificate_response_.mutable_cert_upload_response();
134 134
135 upload_status_request_.mutable_device_status_report_request(); 135 upload_status_request_.mutable_device_status_report_request();
136 upload_status_request_.mutable_session_status_report_request(); 136 upload_status_request_.mutable_session_status_report_request();
137 137
138 remote_command_request_.mutable_remote_command_request() 138 remote_command_request_.mutable_remote_command_request()
139 ->set_last_command_unique_id(kLastCommandId); 139 ->set_last_command_unique_id(kLastCommandId);
140 em::RemoteCommandResult* command_result = 140 em::RemoteCommandResult* command_result =
141 remote_command_request_.mutable_remote_command_request() 141 remote_command_request_.mutable_remote_command_request()
142 ->add_command_results(); 142 ->add_command_results();
143 command_result->set_unique_id(kLastCommandId); 143 command_result->set_command_id(kLastCommandId);
144 command_result->set_result( 144 command_result->set_result(
145 em::RemoteCommandResult_ResultType_RESULT_SUCCESS); 145 em::RemoteCommandResult_ResultType_RESULT_SUCCESS);
146 command_result->set_payload(kResultPayload); 146 command_result->set_payload(kResultPayload);
147 command_result->set_timestamp(kTimestamp); 147 command_result->set_timestamp(kTimestamp);
148 148
149 em::RemoteCommand* command = 149 em::RemoteCommand* command =
150 remote_command_response_.mutable_remote_command_response() 150 remote_command_response_.mutable_remote_command_response()
151 ->add_commands(); 151 ->add_commands();
152 command->set_age_of_command(kAgeOfCommand); 152 command->set_age_of_command(kAgeOfCommand);
153 command->set_payload(kPayload); 153 command->set_payload(kPayload);
154 command->set_unique_id(kLastCommandId + 1); 154 command->set_command_id(kLastCommandId + 1);
155 command->set_type(em::RemoteCommand_Type_COMMAND_ECHO_TEST); 155 command->set_type(em::RemoteCommand_Type_COMMAND_ECHO_TEST);
156 156
157 attribute_update_permission_request_. 157 attribute_update_permission_request_.
158 mutable_device_attribute_update_permission_request(); 158 mutable_device_attribute_update_permission_request();
159 attribute_update_permission_response_. 159 attribute_update_permission_response_.
160 mutable_device_attribute_update_permission_response()-> 160 mutable_device_attribute_update_permission_response()->
161 set_result( 161 set_result(
162 em::DeviceAttributeUpdatePermissionResponse_ResultType_ATTRIBUTE_UPD ATE_ALLOWED); 162 em::DeviceAttributeUpdatePermissionResponse_ResultType_ATTRIBUTE_UPD ATE_ALLOWED);
163 163
164 attribute_update_request_.mutable_device_attribute_update_request()-> 164 attribute_update_request_.mutable_device_attribute_update_request()->
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 EXPECT_CALL(callback_observer_, OnCallbackComplete(true)).Times(1); 951 EXPECT_CALL(callback_observer_, OnCallbackComplete(true)).Times(1);
952 952
953 CloudPolicyClient::StatusCallback callback = 953 CloudPolicyClient::StatusCallback callback =
954 base::Bind(&MockStatusCallbackObserver::OnCallbackComplete, 954 base::Bind(&MockStatusCallbackObserver::OnCallbackComplete,
955 base::Unretained(&callback_observer_)); 955 base::Unretained(&callback_observer_));
956 client_->UpdateGcmId(kGcmID, callback); 956 client_->UpdateGcmId(kGcmID, callback);
957 EXPECT_EQ(DM_STATUS_SUCCESS, client_->status()); 957 EXPECT_EQ(DM_STATUS_SUCCESS, client_->status());
958 } 958 }
959 959
960 } // namespace policy 960 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/test/policy_testserver.py ('k') | components/policy/core/common/cloud/cloud_policy_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698