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

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

Issue 2778793002: Start aligning BackgroundFetchRequestInfo with the passed in request object. (Closed)
Patch Set: Rebase Created 3 years, 9 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_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..0c59d853fa2fd33e509f2efab0b0ae13087f3b28 100644
--- a/content/browser/background_fetch/background_fetch_job_controller_unittest.cc
+++ b/content/browser/background_fetch/background_fetch_job_controller_unittest.cc
@@ -17,6 +17,7 @@
#include "content/browser/background_fetch/background_fetch_data_manager.h"
#include "content/browser/background_fetch/background_fetch_job_info.h"
#include "content/browser/background_fetch/background_fetch_request_info.h"
+#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/fake_download_item.h"
#include "content/public/test/mock_download_manager.h"
@@ -211,7 +212,10 @@ TEST_F(BackgroundFetchJobControllerTest, SingleRequestJob) {
BackgroundFetchRegistrationId registration_id(
kServiceWorkerRegistrationId, url::Origin(GURL(kOrigin)), kTag);
- BackgroundFetchRequestInfo request_info(GURL(kTestUrl), kJobGuid);
+ ServiceWorkerHeaderMap headers;
+ ServiceWorkerFetchRequest request(GURL(kTestUrl), "GET", headers, Referrer(),
+ false /* is_reload */);
+ BackgroundFetchRequestInfo request_info(request);
request_info.set_state(DownloadItem::DownloadState::IN_PROGRESS);
data_manager()->set_next_request(&request_info);
InitializeJobController(registration_id);
@@ -248,7 +252,10 @@ TEST_F(BackgroundFetchJobControllerTest, MultipleRequestJob) {
std::vector<BackgroundFetchRequestInfo> request_infos;
for (int i = 0; i < 10; i++) {
- request_infos.emplace_back(GURL(kTestUrl), base::IntToString(i));
+ ServiceWorkerHeaderMap headers;
+ ServiceWorkerFetchRequest request(GURL(kTestUrl), "GET", headers,
+ Referrer(), false /* is_reload */);
+ request_infos.emplace_back(request);
}
data_manager()->set_next_request(&request_infos[0]);
InitializeJobController(registration_id);
@@ -298,7 +305,10 @@ TEST_F(BackgroundFetchJobControllerTest, UpdateStorageState) {
BackgroundFetchRegistrationId registration_id(
kServiceWorkerRegistrationId, url::Origin(GURL(kOrigin)), kTag);
- BackgroundFetchRequestInfo request_info(GURL(kTestUrl), kJobGuid);
+ ServiceWorkerHeaderMap headers;
+ ServiceWorkerFetchRequest request(GURL(kTestUrl), "GET", headers, Referrer(),
+ false /* is_reload */);
+ BackgroundFetchRequestInfo request_info(request);
request_info.set_state(DownloadItem::DownloadState::IN_PROGRESS);
data_manager()->set_next_request(&request_info);
InitializeJobController(registration_id);

Powered by Google App Engine
This is Rietveld 408576698