Commit 8cf52369 authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[Background Fetch] Fix race condition in Data Manager test.

The Cleanup task spawns some deletions tasks which access the cache
storage on another thread. This can cause a race condition with a
regular RunLoop, so I replaced it with the TestBrowserThreadBundle.

TBR=peter@chromium.org

Change-Id: I6ab56a4a0c72b50831461832bce6a3ab10ea5543
Reviewed-on: https://chromium-review.googlesource.com/1143404Reviewed-by: default avatarMugdha Lakhani <nator@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576487}
parent 33bd4854
...@@ -1227,7 +1227,7 @@ TEST_F(BackgroundFetchDataManagerTest, Cleanup) { ...@@ -1227,7 +1227,7 @@ TEST_F(BackgroundFetchDataManagerTest, Cleanup) {
// Cleanup should delete the registration. // Cleanup should delete the registration.
background_fetch_data_manager_->Cleanup(); background_fetch_data_manager_->Cleanup();
base::RunLoop().RunUntilIdle(); thread_bundle_.RunUntilIdle();
EXPECT_EQ(0u, EXPECT_EQ(0u,
GetRegistrationUserDataByKeyPrefix(sw_id, kUserDataPrefix).size()); GetRegistrationUserDataByKeyPrefix(sw_id, kUserDataPrefix).size());
......
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