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

Unified Diff: chrome/browser/push_messaging/background_budget_service_unittest.cc

Issue 1977423002: Added UMA stats to track the budget for any service worker which receives a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Post-rebase include fix Created 4 years, 7 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: chrome/browser/push_messaging/background_budget_service_unittest.cc
diff --git a/chrome/browser/push_messaging/background_budget_service_unittest.cc b/chrome/browser/push_messaging/background_budget_service_unittest.cc
index 501602881cd4def8dce4a089004b1cf294094aac..75c34893bf5056227f33e8e679a9d1f329267d4e 100644
--- a/chrome/browser/push_messaging/background_budget_service_unittest.cc
+++ b/chrome/browser/push_messaging/background_budget_service_unittest.cc
@@ -21,7 +21,7 @@ namespace {
const char kTestOrigin[] = "https://example.com";
const double kTestBudget = 10.0;
-const double kTestSES = 24.0;
+const double kTestSES = 48.0;
const double kLowSES = 1.0;
const double kMaxSES = 100.0;
// Mirrors definition in BackgroundBudgetService, this is 10 days of seconds.
@@ -184,11 +184,13 @@ TEST_F(BackgroundBudgetServiceTest, GetBudgetConsumedOverTime) {
budget = service->GetBudget(origin);
if (i % 10 == 0) {
- service->StoreBudget(origin, budget - 1.0);
+ double cost = BackgroundBudgetService::GetCost(
+ BackgroundBudgetService::CostType::SILENT_PUSH);
+ service->StoreBudget(origin, budget - cost);
}
}
- // With a SES of 24.0, the origin will get a budget of 2.4 per day, but the
+ // With a SES of 48.0, the origin will get a budget of 2.4 per day, but the
// old budget will also decay. At the end, we expect the budget to be lower
// than the starting budget.
EXPECT_GT(budget, 0.0);

Powered by Google App Engine
This is Rietveld 408576698