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

Issue 2531063002: Implement FakeAuthPolicyClient::RefreshDevicePolicy() (Closed)

Created:
4 years ago by Thiemo Nagel
Modified:
3 years, 4 months ago
Reviewers:
achuithb, brettw
CC:
chromium-reviews, hashimoto+watch_chromium.org, oshima+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement FakeAuthPolicyClient::RefreshDevicePolicy() To allow testing of Active Directory device policy with a fake D-Bus client, simulate the combined actions of authpolicyd and session manager by writing a minimal PolicyFetchResponse to stub_device_policy. BUG=667780 Committed: https://crrev.com/020311f0c2abd317c7df310cd7aa9829dabe781c Cr-Commit-Position: refs/heads/master@{#435706}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Write file on task runner #

Patch Set 3 : Inject a PostTaskAndReply function #

Patch Set 4 : Fix compilation errors #

Patch Set 5 : Rebase #

Patch Set 6 : Use base::PostTaskAndReplyWithResult() #

Patch Set 7 : Polish #

Total comments: 17

Patch Set 8 : Address Achuith's comments #

Total comments: 8

Patch Set 9 : More simplifications following Achuith's comments #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -5 lines) Patch
M chromeos/BUILD.gn View 1 chunk +1 line, -0 lines 1 comment Download
M chromeos/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chromeos/dbus/fake_auth_policy_client.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M chromeos/dbus/fake_auth_policy_client.cc View 1 2 3 4 5 6 7 8 2 chunks +56 lines, -3 lines 2 comments Download

Dependent Patchsets:

Messages

Total messages: 54 (34 generated)
Thiemo Nagel
Hi Achuith, could you please take a look? Thank you, Thiemo
4 years ago (2016-11-25 14:14:13 UTC) #5
Thiemo Nagel
https://codereview.chromium.org/2531063002/diff/20001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/20001/chromeos/dbus/fake_auth_policy_client.cc#newcode54 chromeos/dbus/fake_auth_policy_client.cc:54: base::ThreadRestrictions::ScopedAllowIO permit_io_within_current_scope; > ** Presubmit ERRORS ** > Banned ...
4 years ago (2016-11-25 15:07:03 UTC) #8
achuithb
https://codereview.chromium.org/2531063002/diff/20001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/20001/chromeos/dbus/fake_auth_policy_client.cc#newcode51 chromeos/dbus/fake_auth_policy_client.cc:51: base::FilePath device_policy_path = nit const https://codereview.chromium.org/2531063002/diff/20001/chromeos/dbus/fake_auth_policy_client.cc#newcode54 chromeos/dbus/fake_auth_policy_client.cc:54: base::ThreadRestrictions::ScopedAllowIO permit_io_within_current_scope; ...
4 years ago (2016-11-28 09:05:52 UTC) #9
Thiemo Nagel
> Yeah, pretty sure you can't use this. Isn't there a blocking > thread pool ...
4 years ago (2016-11-28 19:18:40 UTC) #12
achuithb
On 2016/11/28 19:18:40, Thiemo Nagel (slow) wrote: > > Yeah, pretty sure you can't use ...
4 years ago (2016-11-28 19:35:21 UTC) #13
Thiemo Nagel
> Can't we add content to DEPS? I'm somewhat reluctant about that. > I think ...
4 years ago (2016-11-29 10:46:48 UTC) #18
Thiemo Nagel
Hold the reviews - I think I have a better idea...
4 years ago (2016-11-30 17:01:28 UTC) #25
achuithb
On 2016/11/30 17:01:28, Thiemo Nagel (slow) wrote: > Hold the reviews - I think I ...
4 years ago (2016-11-30 19:04:17 UTC) #28
Thiemo Nagel
Hi Achuith, could you please take another look now? I've taken a different approach by ...
4 years ago (2016-11-30 19:11:59 UTC) #31
achuithb
https://codereview.chromium.org/2531063002/diff/140001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/140001/chromeos/dbus/fake_auth_policy_client.cc#newcode47 chromeos/dbus/fake_auth_policy_client.cc:47: int FakeAuthPolicyClient::WriteDevicePolicyFile() { move to anonymous namespace. I think ...
4 years ago (2016-11-30 19:23:34 UTC) #32
Thiemo Nagel
Thank you! Could you please take another look? https://codereview.chromium.org/2531063002/diff/140001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/140001/chromeos/dbus/fake_auth_policy_client.cc#newcode47 chromeos/dbus/fake_auth_policy_client.cc:47: int ...
4 years ago (2016-11-30 20:06:37 UTC) #35
achuithb
Sorry for another round of this. https://codereview.chromium.org/2531063002/diff/140001/chromeos/dbus/fake_auth_policy_client.h File chromeos/dbus/fake_auth_policy_client.h (right): https://codereview.chromium.org/2531063002/diff/140001/chromeos/dbus/fake_auth_policy_client.h#newcode38 chromeos/dbus/fake_auth_policy_client.h:38: base::WeakPtrFactory<FakeAuthPolicyClient> weak_factory_{this}; On ...
4 years ago (2016-11-30 20:22:50 UTC) #36
achuithb
https://codereview.chromium.org/2531063002/diff/160001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/160001/chromeos/dbus/fake_auth_policy_client.cc#newcode79 chromeos/dbus/fake_auth_policy_client.cc:79: base::Bind(&FakeAuthPolicyClient::OnDevicePolicyFileWritten, On 2016/11/30 20:22:50, achuithb wrote: > Curious: do ...
4 years ago (2016-11-30 20:26:18 UTC) #37
Thiemo Nagel
> Sorry for another round of this. I guess I deserve it for not writing ...
4 years ago (2016-12-01 09:52:04 UTC) #40
achuithb
lgtm! Thanks for bearing with all the rounds of feedback. https://codereview.chromium.org/2531063002/diff/160001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/160001/chromeos/dbus/fake_auth_policy_client.cc#newcode79 ...
4 years ago (2016-12-01 20:26:14 UTC) #45
Thiemo Nagel
Thanks a lot for the review! https://codereview.chromium.org/2531063002/diff/180001/chromeos/dbus/fake_auth_policy_client.cc File chromeos/dbus/fake_auth_policy_client.cc (right): https://codereview.chromium.org/2531063002/diff/180001/chromeos/dbus/fake_auth_policy_client.cc#newcode50 chromeos/dbus/fake_auth_policy_client.cc:50: return bytes_written == ...
4 years ago (2016-12-01 20:47:21 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2531063002/180001
4 years ago (2016-12-01 20:47:59 UTC) #48
commit-bot: I haz the power
Committed patchset #9 (id:180001)
4 years ago (2016-12-01 20:54:15 UTC) #50
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/020311f0c2abd317c7df310cd7aa9829dabe781c Cr-Commit-Position: refs/heads/master@{#435706}
4 years ago (2016-12-01 20:56:06 UTC) #52
brettw
3 years, 4 months ago (2017-08-24 23:54:47 UTC) #54
Message was sent while issue was closed.
https://codereview.chromium.org/2531063002/diff/180001/chromeos/BUILD.gn
File chromeos/BUILD.gn (right):

https://codereview.chromium.org/2531063002/diff/180001/chromeos/BUILD.gn#newc...
chromeos/BUILD.gn:33: "//chrome/browser/chromeos:device_policy_proto",
Hi, this is a layering violation as //chromeos is as a lower layer than
//chrome.

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=758767 to track
this. I would like to get this fixed soon before it becomes even harder to fix.

Thanks!

Powered by Google App Engine
This is Rietveld 408576698