Skip to content

Commit

Permalink
Uplift of #8845 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases committed May 19, 2021
1 parent 064d69f commit 939fa29
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/brave_ads/browser/ads_service_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,25 @@ class TestRewardsServiceObserver
~TestRewardsServiceObserver() override = default;

void WaitForRewardsInitialization() {
if (rewards_initialized_) {
return;
}

run_loop_ = std::make_unique<base::RunLoop>();
run_loop_->Run();
}

// RewardsServiceObserver implementation
void OnRewardsInitialized(brave_rewards::RewardsService* service) override {
run_loop_->Quit();
rewards_initialized_ = true;
if (run_loop_) {
run_loop_->Quit();
}
}

private:
std::unique_ptr<base::RunLoop> run_loop_;
bool rewards_initialized_ = false;
};

class BraveAdsBrowserTest : public InProcessBrowserTest,
Expand Down

0 comments on commit 939fa29

Please sign in to comment.