OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |