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

Issue 858303003: Removing FakePolicyWatcher and introducing FakeAsyncPolicyLoader. (Closed)

Created:
5 years, 11 months ago by Łukasz Anforowicz
Modified:
5 years, 11 months ago
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Removing FakePolicyWatcher and introducing FakeAsyncPolicyLoader. Removal of FakePolicyWatcher means that PolicyServiceWatcher is now the only class derived from PolicyWatcher. A next check-in should merge PolicyWatcher and PolicyServiceWatcher into a single class. Testing via FakeAsyncPolicyLoader rather than FakePolicyWatcher means that tests cover more of PolicyServiceWatcher code. I chose to introduce FakeAsyncPolicyLoader, rather than going via an already existing MockConfigurationPolicyProvier, because 1) this way I can cover more of PolicyServiceWatcher code and 2) this simplifies the test code (by a) keeping PolicySchema manipulation within the product code and b) not requiring mocking of IsInitializationComplete and c) being able to directly call into unmodified CreateFromPolicyLoader method in the product code). BUG=368321 Committed: https://crrev.com/56dd1e9481b2a7cdb8fd2067046e452bb765ffa4 Cr-Commit-Position: refs/heads/master@{#312994}

Patch Set 1 #

Total comments: 20

Patch Set 2 : Addressed code review feedback from Mattias. #

Total comments: 6

Patch Set 3 : Tweaked the set of #include-s. #

Total comments: 12

Patch Set 4 : Addressed code review feedback from Sergey. #

Patch Set 5 : Removed fake_async_policy_loader.cc/.h from Android builds. #

Patch Set 6 : Fixed a memory leak in policy_watcher_unittest.cc #

Patch Set 7 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -204 lines) Patch
M components/policy.gypi View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M components/policy/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M components/policy/core/common/async_policy_loader.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/policy/core/common/async_policy_loader.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A components/policy/core/common/fake_async_policy_loader.h View 1 2 3 1 chunk +53 lines, -0 lines 0 comments Download
A components/policy/core/common/fake_async_policy_loader.cc View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
D remoting/host/policy_hack/fake_policy_watcher.h View 1 chunk +0 lines, -31 lines 0 comments Download
D remoting/host/policy_hack/fake_policy_watcher.cc View 1 chunk +0 lines, -35 lines 0 comments Download
A remoting/host/policy_hack/policy_service_watcher.h View 1 2 3 1 chunk +96 lines, -0 lines 0 comments Download
M remoting/host/policy_hack/policy_service_watcher.cc View 1 2 3 6 chunks +9 lines, -77 lines 0 comments Download
M remoting/host/policy_hack/policy_watcher.h View 1 chunk +2 lines, -0 lines 0 comments Download
M remoting/host/policy_hack/policy_watcher_unittest.cc View 1 2 3 4 5 25 chunks +106 lines, -57 lines 0 comments Download
M remoting/remoting_host_srcs.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M remoting/remoting_test.gypi View 1 2 3 4 5 6 2 chunks +1 line, -2 lines 0 comments Download

Messages

Total messages: 20 (5 generated)
Łukasz Anforowicz
Mattias, could you please take a look at this changelist? This is a relatively simple ...
5 years, 11 months ago (2015-01-22 00:12:29 UTC) #2
Mattias Nissler (ping if slow)
Looks pretty good to me already, just a couple minor things / suggestions. https://codereview.chromium.org/858303003/diff/1/components/policy/core/common/fake_async_policy_loader.h File ...
5 years, 11 months ago (2015-01-22 16:05:08 UTC) #3
Łukasz Anforowicz
Mattias - I've addressed your code review feedback. Could you please take another look? Thanks, ...
5 years, 11 months ago (2015-01-22 18:28:06 UTC) #4
Mattias Nissler (ping if slow)
LGTM w/nits https://codereview.chromium.org/858303003/diff/20001/components/policy/core/common/fake_async_policy_loader.h File components/policy/core/common/fake_async_policy_loader.h (right): https://codereview.chromium.org/858303003/diff/20001/components/policy/core/common/fake_async_policy_loader.h#newcode27 components/policy/core/common/fake_async_policy_loader.h:27: scoped_refptr<base::SequencedTaskRunner> task_runner); #include "base/memory/ref_counted.h" https://codereview.chromium.org/858303003/diff/20001/components/policy/core/common/fake_async_policy_loader.h#newcode47 components/policy/core/common/fake_async_policy_loader.h:47: DISALLOW_COPY_AND_ASSIGN(FakeAsyncPolicyLoader); ...
5 years, 11 months ago (2015-01-23 08:27:40 UTC) #5
Łukasz Anforowicz
I've addressed the remaining nits pointed out by Mattias. Thanks. Sergey - could you please ...
5 years, 11 months ago (2015-01-23 17:49:55 UTC) #7
Sergey Ulanov
lgtm https://codereview.chromium.org/858303003/diff/40001/components/policy/core/common/fake_async_policy_loader.h File components/policy/core/common/fake_async_policy_loader.h (right): https://codereview.chromium.org/858303003/diff/40001/components/policy/core/common/fake_async_policy_loader.h#newcode11 components/policy/core/common/fake_async_policy_loader.h:11: #include "base/sequenced_task_runner.h" nit: Don't need this include in ...
5 years, 11 months ago (2015-01-23 18:29:11 UTC) #8
Łukasz Anforowicz
Thanks Sergey. https://codereview.chromium.org/858303003/diff/40001/components/policy/core/common/fake_async_policy_loader.h File components/policy/core/common/fake_async_policy_loader.h (right): https://codereview.chromium.org/858303003/diff/40001/components/policy/core/common/fake_async_policy_loader.h#newcode11 components/policy/core/common/fake_async_policy_loader.h:11: #include "base/sequenced_task_runner.h" On 2015/01/23 18:29:11, Sergey Ulanov ...
5 years, 11 months ago (2015-01-23 19:24:46 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/858303003/60001
5 years, 11 months ago (2015-01-23 19:26:57 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tests_recipe/builds/48169) Try jobs failed on following ...
5 years, 11 months ago (2015-01-23 19:52:56 UTC) #13
Sergey Ulanov
https://codereview.chromium.org/858303003/diff/40001/components/policy/core/common/fake_async_policy_loader.h File components/policy/core/common/fake_async_policy_loader.h (right): https://codereview.chromium.org/858303003/diff/40001/components/policy/core/common/fake_async_policy_loader.h#newcode11 components/policy/core/common/fake_async_policy_loader.h:11: #include "base/sequenced_task_runner.h" On 2015/01/23 19:24:45, lukasza wrote: > On ...
5 years, 11 months ago (2015-01-23 22:24:40 UTC) #14
Łukasz Anforowicz
Mattias, I tweaked components/policy.gypi to make sure that fake_async_policy_loader.cc/.h sources are excluded on Android. I ...
5 years, 11 months ago (2015-01-24 01:02:23 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/858303003/120001
5 years, 11 months ago (2015-01-24 01:20:04 UTC) #17
Łukasz Anforowicz
Fixed a memory leak in policy_watcher_unittest.cc
5 years, 11 months ago (2015-01-24 01:20:06 UTC) #18
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 11 months ago (2015-01-24 02:09:48 UTC) #19
commit-bot: I haz the power
5 years, 11 months ago (2015-01-24 02:10:38 UTC) #20
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/56dd1e9481b2a7cdb8fd2067046e452bb765ffa4
Cr-Commit-Position: refs/heads/master@{#312994}

Powered by Google App Engine
This is Rietveld 408576698