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

Unified Diff: components/offline_pages/background/request_coordinator_unittest.cc

Issue 2420543004: Improve the page download: (Closed)
Patch Set: Created 4 years, 2 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: components/offline_pages/background/request_coordinator_unittest.cc
diff --git a/components/offline_pages/background/request_coordinator_unittest.cc b/components/offline_pages/background/request_coordinator_unittest.cc
index 18b0e67531f3e59c53536a571e5315dfab8a526b..06614b0d240c652ef9369fb8c4e622849fc850a3 100644
--- a/components/offline_pages/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/background/request_coordinator_unittest.cc
@@ -948,10 +948,11 @@ TEST_F(RequestCoordinatorTest, MarkRequestCompleted) {
// Add a request to the queue.
offline_pages::SavePageRequest request1(kRequestId1, kUrl1, kClientId1,
base::Time::Now(), kUserRequested);
- coordinator()->queue()->AddRequest(
- request1, base::Bind(&RequestCoordinatorTest::AddRequestDone,
- base::Unretained(this)));
+ int64_t request_id = coordinator()->SavePageLater(
+ kUrl1, kClientId1, kUserRequested,
+ RequestCoordinator::RequestAvailability::DISABLED_FOR_OFFLINER);
PumpLoop();
+ EXPECT_NE(request_id, 0l);
// Ensure the start processing request stops before the completion callback.
EnableOfflinerCallback(false);
@@ -963,7 +964,7 @@ TEST_F(RequestCoordinatorTest, MarkRequestCompleted) {
EXPECT_TRUE(coordinator()->StartProcessing(device_conditions, callback));
// Call the method under test, making sure we send SUCCESS to the observer.
- coordinator()->MarkRequestCompleted(kRequestId1);
+ coordinator()->MarkRequestCompleted(request_id);
PumpLoop();
// Our observer should have seen SUCCESS instead of REMOVED.
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | components/offline_pages/offline_page_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698