UpdateManager: Move logic from UpdateCanStart to UpdateCheckAllowed.
The following should be part of the policy that is consulted before
performing an update check:
1) Whether updates are disabled by device policy.
2) Whether a specific target channel is dictated by the device policy.
This CL moves it from UpdateCanStart into UpdateCheckAllowed.
Another change is renaming the output construct of UpdateCanStart into
'UpdateDownloadParams'; this is in line with the naming of the output
struct of UpdateCheckAllowed, and reflects the fact that it contains
information regarding the download of an update, to be used by the
caller.
BUG=chromium:388386
TEST=Unit tests.
Change-Id: I0631a4464800db77807d7da9a2a2c256b519c5c3
Reviewed-on: https://chromium-review.googlesource.com/205728
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/update_manager/update_manager_unittest.cc b/update_manager/update_manager_unittest.cc
index 640fbb3..4a15e93 100644
--- a/update_manager/update_manager_unittest.cc
+++ b/update_manager/update_manager_unittest.cc
@@ -113,7 +113,7 @@
TimeDelta::FromSeconds(15), TimeDelta::FromSeconds(60),
4, 2, 8
};
- UpdateCanStartResult result;
+ UpdateDownloadParams result;
EXPECT_EQ(EvalStatus::kSucceeded,
umut_->PolicyRequest(&Policy::UpdateCanStart, &result, true,
update_state));