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

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

Issue 2543093002: Split the RequestPicker task into two separate tasks. (Closed)
Patch Set: ADD TODO Created 4 years 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
« no previous file with comments | « components/offline_pages/background/request_queue.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/request_queue_unittest.cc
diff --git a/components/offline_pages/background/request_queue_unittest.cc b/components/offline_pages/background/request_queue_unittest.cc
index 8ba805a9b7f3c95c95e6ef263462cc81f76f5819..c7897b08fa6f6cf04f63b45b9d461ce044012b5c 100644
--- a/components/offline_pages/background/request_queue_unittest.cc
+++ b/components/offline_pages/background/request_queue_unittest.cc
@@ -535,8 +535,6 @@ TEST_F(RequestQueueTest, MarkAttemptCompleted) {
update_requests_result()->updated_items.at(0).request_state());
}
-// Request expiration is detected during the call to pick a request, which
-// is why this test calls PickNextRequest().
TEST_F(RequestQueueTest, CleanStaleRequests) {
// Create a request that is already expired.
base::Time creation_time =
@@ -554,21 +552,14 @@ TEST_F(RequestQueueTest, CleanStaleRequests) {
OfflinerPolicy policy;
RequestNotifierStub notifier;
RequestCoordinatorEventLogger event_logger;
- std::unique_ptr<PickRequestTaskFactory> picker_factory(
- new PickRequestTaskFactory(&policy, &notifier, &event_logger));
- queue()->SetPickerFactory(std::move(picker_factory));
+ std::unique_ptr<CleanupTaskFactory> cleanup_factory(
+ new CleanupTaskFactory(&policy, &notifier, &event_logger));
+ queue()->SetCleanupFactory(std::move(cleanup_factory));
// Do a pick and clean operation, which will remove stale entries.
DeviceConditions conditions;
std::set<int64_t> disabled_list;
- queue()->PickNextRequest(
- base::Bind(&RequestQueueTest::RequestPickedCallback,
- base::Unretained(this)),
- base::Bind(&RequestQueueTest::RequestNotPickedCallback,
- base::Unretained(this)),
- base::Bind(&RequestQueueTest::RequestCountCallback,
- base::Unretained(this)),
- conditions, disabled_list);
+ queue()->CleanupRequestQueue();
this->PumpLoop();
« no previous file with comments | « components/offline_pages/background/request_queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698