Commit eca4fb76 authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Fix a scoped temp dir leak in ImportantSitesUsageCounterTest

The SQL DB owned by the QuotaManager gets destroyed asynchronously, so
given the current ordering of the parameters:
  base::ScopedTempDir temp_dir_;
  scoped_refptr<QuotaManager> quota_manager_;

The release of |quota_manager_| will post a task to close the database
stored in temp_dir_ but this is racy with the destruction of
|temp_dir_|.

Bug: 974310
Change-Id: Ib54ea1fe1652028a1bcf6b7f6107a01d3e99f2d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660833
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Auto-Submit: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672215}
parent dfafe0d9
...@@ -34,7 +34,11 @@ class ImportantSitesUsageCounterTest : public testing::Test { ...@@ -34,7 +34,11 @@ class ImportantSitesUsageCounterTest : public testing::Test {
run_loop_.reset(new base::RunLoop()); run_loop_.reset(new base::RunLoop());
} }
void TearDown() override { content::RunAllTasksUntilIdle(); } void TearDown() override {
// Release the quota manager and wait for the database to be closed.
quota_manager_.reset();
content::RunAllTasksUntilIdle();
}
TestingProfile* profile() { return &profile_; } TestingProfile* profile() { return &profile_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment