Skip to content

Commit

Permalink
Revert "Merge pull request #7933 from brave/pr7924_ksmith-fix-bap-cut…
Browse files Browse the repository at this point in the history
…off_1.21.x"

This reverts commit 4ef5188, reversing
changes made to 0814d47.
  • Loading branch information
bsclifton committed Feb 26, 2021
1 parent 706d689 commit d7a6695
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions components/brave_rewards/browser/rewards_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1494,9 +1494,8 @@ bool RewardsServiceImpl::GetBooleanOption(const std::string& name) const {
base::Time::Exploded cutoff_exploded{
.year = 2021, .month = 3, .day_of_month = 13};
base::Time cutoff;
bool ok = base::Time::FromUTCExploded(cutoff_exploded, &cutoff);
DCHECK(ok);
if (ok && base::Time::Now() >= cutoff) {
DCHECK(base::Time::FromUTCExploded(cutoff_exploded, &cutoff));
if (base::Time::Now() >= cutoff) {
return true;
}
}
Expand Down
8 changes: 4 additions & 4 deletions components/brave_rewards/browser/test/rewards_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ namespace {

base::Time GetDate(int year, int month, int day_of_month) {
base::Time time;
bool ok = base::Time::FromUTCExploded(
DCHECK(base::Time::FromUTCExploded(
base::Time::Exploded{
.year = year, .month = month, .day_of_month = day_of_month},
&time);
DCHECK(ok);
&time));
return time;
}

Expand Down Expand Up @@ -483,7 +482,8 @@ IN_PROC_BROWSER_TEST_F(RewardsBrowserTest, BAPCutoffBefore) {

{
base::subtle::ScopedTimeClockOverrides time_override(
[]() { return GetDate(2021, 3, 12); }, nullptr, nullptr);
[]() { return GetDate(2021, 3, 13) - base::TimeDelta::FromSeconds(1); },
nullptr, nullptr);
ASSERT_EQ(FetchBalance(), 30.0);
}
}
Expand Down

0 comments on commit d7a6695

Please sign in to comment.