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

Side by Side Diff: content/browser/background_fetch/background_fetch_service_unittest.cc

Issue 2796933003: Store BackgroundFetchRequestInfo in a refcounted pointer (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/browser/background_fetch/background_fetch_request_info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <map> 5 #include <map>
6 #include <memory> 6 #include <memory>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 context_ = new BackgroundFetchContext( 233 context_ = new BackgroundFetchContext(
234 browser_context(), storage_partition, 234 browser_context(), storage_partition,
235 make_scoped_refptr(embedded_worker_test_helper()->context_wrapper())); 235 make_scoped_refptr(embedded_worker_test_helper()->context_wrapper()));
236 service_ = base::MakeUnique<BackgroundFetchServiceImpl>( 236 service_ = base::MakeUnique<BackgroundFetchServiceImpl>(
237 0 /* render_process_id */, context_); 237 0 /* render_process_id */, context_);
238 } 238 }
239 239
240 void TearDown() override { 240 void TearDown() override {
241 service_.reset(); 241 service_.reset();
242 242
243 EXPECT_CALL(*download_manager_, Shutdown()).Times(1);
244
243 context_->Shutdown(); 245 context_->Shutdown();
244 context_ = nullptr; 246 context_ = nullptr;
245 247
246 // Give pending shutdown operations a chance to finish. 248 // Give pending shutdown operations a chance to finish.
247 base::RunLoop().RunUntilIdle(); 249 base::RunLoop().RunUntilIdle();
248 250
249 BackgroundFetchTestBase::TearDown(); 251 BackgroundFetchTestBase::TearDown();
250 } 252 }
251 253
252 private: 254 private:
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 const bool has_alternative_tag = 628 const bool has_alternative_tag =
627 tags[0] == kAlternativeTag || tags[1] == kAlternativeTag; 629 tags[0] == kAlternativeTag || tags[1] == kAlternativeTag;
628 630
629 EXPECT_TRUE(has_example_tag); 631 EXPECT_TRUE(has_example_tag);
630 EXPECT_TRUE(has_alternative_tag); 632 EXPECT_TRUE(has_alternative_tag);
631 } 633 }
632 } 634 }
633 635
634 } // namespace 636 } // namespace
635 } // namespace content 637 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/background_fetch/background_fetch_request_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698