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

Side by Side Diff: chromeos/dbus/fake_auth_policy_client.cc

Issue 2737733003: Add Active Directory login UI tests (Closed)
Patch Set: Rebase Created 3 years, 9 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 | « chromeos/dbus/fake_auth_policy_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chromeos/dbus/fake_auth_policy_client.h" 5 #include "chromeos/dbus/fake_auth_policy_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void FakeAuthPolicyClient::AuthenticateUser( 106 void FakeAuthPolicyClient::AuthenticateUser(
107 const std::string& user_principal_name, 107 const std::string& user_principal_name,
108 int password_fd, 108 int password_fd,
109 const AuthCallback& callback) { 109 const AuthCallback& callback) {
110 authpolicy::ActiveDirectoryAccountData account_data; 110 authpolicy::ActiveDirectoryAccountData account_data;
111 if (!started_) { 111 if (!started_) {
112 LOG(ERROR) << "authpolicyd not started"; 112 LOG(ERROR) << "authpolicyd not started";
113 callback.Run(authpolicy::ERROR_DBUS_FAILURE, account_data); 113 callback.Run(authpolicy::ERROR_DBUS_FAILURE, account_data);
114 return; 114 return;
115 } 115 }
116 account_data.set_account_id(base::MD5String(user_principal_name)); 116 if (auth_error_ == authpolicy::ERROR_NONE)
117 callback.Run(authpolicy::ERROR_NONE, account_data); 117 account_data.set_account_id(base::MD5String(user_principal_name));
118 callback.Run(auth_error_, account_data);
118 } 119 }
119 120
120 void FakeAuthPolicyClient::RefreshDevicePolicy( 121 void FakeAuthPolicyClient::RefreshDevicePolicy(
121 const RefreshPolicyCallback& callback) { 122 const RefreshPolicyCallback& callback) {
122 if (!started_) { 123 if (!started_) {
123 LOG(ERROR) << "authpolicyd not started"; 124 LOG(ERROR) << "authpolicyd not started";
124 callback.Run(false); 125 callback.Run(false);
125 return; 126 return;
126 } 127 }
127 base::FilePath policy_path; 128 base::FilePath policy_path;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 .WithShutdownBehavior( 177 .WithShutdownBehavior(
177 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) 178 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
178 .WithPriority(base::TaskPriority::BACKGROUND) 179 .WithPriority(base::TaskPriority::BACKGROUND)
179 .MayBlock(), 180 .MayBlock(),
180 base::Bind(&WritePolicyFile, policy_path, payload, 181 base::Bind(&WritePolicyFile, policy_path, payload,
181 "google/chromeos/user"), 182 "google/chromeos/user"),
182 callback); 183 callback);
183 } 184 }
184 185
185 } // namespace chromeos 186 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_auth_policy_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698