metrics_reporter_omaha_unittest.cc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. //
  2. // Copyright (C) 2017 The Android Open Source Project
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. #include "update_engine/metrics_reporter_omaha.h"
  17. #include <memory>
  18. #include <string>
  19. #include <base/time/time.h>
  20. #include <gmock/gmock.h>
  21. #include <gtest/gtest.h>
  22. #include <metrics/metrics_library_mock.h>
  23. #include "update_engine/common/fake_clock.h"
  24. #include "update_engine/common/fake_prefs.h"
  25. #include "update_engine/fake_system_state.h"
  26. using base::TimeDelta;
  27. using testing::_;
  28. using testing::AnyNumber;
  29. using testing::Return;
  30. namespace chromeos_update_engine {
  31. class MetricsReporterOmahaTest : public ::testing::Test {
  32. protected:
  33. MetricsReporterOmahaTest() = default;
  34. // Reset the metrics_lib_ to a mock library.
  35. void SetUp() override {
  36. mock_metrics_lib_ = new testing::NiceMock<MetricsLibraryMock>();
  37. reporter_.metrics_lib_.reset(mock_metrics_lib_);
  38. }
  39. testing::NiceMock<MetricsLibraryMock>* mock_metrics_lib_;
  40. MetricsReporterOmaha reporter_;
  41. };
  42. TEST_F(MetricsReporterOmahaTest, ReportDailyMetrics) {
  43. TimeDelta age = TimeDelta::FromDays(10);
  44. EXPECT_CALL(*mock_metrics_lib_,
  45. SendToUMA(metrics::kMetricDailyOSAgeDays, _, _, _, _))
  46. .Times(1);
  47. reporter_.ReportDailyMetrics(age);
  48. }
  49. TEST_F(MetricsReporterOmahaTest, ReportUpdateCheckMetrics) {
  50. FakeSystemState fake_system_state;
  51. FakeClock fake_clock;
  52. FakePrefs fake_prefs;
  53. // We need to execute the report twice to test the time since last report.
  54. fake_system_state.set_clock(&fake_clock);
  55. fake_system_state.set_prefs(&fake_prefs);
  56. fake_clock.SetWallclockTime(base::Time::FromInternalValue(1000000));
  57. fake_clock.SetMonotonicTime(base::Time::FromInternalValue(1000000));
  58. metrics::CheckResult result = metrics::CheckResult::kUpdateAvailable;
  59. metrics::CheckReaction reaction = metrics::CheckReaction::kIgnored;
  60. metrics::DownloadErrorCode error_code =
  61. metrics::DownloadErrorCode::kHttpStatus200;
  62. EXPECT_CALL(
  63. *mock_metrics_lib_,
  64. SendEnumToUMA(metrics::kMetricCheckResult, static_cast<int>(result), _))
  65. .Times(2);
  66. EXPECT_CALL(*mock_metrics_lib_,
  67. SendEnumToUMA(
  68. metrics::kMetricCheckReaction, static_cast<int>(reaction), _))
  69. .Times(2);
  70. EXPECT_CALL(*mock_metrics_lib_,
  71. SendSparseToUMA(metrics::kMetricCheckDownloadErrorCode,
  72. static_cast<int>(error_code)))
  73. .Times(2);
  74. // Not pinned nor rollback
  75. EXPECT_CALL(*mock_metrics_lib_,
  76. SendSparseToUMA(metrics::kMetricCheckTargetVersion, _))
  77. .Times(0);
  78. EXPECT_CALL(*mock_metrics_lib_,
  79. SendSparseToUMA(metrics::kMetricCheckRollbackTargetVersion, _))
  80. .Times(0);
  81. EXPECT_CALL(
  82. *mock_metrics_lib_,
  83. SendToUMA(metrics::kMetricCheckTimeSinceLastCheckMinutes, 1, _, _, _))
  84. .Times(1);
  85. EXPECT_CALL(
  86. *mock_metrics_lib_,
  87. SendToUMA(
  88. metrics::kMetricCheckTimeSinceLastCheckUptimeMinutes, 1, _, _, _))
  89. .Times(1);
  90. reporter_.ReportUpdateCheckMetrics(
  91. &fake_system_state, result, reaction, error_code);
  92. // Advance the clock by 1 minute and report the same metrics again.
  93. fake_clock.SetWallclockTime(base::Time::FromInternalValue(61000000));
  94. fake_clock.SetMonotonicTime(base::Time::FromInternalValue(61000000));
  95. // Allow rollback
  96. reporter_.ReportUpdateCheckMetrics(
  97. &fake_system_state, result, reaction, error_code);
  98. }
  99. TEST_F(MetricsReporterOmahaTest, ReportUpdateCheckMetricsPinned) {
  100. FakeSystemState fake_system_state;
  101. OmahaRequestParams params(&fake_system_state);
  102. params.set_target_version_prefix("10575.");
  103. params.set_rollback_allowed(false);
  104. fake_system_state.set_request_params(&params);
  105. metrics::CheckResult result = metrics::CheckResult::kUpdateAvailable;
  106. metrics::CheckReaction reaction = metrics::CheckReaction::kIgnored;
  107. metrics::DownloadErrorCode error_code =
  108. metrics::DownloadErrorCode::kHttpStatus200;
  109. EXPECT_CALL(*mock_metrics_lib_,
  110. SendSparseToUMA(metrics::kMetricCheckDownloadErrorCode, _));
  111. // Target version set, but not a rollback.
  112. EXPECT_CALL(*mock_metrics_lib_,
  113. SendSparseToUMA(metrics::kMetricCheckTargetVersion, 10575))
  114. .Times(1);
  115. EXPECT_CALL(*mock_metrics_lib_,
  116. SendSparseToUMA(metrics::kMetricCheckRollbackTargetVersion, _))
  117. .Times(0);
  118. reporter_.ReportUpdateCheckMetrics(
  119. &fake_system_state, result, reaction, error_code);
  120. }
  121. TEST_F(MetricsReporterOmahaTest, ReportUpdateCheckMetricsRollback) {
  122. FakeSystemState fake_system_state;
  123. OmahaRequestParams params(&fake_system_state);
  124. params.set_target_version_prefix("10575.");
  125. params.set_rollback_allowed(true);
  126. fake_system_state.set_request_params(&params);
  127. metrics::CheckResult result = metrics::CheckResult::kUpdateAvailable;
  128. metrics::CheckReaction reaction = metrics::CheckReaction::kIgnored;
  129. metrics::DownloadErrorCode error_code =
  130. metrics::DownloadErrorCode::kHttpStatus200;
  131. EXPECT_CALL(*mock_metrics_lib_,
  132. SendSparseToUMA(metrics::kMetricCheckDownloadErrorCode, _));
  133. // Rollback.
  134. EXPECT_CALL(*mock_metrics_lib_,
  135. SendSparseToUMA(metrics::kMetricCheckTargetVersion, 10575))
  136. .Times(1);
  137. EXPECT_CALL(
  138. *mock_metrics_lib_,
  139. SendSparseToUMA(metrics::kMetricCheckRollbackTargetVersion, 10575))
  140. .Times(1);
  141. reporter_.ReportUpdateCheckMetrics(
  142. &fake_system_state, result, reaction, error_code);
  143. }
  144. TEST_F(MetricsReporterOmahaTest,
  145. ReportAbnormallyTerminatedUpdateAttemptMetrics) {
  146. EXPECT_CALL(*mock_metrics_lib_,
  147. SendEnumToUMA(metrics::kMetricAttemptResult,
  148. static_cast<int>(
  149. metrics::AttemptResult::kAbnormalTermination),
  150. _))
  151. .Times(1);
  152. reporter_.ReportAbnormallyTerminatedUpdateAttemptMetrics();
  153. }
  154. TEST_F(MetricsReporterOmahaTest, ReportUpdateAttemptMetrics) {
  155. FakeSystemState fake_system_state;
  156. FakeClock fake_clock;
  157. FakePrefs fake_prefs;
  158. fake_system_state.set_clock(&fake_clock);
  159. fake_system_state.set_prefs(&fake_prefs);
  160. fake_clock.SetWallclockTime(base::Time::FromInternalValue(1000000));
  161. fake_clock.SetMonotonicTime(base::Time::FromInternalValue(1000000));
  162. int attempt_number = 1;
  163. PayloadType payload_type = kPayloadTypeFull;
  164. TimeDelta duration = TimeDelta::FromMinutes(1000);
  165. TimeDelta duration_uptime = TimeDelta::FromMinutes(1000);
  166. int64_t payload_size = 100 * kNumBytesInOneMiB;
  167. metrics::AttemptResult attempt_result =
  168. metrics::AttemptResult::kInternalError;
  169. ErrorCode internal_error_code = ErrorCode::kDownloadInvalidMetadataSignature;
  170. EXPECT_CALL(*mock_metrics_lib_,
  171. SendToUMA(metrics::kMetricAttemptNumber, attempt_number, _, _, _))
  172. .Times(2);
  173. EXPECT_CALL(*mock_metrics_lib_,
  174. SendEnumToUMA(metrics::kMetricAttemptPayloadType,
  175. static_cast<int>(payload_type),
  176. _))
  177. .Times(2);
  178. EXPECT_CALL(*mock_metrics_lib_,
  179. SendToUMA(metrics::kMetricAttemptDurationMinutes,
  180. duration.InMinutes(),
  181. _,
  182. _,
  183. _))
  184. .Times(2);
  185. EXPECT_CALL(*mock_metrics_lib_,
  186. SendToUMA(metrics::kMetricAttemptDurationUptimeMinutes,
  187. duration_uptime.InMinutes(),
  188. _,
  189. _,
  190. _))
  191. .Times(2);
  192. // Check the report of attempt result.
  193. EXPECT_CALL(
  194. *mock_metrics_lib_,
  195. SendEnumToUMA(
  196. metrics::kMetricAttemptResult, static_cast<int>(attempt_result), _))
  197. .Times(2);
  198. EXPECT_CALL(*mock_metrics_lib_,
  199. SendEnumToUMA(metrics::kMetricAttemptInternalErrorCode,
  200. static_cast<int>(internal_error_code),
  201. _))
  202. .Times(2);
  203. EXPECT_CALL(*mock_metrics_lib_,
  204. SendToUMA(metrics::kMetricAttemptPayloadSizeMiB, 100, _, _, _))
  205. .Times(2);
  206. // Check the duration between two reports.
  207. EXPECT_CALL(
  208. *mock_metrics_lib_,
  209. SendToUMA(metrics::kMetricAttemptTimeSinceLastAttemptMinutes, 1, _, _, _))
  210. .Times(1);
  211. EXPECT_CALL(
  212. *mock_metrics_lib_,
  213. SendToUMA(
  214. metrics::kMetricAttemptTimeSinceLastAttemptUptimeMinutes, 1, _, _, _))
  215. .Times(1);
  216. reporter_.ReportUpdateAttemptMetrics(&fake_system_state,
  217. attempt_number,
  218. payload_type,
  219. duration,
  220. duration_uptime,
  221. payload_size,
  222. attempt_result,
  223. internal_error_code);
  224. // Advance the clock by 1 minute and report the same metrics again.
  225. fake_clock.SetWallclockTime(base::Time::FromInternalValue(61000000));
  226. fake_clock.SetMonotonicTime(base::Time::FromInternalValue(61000000));
  227. reporter_.ReportUpdateAttemptMetrics(&fake_system_state,
  228. attempt_number,
  229. payload_type,
  230. duration,
  231. duration_uptime,
  232. payload_size,
  233. attempt_result,
  234. internal_error_code);
  235. }
  236. TEST_F(MetricsReporterOmahaTest, ReportUpdateAttemptDownloadMetrics) {
  237. int64_t payload_bytes_downloaded = 200 * kNumBytesInOneMiB;
  238. int64_t payload_download_speed_bps = 100 * 1000;
  239. DownloadSource download_source = kDownloadSourceHttpServer;
  240. metrics::DownloadErrorCode payload_download_error_code =
  241. metrics::DownloadErrorCode::kDownloadError;
  242. metrics::ConnectionType connection_type = metrics::ConnectionType::kCellular;
  243. EXPECT_CALL(
  244. *mock_metrics_lib_,
  245. SendToUMA(metrics::kMetricAttemptPayloadBytesDownloadedMiB, 200, _, _, _))
  246. .Times(1);
  247. EXPECT_CALL(
  248. *mock_metrics_lib_,
  249. SendToUMA(metrics::kMetricAttemptPayloadDownloadSpeedKBps, 100, _, _, _))
  250. .Times(1);
  251. EXPECT_CALL(*mock_metrics_lib_,
  252. SendEnumToUMA(metrics::kMetricAttemptDownloadSource,
  253. static_cast<int>(download_source),
  254. _))
  255. .Times(1);
  256. EXPECT_CALL(*mock_metrics_lib_,
  257. SendSparseToUMA(metrics::kMetricAttemptDownloadErrorCode,
  258. static_cast<int>(payload_download_error_code)))
  259. .Times(1);
  260. EXPECT_CALL(*mock_metrics_lib_,
  261. SendEnumToUMA(metrics::kMetricAttemptConnectionType,
  262. static_cast<int>(connection_type),
  263. _))
  264. .Times(1);
  265. reporter_.ReportUpdateAttemptDownloadMetrics(payload_bytes_downloaded,
  266. payload_download_speed_bps,
  267. download_source,
  268. payload_download_error_code,
  269. connection_type);
  270. }
  271. TEST_F(MetricsReporterOmahaTest, ReportSuccessfulUpdateMetrics) {
  272. int attempt_count = 3;
  273. int updates_abandoned_count = 2;
  274. PayloadType payload_type = kPayloadTypeDelta;
  275. int64_t payload_size = 200 * kNumBytesInOneMiB;
  276. int64_t num_bytes_downloaded[kNumDownloadSources] = {};
  277. // 200MiB payload downloaded from HttpsServer.
  278. num_bytes_downloaded[0] = 200 * kNumBytesInOneMiB;
  279. int download_overhead_percentage = 20;
  280. TimeDelta total_duration = TimeDelta::FromMinutes(30);
  281. TimeDelta total_duration_uptime = TimeDelta::FromMinutes(20);
  282. int reboot_count = 2;
  283. int url_switch_count = 2;
  284. EXPECT_CALL(
  285. *mock_metrics_lib_,
  286. SendToUMA(metrics::kMetricSuccessfulUpdatePayloadSizeMiB, 200, _, _, _))
  287. .Times(1);
  288. // Check the report to both BytesDownloadedMiBHttpsServer and
  289. // BytesDownloadedMiB
  290. std::string DownloadedMiBMetric =
  291. metrics::kMetricSuccessfulUpdateBytesDownloadedMiB;
  292. DownloadedMiBMetric += "HttpsServer";
  293. EXPECT_CALL(*mock_metrics_lib_, SendToUMA(DownloadedMiBMetric, 200, _, _, _))
  294. .Times(1);
  295. EXPECT_CALL(
  296. *mock_metrics_lib_,
  297. SendToUMA(
  298. metrics::kMetricSuccessfulUpdateBytesDownloadedMiB, 200, _, _, _))
  299. .Times(1);
  300. EXPECT_CALL(
  301. *mock_metrics_lib_,
  302. SendToUMA(
  303. metrics::kMetricSuccessfulUpdateDownloadSourcesUsed, 1, _, _, _))
  304. .Times(1);
  305. EXPECT_CALL(
  306. *mock_metrics_lib_,
  307. SendToUMA(metrics::kMetricSuccessfulUpdateDownloadOverheadPercentage,
  308. 20,
  309. _,
  310. _,
  311. _));
  312. EXPECT_CALL(*mock_metrics_lib_,
  313. SendToUMA(metrics::kMetricSuccessfulUpdateUrlSwitchCount,
  314. url_switch_count,
  315. _,
  316. _,
  317. _))
  318. .Times(1);
  319. EXPECT_CALL(
  320. *mock_metrics_lib_,
  321. SendToUMA(
  322. metrics::kMetricSuccessfulUpdateTotalDurationMinutes, 30, _, _, _))
  323. .Times(1);
  324. EXPECT_CALL(
  325. *mock_metrics_lib_,
  326. SendToUMA(metrics::kMetricSuccessfulUpdateTotalDurationUptimeMinutes,
  327. 20,
  328. _,
  329. _,
  330. _))
  331. .Times(1);
  332. EXPECT_CALL(
  333. *mock_metrics_lib_,
  334. SendToUMA(
  335. metrics::kMetricSuccessfulUpdateRebootCount, reboot_count, _, _, _))
  336. .Times(1);
  337. EXPECT_CALL(*mock_metrics_lib_,
  338. SendEnumToUMA(
  339. metrics::kMetricSuccessfulUpdatePayloadType, payload_type, _))
  340. .Times(1);
  341. EXPECT_CALL(
  342. *mock_metrics_lib_,
  343. SendToUMA(
  344. metrics::kMetricSuccessfulUpdateAttemptCount, attempt_count, _, _, _))
  345. .Times(1);
  346. EXPECT_CALL(*mock_metrics_lib_,
  347. SendToUMA(metrics::kMetricSuccessfulUpdateUpdatesAbandonedCount,
  348. updates_abandoned_count,
  349. _,
  350. _,
  351. _))
  352. .Times(1);
  353. reporter_.ReportSuccessfulUpdateMetrics(attempt_count,
  354. updates_abandoned_count,
  355. payload_type,
  356. payload_size,
  357. num_bytes_downloaded,
  358. download_overhead_percentage,
  359. total_duration,
  360. total_duration_uptime,
  361. reboot_count,
  362. url_switch_count);
  363. }
  364. TEST_F(MetricsReporterOmahaTest, ReportRollbackMetrics) {
  365. metrics::RollbackResult result = metrics::RollbackResult::kSuccess;
  366. EXPECT_CALL(*mock_metrics_lib_,
  367. SendEnumToUMA(
  368. metrics::kMetricRollbackResult, static_cast<int>(result), _))
  369. .Times(1);
  370. reporter_.ReportRollbackMetrics(result);
  371. }
  372. TEST_F(MetricsReporterOmahaTest, ReportEnterpriseRollbackMetrics) {
  373. EXPECT_CALL(*mock_metrics_lib_,
  374. SendSparseToUMA(metrics::kMetricEnterpriseRollbackSuccess, 10575))
  375. .Times(1);
  376. EXPECT_CALL(*mock_metrics_lib_,
  377. SendSparseToUMA(metrics::kMetricEnterpriseRollbackFailure, 10323))
  378. .Times(1);
  379. reporter_.ReportEnterpriseRollbackMetrics(/*success=*/true, "10575.39.2");
  380. reporter_.ReportEnterpriseRollbackMetrics(/*success=*/false, "10323.67.7");
  381. }
  382. TEST_F(MetricsReporterOmahaTest, ReportCertificateCheckMetrics) {
  383. ServerToCheck server_to_check = ServerToCheck::kUpdate;
  384. CertificateCheckResult result = CertificateCheckResult::kValid;
  385. EXPECT_CALL(*mock_metrics_lib_,
  386. SendEnumToUMA(metrics::kMetricCertificateCheckUpdateCheck,
  387. static_cast<int>(result),
  388. _))
  389. .Times(1);
  390. reporter_.ReportCertificateCheckMetrics(server_to_check, result);
  391. }
  392. TEST_F(MetricsReporterOmahaTest, ReportFailedUpdateCount) {
  393. int target_attempt = 3;
  394. EXPECT_CALL(
  395. *mock_metrics_lib_,
  396. SendToUMA(metrics::kMetricFailedUpdateCount, target_attempt, _, _, _))
  397. .Times(1);
  398. reporter_.ReportFailedUpdateCount(target_attempt);
  399. }
  400. TEST_F(MetricsReporterOmahaTest, ReportTimeToReboot) {
  401. int time_to_reboot_minutes = 1000;
  402. EXPECT_CALL(
  403. *mock_metrics_lib_,
  404. SendToUMA(
  405. metrics::kMetricTimeToRebootMinutes, time_to_reboot_minutes, _, _, _))
  406. .Times(1);
  407. reporter_.ReportTimeToReboot(time_to_reboot_minutes);
  408. }
  409. TEST_F(MetricsReporterOmahaTest, ReportInstallDateProvisioningSource) {
  410. int source = 2;
  411. int max = 5;
  412. EXPECT_CALL(
  413. *mock_metrics_lib_,
  414. SendEnumToUMA(metrics::kMetricInstallDateProvisioningSource, source, max))
  415. .Times(1);
  416. reporter_.ReportInstallDateProvisioningSource(source, max);
  417. }
  418. TEST_F(MetricsReporterOmahaTest, ReportKeyVersionMetrics) {
  419. int kernel_min_version = 0x00040002;
  420. int kernel_max_rollforward_version = 0xfffffffe;
  421. bool kernel_max_rollforward_success = true;
  422. EXPECT_CALL(
  423. *mock_metrics_lib_,
  424. SendSparseToUMA(metrics::kMetricKernelMinVersion, kernel_min_version))
  425. .Times(1);
  426. EXPECT_CALL(*mock_metrics_lib_,
  427. SendSparseToUMA(metrics::kMetricKernelMaxRollforwardVersion,
  428. kernel_max_rollforward_version))
  429. .Times(1);
  430. EXPECT_CALL(*mock_metrics_lib_,
  431. SendBoolToUMA(metrics::kMetricKernelMaxRollforwardSetSuccess,
  432. kernel_max_rollforward_success))
  433. .Times(1);
  434. reporter_.ReportKeyVersionMetrics(kernel_min_version,
  435. kernel_max_rollforward_version,
  436. kernel_max_rollforward_success);
  437. }
  438. TEST_F(MetricsReporterOmahaTest, ReportEnterpriseUpdateSeenToDownloadDays) {
  439. constexpr int kDaysToUpdate = 10;
  440. constexpr int kMinBucket = 1;
  441. constexpr int kMaxBucket = 6 * 30; // approximately 6 months
  442. constexpr int kNumBuckets = 50;
  443. EXPECT_CALL(*mock_metrics_lib_,
  444. SendToUMA(metrics::kMetricSuccessfulUpdateDurationFromSeenDays,
  445. kDaysToUpdate,
  446. kMinBucket,
  447. kMaxBucket,
  448. kNumBuckets))
  449. .Times(1);
  450. reporter_.ReportEnterpriseUpdateSeenToDownloadDays(
  451. false /* has_time_restriction_policy */, kDaysToUpdate);
  452. }
  453. TEST_F(MetricsReporterOmahaTest,
  454. ReportEnterpriseTimeRestrictedUpdateSeenToDownloadTime) {
  455. const int kDaysToUpdate = 15;
  456. constexpr int kMinBucket = 1;
  457. constexpr int kMaxBucket = 6 * 30; // approximately 6 months
  458. constexpr int kNumBuckets = 50;
  459. EXPECT_CALL(
  460. *mock_metrics_lib_,
  461. SendToUMA(
  462. metrics::kMetricSuccessfulUpdateDurationFromSeenTimeRestrictedDays,
  463. kDaysToUpdate,
  464. kMinBucket,
  465. kMaxBucket,
  466. kNumBuckets))
  467. .Times(1);
  468. reporter_.ReportEnterpriseUpdateSeenToDownloadDays(
  469. true /* has_time_restriction_policy */, kDaysToUpdate);
  470. }
  471. } // namespace chromeos_update_engine