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

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos_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
« no previous file with comments | « no previous file | chrome/browser/policy/test/policy_testserver.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/device_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 ReloadDeviceSettings(); 606 ReloadDeviceSettings();
607 } 607 }
608 608
609 bool ShouldRegisterWithCert() const override { return GetParam(); } 609 bool ShouldRegisterWithCert() const override { return GetParam(); }
610 610
611 const std::unique_ptr<em::DeviceRegisterRequest> GetDeviceRegisterRequest() { 611 const std::unique_ptr<em::DeviceRegisterRequest> GetDeviceRegisterRequest() {
612 auto req = base::MakeUnique<em::DeviceRegisterRequest>(); 612 auto req = base::MakeUnique<em::DeviceRegisterRequest>();
613 if (ShouldRegisterWithCert()) { 613 if (ShouldRegisterWithCert()) {
614 em::CertificateBasedDeviceRegistrationData data; 614 em::CertificateBasedDeviceRegistrationData data;
615 const em::SignedData& signed_request = 615 const em::SignedData& signed_request =
616 register_request_.cert_based_register_request().signed_request(); 616 register_request_.certificate_based_register_request()
617 .signed_request();
617 EXPECT_TRUE(data.ParseFromString(signed_request.data().substr( 618 EXPECT_TRUE(data.ParseFromString(signed_request.data().substr(
618 0, 619 0,
619 signed_request.data().size() - signed_request.extra_data_bytes()))); 620 signed_request.data().size() - signed_request.extra_data_bytes())));
620 EXPECT_EQ(em::CertificateBasedDeviceRegistrationData:: 621 EXPECT_EQ(em::CertificateBasedDeviceRegistrationData::
621 ENTERPRISE_ENROLLMENT_CERTIFICATE, 622 ENTERPRISE_ENROLLMENT_CERTIFICATE,
622 data.certificate_type()); 623 data.certificate_type());
623 req->CopyFrom(data.device_register_request()); 624 req->CopyFrom(data.device_register_request());
624 } else { 625 } else {
625 req->CopyFrom( 626 req->CopyFrom(
626 register_request_.register_request()); 627 register_request_.register_request());
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 DeviceCloudPolicyManagerChromeOSEnrollmentTest, 798 DeviceCloudPolicyManagerChromeOSEnrollmentTest,
798 ::testing::Values(false, true)); 799 ::testing::Values(false, true));
799 800
800 INSTANTIATE_TEST_CASE_P( 801 INSTANTIATE_TEST_CASE_P(
801 Cert, 802 Cert,
802 DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest, 803 DeviceCloudPolicyManagerChromeOSEnrollmentBlankSystemSaltTest,
803 ::testing::Values(false, true)); 804 ::testing::Values(false, true));
804 805
805 } // namespace 806 } // namespace
806 } // namespace policy 807 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/test/policy_testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698