Commit d211aab2 authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Fix temp dir cleanup in some media unit_tests.

ScopedTempDirs must outlive anything that holds file(s) open within
them; otherwise, they are unable to delete their backing directories.

BUG=546640


Change-Id: I9a47962d2f4fae44da1882d25383af6b6b3839a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893274
Auto-Submit: Greg Thompson <grt@chromium.org>
Commit-Queue: Tommi <tommi@chromium.org>
Reviewed-by: default avatarTommi <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711230}
parent ba531138
......@@ -46,6 +46,9 @@ class MediaHistoryStoreUnitTest : public testing::Test {
EXPECT_TRUE(db_.Open(db_file));
}
private:
base::ScopedTempDir temp_dir_;
protected:
sql::Database& GetDB() { return db_; }
content::BrowserTaskEnvironment task_environment_;
......@@ -53,7 +56,6 @@ class MediaHistoryStoreUnitTest : public testing::Test {
private:
sql::Database db_;
std::unique_ptr<MediaHistoryStore> media_history_store_;
base::ScopedTempDir temp_dir_;
};
TEST_F(MediaHistoryStoreUnitTest, CreateDatabaseTables) {
......
......@@ -278,12 +278,12 @@ class MediaEngagementServiceTest : public ChromeRenderViewHostTestHarness,
scoped_refptr<base::TestMockTimeTaskRunner> mock_time_task_runner_;
private:
base::ScopedTempDir temp_dir_;
base::SimpleTestClock test_clock_;
std::unique_ptr<MediaEngagementService> service_;
base::ScopedTempDir temp_dir_;
base::test::ScopedFeatureList scoped_feature_list_;
};
......
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