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

Unified Diff: chromeos/dbus/fake_auth_policy_client_unittest.cc

Issue 2835473002: Chromad: Allow offline login. (Closed)
Patch Set: Add TryAuthenticateUser call Created 3 years, 8 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
« no previous file with comments | « chromeos/dbus/fake_auth_policy_client.cc ('k') | chromeos/login/auth/authpolicy_login_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_auth_policy_client_unittest.cc
diff --git a/chromeos/dbus/fake_auth_policy_client_unittest.cc b/chromeos/dbus/fake_auth_policy_client_unittest.cc
index 634255929bd921c7c70980d5610fc7ae42455251..e01977c5abe42ff861998389f80bea576f91abb9 100644
--- a/chromeos/dbus/fake_auth_policy_client_unittest.cc
+++ b/chromeos/dbus/fake_auth_policy_client_unittest.cc
@@ -15,12 +15,13 @@ namespace {
const char kCorrectMachineName[] = "machine_name";
const char kCorrectUserName[] = "user@realm.com";
+const char kObjectGUID[] = "user-object-guid";
} // namespace
class FakeAuthPolicyClientTest : public ::testing::Test {
public:
- FakeAuthPolicyClientTest(){};
+ FakeAuthPolicyClientTest() {}
protected:
FakeAuthPolicyClient* authpolicy_client() { return &client_; }
@@ -101,6 +102,20 @@ TEST_F(FakeAuthPolicyClientTest, JoinAdDomain_ParseUPN) {
base::RunLoop().RunUntilIdle();
}
+// Test AuthenticateUser.
+TEST_F(FakeAuthPolicyClientTest, AuthenticateUser_ByObjectGUID) {
+ authpolicy_client()->set_started(true);
+ // Check that objectGUID do not change.
+ authpolicy_client()->AuthenticateUser(
+ kCorrectUserName, kObjectGUID, /* password_fd */ -1,
+ base::Bind(
+ [](authpolicy::ErrorType error,
+ const authpolicy::ActiveDirectoryAccountData& account_data) {
+ EXPECT_EQ(authpolicy::ERROR_NONE, error);
+ EXPECT_EQ(kObjectGUID, account_data.account_id());
+ }));
+}
+
// Tests calls to not started authpolicyd fails.
TEST_F(FakeAuthPolicyClientTest, NotStartedAuthPolicyService) {
authpolicy_client()->JoinAdDomain(
@@ -109,7 +124,7 @@ TEST_F(FakeAuthPolicyClientTest, NotStartedAuthPolicyService) {
EXPECT_EQ(authpolicy::ERROR_DBUS_FAILURE, error);
}));
authpolicy_client()->AuthenticateUser(
- kCorrectUserName, /* password_fd */ -1,
+ kCorrectUserName, std::string() /* object_guid */, /* password_fd */ -1,
base::Bind([](authpolicy::ErrorType error,
const authpolicy::ActiveDirectoryAccountData&) {
EXPECT_EQ(authpolicy::ERROR_DBUS_FAILURE, error);
« no previous file with comments | « chromeos/dbus/fake_auth_policy_client.cc ('k') | chromeos/login/auth/authpolicy_login_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698