Skip to content

Commit

Permalink
Chromad: Change ERROR_BAD_MACHINE_NAME to ERROR_INVALID_MACHINE_NAME
Browse files Browse the repository at this point in the history
BUG=715459
TEST=existing tests
TBR=achuith@chromium.org

Change-Id: Ib52ef795f5b7cfab49a0d156679653b00c4c8db9
Reviewed-on: https://chromium-review.googlesource.com/512722
Reviewed-by: Roman Sorokin <rsorokin@chromium.org>
Commit-Queue: Roman Sorokin <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#473888}
  • Loading branch information
Roman Sorokin authored and Commit Bot committed May 23, 2017
1 parent dfc8047 commit 795c4f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ void EnrollmentScreenHandler::HandleAdDomainJoin(
"invalidateAd", machine_name, user_name,
static_cast<int>(ActiveDirectoryErrorState::MACHINE_NAME_TOO_LONG));
return;
case authpolicy::ERROR_BAD_MACHINE_NAME:
case authpolicy::ERROR_INVALID_MACHINE_NAME:
CallJS("invalidateAd", machine_name, user_name,
static_cast<int>(ActiveDirectoryErrorState::MACHINE_NAME_INVALID));
return;
Expand Down
2 changes: 1 addition & 1 deletion chromeos/dbus/fake_auth_policy_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void FakeAuthPolicyClient::JoinAdDomain(const std::string& machine_name,
} else if (machine_name.empty() ||
machine_name.find_first_of(kInvalidMachineNameCharacters) !=
std::string::npos) {
error = authpolicy::ERROR_BAD_MACHINE_NAME;
error = authpolicy::ERROR_INVALID_MACHINE_NAME;
} else {
std::vector<std::string> parts = base::SplitString(
user_principal_name, "@", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
Expand Down
6 changes: 3 additions & 3 deletions chromeos/dbus/fake_auth_policy_client_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST_F(FakeAuthPolicyClientTest, JoinAdDomain_ParseMachineName) {
authpolicy_client()->JoinAdDomain(
"", kCorrectUserName, /* password_fd */ -1,
base::Bind([](authpolicy::ErrorType error) {
EXPECT_EQ(authpolicy::ERROR_BAD_MACHINE_NAME, error);
EXPECT_EQ(authpolicy::ERROR_INVALID_MACHINE_NAME, error);
}));
authpolicy_client()->JoinAdDomain(
"too_long_machine_name", kCorrectUserName, /* password_fd */ -1,
Expand All @@ -54,12 +54,12 @@ TEST_F(FakeAuthPolicyClientTest, JoinAdDomain_ParseMachineName) {
authpolicy_client()->JoinAdDomain(
"invalid:name", kCorrectUserName, /* password_fd */ -1,
base::Bind([](authpolicy::ErrorType error) {
EXPECT_EQ(authpolicy::ERROR_BAD_MACHINE_NAME, error);
EXPECT_EQ(authpolicy::ERROR_INVALID_MACHINE_NAME, error);
}));
authpolicy_client()->JoinAdDomain(
">nvalidname", kCorrectUserName, /* password_fd */ -1,
base::Bind([](authpolicy::ErrorType error) {
EXPECT_EQ(authpolicy::ERROR_BAD_MACHINE_NAME, error);
EXPECT_EQ(authpolicy::ERROR_INVALID_MACHINE_NAME, error);
}));

base::RunLoop().RunUntilIdle();
Expand Down

0 comments on commit 795c4f1

Please sign in to comment.