Chromium Code Reviews| Index: content/browser/background_fetch/background_fetch_job_controller_unittest.cc |
| diff --git a/content/browser/background_fetch/background_fetch_job_controller_unittest.cc b/content/browser/background_fetch/background_fetch_job_controller_unittest.cc |
| index 93288d5067cd554a56b1adf77bfaefb1557010e9..e14c6a292b4f4eac8a6e747b043402deeb04f079 100644 |
| --- a/content/browser/background_fetch/background_fetch_job_controller_unittest.cc |
| +++ b/content/browser/background_fetch/background_fetch_job_controller_unittest.cc |
| @@ -155,7 +155,7 @@ class BackgroundFetchJobControllerTest : public ::testing::Test { |
| void InitializeJobController( |
| const BackgroundFetchRegistrationId& registration_id) { |
| job_controller_ = base::MakeUnique<BackgroundFetchJobController>( |
| - registration_id, &browser_context_, |
| + registration_id, BackgroundFetchOptions(), &browser_context_, |
| BrowserContext::GetDefaultStoragePartition(&browser_context_), |
| data_manager_.get(), |
| base::BindOnce(&BackgroundFetchJobControllerTest::DidCompleteJob, |
| @@ -163,10 +163,12 @@ class BackgroundFetchJobControllerTest : public ::testing::Test { |
| } |
| void DidCompleteJob( |
| + const BackgroundFetchRegistrationId& original_registration_id, |
| const BackgroundFetchRegistrationId& registration_id, |
| - const BackgroundFetchRegistrationId& original_registration_id) { |
| + bool aborted_by_developer) { |
| ASSERT_EQ(registration_id, original_registration_id); |
| did_complete_job_ = true; |
| + did_abort_by_developer_ = true; |
|
harkness
2017/03/27 16:34:12
Shouldn't this be did_abort_by_developer_ = aborte
Peter Beverloo
2017/03/28 13:34:22
Done.
|
| } |
| void StartProcessing() { |
| @@ -193,6 +195,7 @@ class BackgroundFetchJobControllerTest : public ::testing::Test { |
| DownloadItem::Observer* ItemObserver() const { return job_controller_.get(); } |
| bool did_complete_job() const { return did_complete_job_; } |
| + bool did_abort_by_developer() const { return did_abort_by_developer_; } |
| FakeBackgroundFetchDataManager* data_manager() const { |
| return data_manager_.get(); |
| @@ -200,6 +203,7 @@ class BackgroundFetchJobControllerTest : public ::testing::Test { |
| private: |
| bool did_complete_job_ = false; |
| + bool did_abort_by_developer_ = false; |
| TestBrowserThreadBundle thread_bundle_; |
| TestBrowserContext browser_context_; |
| std::unique_ptr<FakeBackgroundFetchDataManager> data_manager_; |
| @@ -240,6 +244,7 @@ TEST_F(BackgroundFetchJobControllerTest, SingleRequestJob) { |
| EXPECT_EQ(DownloadItem::DownloadState::COMPLETE, request_info.state()); |
| EXPECT_TRUE(did_complete_job()); |
| + EXPECT_FALSE(did_abort_by_developer()); |
| } |
| TEST_F(BackgroundFetchJobControllerTest, MultipleRequestJob) { |
| @@ -292,6 +297,7 @@ TEST_F(BackgroundFetchJobControllerTest, MultipleRequestJob) { |
| ItemObserver()->OnDownloadUpdated(item); |
| EXPECT_TRUE(did_complete_job()); |
| + EXPECT_FALSE(did_abort_by_developer()); |
| } |
| TEST_F(BackgroundFetchJobControllerTest, UpdateStorageState) { |
| @@ -326,6 +332,7 @@ TEST_F(BackgroundFetchJobControllerTest, UpdateStorageState) { |
| EXPECT_EQ(123, request_info.received_bytes()); |
| EXPECT_TRUE(data_manager()->IsComplete(kJobGuid)); |
| EXPECT_TRUE(did_complete_job()); |
| + EXPECT_FALSE(did_abort_by_developer()); |
| } |
| } // namespace content |