Skip to content

Commit

Permalink
brave_stats: Change dtoi expiration to 30 days
Browse files Browse the repository at this point in the history
This was requested by the growth team and passed privacy review.

Resolves brave/brave-browser#17089
  • Loading branch information
Kevin Kuehler committed Jul 21, 2021
1 parent 1e04b84 commit 47e9195
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion browser/brave_stats/brave_stats_updater_params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace brave_stats {
base::Time BraveStatsUpdaterParams::g_current_time;
bool BraveStatsUpdaterParams::g_force_first_run = false;
static constexpr base::TimeDelta g_dtoi_delete_delta =
base::TimeDelta::FromSeconds(14 * 24 * 60 * 60);
base::TimeDelta::FromSeconds(30 * 24 * 60 * 60);

BraveStatsUpdaterParams::BraveStatsUpdaterParams(
PrefService* stats_pref_service,
Expand Down
8 changes: 4 additions & 4 deletions browser/brave_stats/brave_stats_updater_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ TEST_F(BraveStatsUpdaterTest, HasDailyRetention) {
exploded.day_of_month = 4;

EXPECT_TRUE(base::Time::FromLocalExploded(exploded, &dtoi_time));
// Make first run date 6 days earlier (still within 14 day window)
exploded.day_of_month = 10;
// Make first run date 15 days earlier (still within 14 day window)
exploded.day_of_month = 20;
EXPECT_TRUE(base::Time::FromLocalExploded(exploded, &current_time));

SetCurrentTimeForTest(dtoi_time);
Expand All @@ -287,8 +287,8 @@ TEST_F(BraveStatsUpdaterTest, HasDailyRetentionExpiration) {
exploded.day_of_month = 4;

EXPECT_TRUE(base::Time::FromLocalExploded(exploded, &dtoi_time));
// Make first run date 14 days earlier (outside 14 day window)
exploded.day_of_month = 18;
// Make first run date a month earlier (outside 30 day window)
exploded.month = 12;
EXPECT_TRUE(base::Time::FromLocalExploded(exploded, &current_time));

SetCurrentTimeForTest(dtoi_time);
Expand Down

0 comments on commit 47e9195

Please sign in to comment.