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

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

Issue 2324493005: [Offline Pages] Adds event logs for requests dropped due to number of start or complete attempts. (Closed)
Patch Set: Addresses dimich feedback Created 4 years, 3 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
« no previous file with comments | « components/offline_pages/background/request_picker.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_picker_unittest.cc
diff --git a/components/offline_pages/background/request_picker_unittest.cc b/components/offline_pages/background/request_picker_unittest.cc
index c5f951b1822f8ef0ab14d2f9b48afc924cfd8caf..0f03754fccc0ad82b94a942c8804d654b604cc96 100644
--- a/components/offline_pages/background/request_picker_unittest.cc
+++ b/components/offline_pages/background/request_picker_unittest.cc
@@ -109,6 +109,7 @@ class RequestPickerTest : public testing::Test {
std::unique_ptr<RequestNotifierStub> notifier_;
std::unique_ptr<SavePageRequest> last_picked_;
std::unique_ptr<OfflinerPolicy> policy_;
+ RequestCoordinatorEventLogger event_logger_;
bool request_queue_not_picked_called_;
private:
@@ -128,8 +129,8 @@ void RequestPickerTest::SetUp() {
queue_.reset(new RequestQueue(std::move(store)));
policy_.reset(new OfflinerPolicy());
notifier_.reset(new RequestNotifierStub());
- picker_.reset(
- new RequestPicker(queue_.get(), policy_.get(), notifier_.get()));
+ picker_.reset(new RequestPicker(queue_.get(), policy_.get(), notifier_.get(),
+ &event_logger_));
request_queue_not_picked_called_ = false;
}
@@ -194,8 +195,8 @@ TEST_F(RequestPickerTest, ChooseRequestWithHigherRetryCount) {
policy_.reset(new OfflinerPolicy(kPreferUntried, kPreferEarlier,
kPreferRetryCount, kMaxStartedTries,
kMaxCompletedTries + 1));
- picker_.reset(
- new RequestPicker(queue_.get(), policy_.get(), notifier_.get()));
+ picker_.reset(new RequestPicker(queue_.get(), policy_.get(), notifier_.get(),
+ &event_logger_));
base::Time creation_time = base::Time::Now();
SavePageRequest request1(
@@ -230,8 +231,8 @@ TEST_F(RequestPickerTest, ChooseEarlierRequest) {
policy_.reset(new OfflinerPolicy(kPreferUntried, kPreferEarlier,
!kPreferRetryCount, kMaxStartedTries,
kMaxCompletedTries));
- picker_.reset(
- new RequestPicker(queue_.get(), policy_.get(), notifier_.get()));
+ picker_.reset(new RequestPicker(queue_.get(), policy_.get(), notifier_.get(),
+ &event_logger_));
base::Time creation_time1 =
base::Time::Now() - base::TimeDelta::FromSeconds(10);
@@ -253,8 +254,8 @@ TEST_F(RequestPickerTest, ChooseSameTimeRequestWithHigherRetryCount) {
policy_.reset(new OfflinerPolicy(kPreferUntried, kPreferEarlier,
!kPreferRetryCount, kMaxStartedTries,
kMaxCompletedTries + 1));
- picker_.reset(
- new RequestPicker(queue_.get(), policy_.get(), notifier_.get()));
+ picker_.reset(new RequestPicker(queue_.get(), policy_.get(), notifier_.get(),
+ &event_logger_));
base::Time creation_time = base::Time::Now();
SavePageRequest request1(kRequestId1, kUrl1, kClientId1, creation_time,
@@ -274,8 +275,8 @@ TEST_F(RequestPickerTest, ChooseRequestWithLowerRetryCount) {
policy_.reset(new OfflinerPolicy(!kPreferUntried, kPreferEarlier,
kPreferRetryCount, kMaxStartedTries,
kMaxCompletedTries + 1));
- picker_.reset(
- new RequestPicker(queue_.get(), policy_.get(), notifier_.get()));
+ picker_.reset(new RequestPicker(queue_.get(), policy_.get(), notifier_.get(),
+ &event_logger_));
base::Time creation_time = base::Time::Now();
SavePageRequest request1(kRequestId1, kUrl1, kClientId1, creation_time,
@@ -295,8 +296,8 @@ TEST_F(RequestPickerTest, ChooseLaterRequest) {
policy_.reset(new OfflinerPolicy(kPreferUntried, !kPreferEarlier,
!kPreferRetryCount, kMaxStartedTries,
kMaxCompletedTries));
- picker_.reset(
- new RequestPicker(queue_.get(), policy_.get(), notifier_.get()));
+ picker_.reset(new RequestPicker(queue_.get(), policy_.get(), notifier_.get(),
+ &event_logger_));
base::Time creation_time1 =
base::Time::Now() - base::TimeDelta::FromSeconds(10);
« no previous file with comments | « components/offline_pages/background/request_picker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698