Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: content/browser/background_fetch/background_fetch_service_unittest.cc

Issue 2973233002: [Background Fetch] Cleanup/fix thread safety (Closed)
Patch Set: Remove n.b. from comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/background_fetch/background_fetch_service_unittest.cc
diff --git a/content/browser/background_fetch/background_fetch_service_unittest.cc b/content/browser/background_fetch/background_fetch_service_unittest.cc
index 46b495da2571d48a36e41af44400be2cc7d9d564..4f405523182447f70c0cb4402c9a665650df1352 100644
--- a/content/browser/background_fetch/background_fetch_service_unittest.cc
+++ b/content/browser/background_fetch/background_fetch_service_unittest.cc
@@ -121,12 +121,14 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase {
void SetUp() override {
BackgroundFetchTestBase::SetUp();
+ // StoragePartition creates its own BackgroundFetchContext, but this test
+ // doesn't use that since it has the wrong ServiceWorkerContextWrapper; this
+ // test just uses the StoragePartition to get a URLRequestContext.
StoragePartitionImpl* storage_partition =
static_cast<StoragePartitionImpl*>(
BrowserContext::GetDefaultStoragePartition(browser_context()));
-
context_ = new BackgroundFetchContext(
- browser_context(), storage_partition,
+ browser_context(),
make_scoped_refptr(embedded_worker_test_helper()->context_wrapper()));
context_->InitializeOnIOThread(
make_scoped_refptr(storage_partition->GetURLRequestContext()));
@@ -140,7 +142,6 @@ class BackgroundFetchServiceTest : public BackgroundFetchTestBase {
service_.reset();
- context_->Shutdown();
context_ = nullptr;
// Give pending shutdown operations a chance to finish.

Powered by Google App Engine
This is Rietveld 408576698